Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/uui/source/unknownauthdlg.cxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#include "unknownauthdlg.hxx"
21
22
#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
23
24
#include <vcl/vclenum.hxx>
25
#include <vcl/weld/Builder.hxx>
26
27
using namespace css;
28
29
IMPL_LINK_NOARG(UnknownAuthDialog, OKHdl_Impl, weld::Button&, void)
30
0
{
31
0
    if (m_xOptionButtonAccept->get_active())
32
0
    {
33
0
        m_xDialog->response(RET_OK);
34
0
    }
35
0
    else
36
0
    {
37
0
        m_xDialog->response(RET_CANCEL);
38
0
    }
39
0
}
40
41
IMPL_LINK_NOARG(UnknownAuthDialog, ViewCertHdl_Impl, weld::Button&, void)
42
0
{
43
0
    uno::Reference<css::security::XDocumentDigitalSignatures> xDocumentDigitalSignatures(
44
0
        css::security::DocumentDigitalSignatures::createDefault(m_xContext));
45
0
    xDocumentDigitalSignatures->setParentWindow(m_xDialog->GetXWindow());
46
0
    xDocumentDigitalSignatures->showCertificate(m_rXCert);
47
0
}
48
49
UnknownAuthDialog::UnknownAuthDialog(
50
    weld::Window* pParent, const css::uno::Reference<css::security::XCertificate>& rXCert,
51
    const css::uno::Reference<css::uno::XComponentContext>& xContext)
52
0
    : MessageDialogController(pParent, u"uui/ui/unknownauthdialog.ui"_ustr,
53
0
                              u"UnknownAuthDialog"_ustr)
54
0
    , m_xCommandButtonOK(m_xBuilder->weld_button(u"ok"_ustr))
55
0
    , m_xView_Certificate(m_xBuilder->weld_button(u"examine"_ustr))
56
0
    , m_xOptionButtonAccept(m_xBuilder->weld_radio_button(u"accept"_ustr))
57
0
    , m_xContext(xContext)
58
0
    , m_rXCert(rXCert)
59
0
{
60
0
    m_xView_Certificate->connect_clicked(LINK(this, UnknownAuthDialog, ViewCertHdl_Impl));
61
0
    m_xCommandButtonOK->connect_clicked(LINK(this, UnknownAuthDialog, OKHdl_Impl));
62
0
}
63
64
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */