diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-12-13 12:05:45 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-12-23 14:19:50 +0000 |
commit | d5e0c2c8db71878d21c2a7255af08cf5f9a6dd04 (patch) | |
tree | c7c6020e094b76a9f2d9e0c8b114526a2dabd7d9 /sfx2 | |
parent | c0c4519e0d5b555f59bbc04cc616454edfd1f4ce (diff) |
loplugin:unocast (sfx2::DigitalSignatures)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)
Change-Id: I74c76452cf7921da55462581ef48aea86f58ea18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144763
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/Library_sfx.mk | 1 | ||||
-rw-r--r-- | sfx2/source/doc/digitalsignatures.cxx | 30 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 3 |
3 files changed, 33 insertions, 1 deletions
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index 7b1dee935ff3..0c1f654d4a1e 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -213,6 +213,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/doc/QuerySaveDocument \ sfx2/source/doc/SfxDocumentMetaData \ sfx2/source/doc/autoredactdialog \ + sfx2/source/doc/digitalsignatures \ sfx2/source/doc/docfac \ sfx2/source/doc/docfile \ sfx2/source/doc/docfilt \ diff --git a/sfx2/source/doc/digitalsignatures.cxx b/sfx2/source/doc/digitalsignatures.cxx new file mode 100644 index 000000000000..73f50cde19aa --- /dev/null +++ b/sfx2/source/doc/digitalsignatures.cxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <sal/config.h> + +#include <comphelper/servicehelper.hxx> +#include <sfx2/digitalsignatures.hxx> + +sal_Int64 sfx2::DigitalSignatures::getSomething(css::uno::Sequence<sal_Int8> const& aIdentifier) +{ + return comphelper::getSomethingImpl(aIdentifier, this); +} + +css::uno::Sequence<sal_Int8> const& sfx2::DigitalSignatures::getUnoTunnelId() +{ + static comphelper::UnoIdInit const id; + return id.getSeq(); +} + +sfx2::DigitalSignatures::DigitalSignatures() = default; + +sfx2::DigitalSignatures::~DigitalSignatures() = default; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index c81b79e8ec4e..fdebd24107a6 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -78,6 +78,7 @@ #include <comphelper/propertyvalue.hxx> #include <comphelper/interaction.hxx> #include <comphelper/sequence.hxx> +#include <comphelper/servicehelper.hxx> #include <comphelper/simplefileaccessinteraction.hxx> #include <comphelper/string.hxx> #include <framework/interaction.hxx> @@ -4008,7 +4009,7 @@ bool SfxMedium::SignDocumentContentUsingCertificate( uno::Reference< security::XDocumentDigitalSignatures > xSigner( security::DocumentDigitalSignatures::createWithVersionAndValidSignature( comphelper::getProcessComponentContext(), aODFVersion, bHasValidDocumentSignature ) ); - auto xModelSigner = dynamic_cast<sfx2::DigitalSignatures*>(xSigner.get()); + auto xModelSigner = comphelper::getFromUnoTunnel<sfx2::DigitalSignatures>(xSigner); if (!xModelSigner) { return bChanges; |