summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/dialogs/SignSignatureLineDialog.cxx8
-rw-r--r--desktop/source/lib/init.cxx4
-rw-r--r--include/sfx2/viewsh.hxx5
-rw-r--r--include/svl/cryptosign.hxx13
-rw-r--r--include/svx/signaturelinehelper.hxx9
-rw-r--r--sd/qa/unit/tiledrendering/data/empty.pdfbin0 -> 7208 bytes
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering2.cxx32
-rw-r--r--sd/source/ui/func/fuconrec.cxx17
-rw-r--r--sd/source/ui/view/drviewse.cxx17
-rw-r--r--sfx2/source/doc/objserv.cxx6
-rw-r--r--sfx2/source/view/viewimp.hxx3
-rw-r--r--sfx2/source/view/viewsh.cxx8
-rw-r--r--svx/qa/unit/svdraw.cxx4
-rw-r--r--svx/sdi/svx.sdi2
-rw-r--r--svx/source/dialog/signaturelinehelper.cxx28
-rw-r--r--vcl/qa/cppunit/filter/ipdf/ipdf.cxx4
-rw-r--r--xmlsecurity/qa/unit/signing/signing.cxx4
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx5
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx2
19 files changed, 128 insertions, 43 deletions
diff --git a/cui/source/dialogs/SignSignatureLineDialog.cxx b/cui/source/dialogs/SignSignatureLineDialog.cxx
index a1cf837c107c..cb6a7191c436 100644
--- a/cui/source/dialogs/SignSignatureLineDialog.cxx
+++ b/cui/source/dialogs/SignSignatureLineDialog.cxx
@@ -163,8 +163,10 @@ IMPL_LINK_NOARG(SignSignatureLineDialog, chooseCertificate, weld::Button&, void)
if (xSignCertificate.is())
{
m_xSelectedCertifate = xSignCertificate;
+ svl::crypto::CertificateOrName aCertificateOrName;
+ aCertificateOrName.m_xCertificate = xSignCertificate;
m_xBtnChooseCertificate->set_label(
- svx::SignatureLineHelper::getSignerName(xSignCertificate));
+ svx::SignatureLineHelper::getSignerName(aCertificateOrName));
}
ValidateFields();
}
@@ -210,9 +212,11 @@ css::uno::Reference<css::graphic::XGraphic> SignSignatureLineDialog::getSignedGr
aSvgImage = aSvgImage.replaceAll("[SIGNER_NAME]", getCDataString(m_aSuggestedSignerName));
aSvgImage = aSvgImage.replaceAll("[SIGNER_TITLE]", getCDataString(m_aSuggestedSignerTitle));
+ svl::crypto::CertificateOrName aCertificateOrName;
+ aCertificateOrName.m_xCertificate = m_xSelectedCertifate;
OUString aIssuerLine
= CuiResId(RID_CUISTR_SIGNATURELINE_SIGNED_BY)
- .replaceFirst("%1", svx::SignatureLineHelper::getSignerName(m_xSelectedCertifate));
+ .replaceFirst("%1", svx::SignatureLineHelper::getSignerName(aCertificateOrName));
aSvgImage = aSvgImage.replaceAll("[SIGNED_BY]", getCDataString(aIssuerLine));
if (bValid)
aSvgImage = aSvgImage.replaceAll("[INVALID_SIGNATURE]", "");
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5a5cc6716db6..614a054cb58d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4744,7 +4744,9 @@ static void doc_initializeForRendering(LibreOfficeKitDocument* pThis,
uno::Reference<security::XCertificate> xCertificate = SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey);
if (SfxViewShell* pViewShell = SfxViewShell::Current())
{
- pViewShell->SetSigningCertificate(xCertificate);
+ svl::crypto::CertificateOrName aCertificateOrName;
+ aCertificateOrName.m_xCertificate = xCertificate;
+ pViewShell->SetSigningCertificate(aCertificateOrName);
}
}
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index b32668725b50..082890c6b200 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -72,6 +72,7 @@ namespace com::sun::star::ui { struct ContextMenuExecuteEvent; }
namespace com::sun::star::view { class XRenderable; }
namespace com::sun::star::security { class XCertificate; }
namespace svtools { enum ColorConfigEntry : int; }
+namespace svl::crypto { class CertificateOrName; }
enum class SfxPrinterChangeFlags
{
@@ -492,8 +493,8 @@ public:
OUString getA11yFocusedParagraph() const;
int getA11yCaretPosition() const;
- void SetSigningCertificate(const css::uno::Reference<css::security::XCertificate>& xCertificate);
- const css::uno::Reference<css::security::XCertificate> & GetSigningCertificate() const;
+ void SetSigningCertificate(const svl::crypto::CertificateOrName& rCertificateOrName);
+ svl::crypto::CertificateOrName GetSigningCertificate() const;
};
#endif // INCLUDED_SFX2_VIEWSH_HXX
diff --git a/include/svl/cryptosign.hxx b/include/svl/cryptosign.hxx
index 154292b5f3ce..bad7a5a16e62 100644
--- a/include/svl/cryptosign.hxx
+++ b/include/svl/cryptosign.hxx
@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#pragma once
+
#include <sal/types.h>
#include <utility>
@@ -116,6 +118,17 @@ public:
std::vector<unsigned char> m_aSignatureValue;
};
+/// Used for visual signing: an XCertificate or a signer name.
+class SVL_DLLPUBLIC CertificateOrName
+{
+public:
+ /// If set, the certificate used for signing.
+ css::uno::Reference<css::security::XCertificate> m_xCertificate;
+ /// Otherwise we don't have a certificate but have a name to be featured on the visual
+ /// signature.
+ OUString m_aName;
+};
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/signaturelinehelper.hxx b/include/svx/signaturelinehelper.hxx
index e8105a37bd7f..6f17f3726dd2 100644
--- a/include/svx/signaturelinehelper.hxx
+++ b/include/svx/signaturelinehelper.hxx
@@ -16,6 +16,7 @@
#include <rtl/ustring.hxx>
#include <svx/svxdllapi.h>
+#include <svl/cryptosign.hxx>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/security/XCertificate.hpp>
@@ -45,8 +46,7 @@ getSignatureCertificate(SfxObjectShell* pShell, SfxViewShell* pViewShell, weld::
/**
* Get a signer name out of a certificate.
*/
-SVX_DLLPUBLIC OUString
-getSignerName(const css::uno::Reference<css::security::XCertificate>& xCertificate);
+SVX_DLLPUBLIC OUString getSignerName(const svl::crypto::CertificateOrName& rCertificateOrName);
/**
* Gets a localized date string.
@@ -61,9 +61,8 @@ SVX_DLLPUBLIC css::uno::Reference<css::graphic::XGraphic> importSVG(std::u16stri
/**
* Sets xCertificate as the signing certificate of the selected shape on pView.
*/
-SVX_DLLPUBLIC void
-setShapeCertificate(const SdrView* pView,
- const css::uno::Reference<css::security::XCertificate>& xCertificate);
+SVX_DLLPUBLIC void setShapeCertificate(const SdrView* pView,
+ const svl::crypto::CertificateOrName& rCertificateOrName);
}
#endif
diff --git a/sd/qa/unit/tiledrendering/data/empty.pdf b/sd/qa/unit/tiledrendering/data/empty.pdf
new file mode 100644
index 000000000000..d6142103184b
--- /dev/null
+++ b/sd/qa/unit/tiledrendering/data/empty.pdf
Binary files differ
diff --git a/sd/qa/unit/tiledrendering/tiledrendering2.cxx b/sd/qa/unit/tiledrendering/tiledrendering2.cxx
index 28860a293b41..bf9f7db738a4 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering2.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering2.cxx
@@ -11,6 +11,11 @@
#include <sfx2/sidebar/Sidebar.hxx>
#include <vcl/scheduler.hxx>
+#include <comphelper/propertyvalue.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+
+#include <DrawDocShell.hxx>
+#include <ViewShell.hxx>
CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSidebarSwitchDeck)
{
@@ -36,6 +41,33 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSidebarSwitchDeck)
CPPUNIT_ASSERT(it != aView.m_aStateChanges.end());
}
+CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testInsertSignatureLineExternal)
+{
+ // Given a PDF to be signed:
+ uno::Sequence<beans::PropertyValue> aArgs = { comphelper::makePropertyValue("ReadOnly", true) };
+ loadWithParams(createFileURL(u"empty.pdf"), aArgs);
+ SdXImpressDocument* pImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
+ sd::ViewShell* pViewShell = pImpressDocument->GetDocShell()->GetViewShell();
+ sd::View* pView = pViewShell->GetView();
+ pView->SetAuthor("myauthor");
+
+ // When insrerting a signature line for electronic (extrenal) signing:
+ aArgs = {
+ comphelper::makePropertyValue("External", true),
+ };
+ // Without the accompanying fix in place, this test would hang here in the certificate chooser
+ // dialog.
+ dispatchCommand(mxComponent, ".uno:InsertSignatureLine", aArgs);
+
+ // Then make sure the shape is marked as a signature line:
+ std::vector<SdrObject*> aMarkedObjects = pView->GetMarkedObjects();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aMarkedObjects.size());
+ uno::Any aAny;
+ aMarkedObjects[0]->GetGrabBagItem(aAny);
+ comphelper::SequenceAsHashMap aMap(aAny);
+ CPPUNIT_ASSERT(aMap.contains("SignatureCertificate"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index 5cbdb1e82596..2e4e7a9cfcb2 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -512,16 +512,19 @@ void FuConstructRectangle::Deactivate()
return;
}
- uno::Reference<security::XCertificate> xCertificate
- = svx::SignatureLineHelper::getSignatureCertificate(mpViewShell->GetObjectShell(),
- mpViewShell->GetViewShell(),
- mpViewShell->GetFrameWeld());
- if (!xCertificate.is())
+ svl::crypto::CertificateOrName aCertificateOrName = mpViewShell->GetViewShell()->GetSigningCertificate();
+ if (aCertificateOrName.m_aName.isEmpty())
{
- return;
+ aCertificateOrName.m_xCertificate = svx::SignatureLineHelper::getSignatureCertificate(
+ mpViewShell->GetObjectShell(), mpViewShell->GetViewShell(),
+ mpViewShell->GetFrameWeld());
+ if (!aCertificateOrName.m_xCertificate.is())
+ {
+ return;
+ }
}
- svx::SignatureLineHelper::setShapeCertificate(mpView, xCertificate);
+ svx::SignatureLineHelper::setShapeCertificate(mpView, aCertificateOrName);
// Update infobar to offer "finish signing".
SfxViewFrame* pFrame = mpViewShell->GetViewFrame();
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index ea2f65a01c00..f9466b51a3d1 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -61,6 +61,7 @@
#include <sfx2/docfile.hxx>
#include <sfx2/notebookbar/SfxNotebookBar.hxx>
#include <osl/diagnose.h>
+#include <svl/cryptosign.hxx>
#include <DrawViewShell.hxx>
#include <slideshow.hxx>
@@ -471,18 +472,28 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq)
{
aSignatureKey = pSignatureKey->GetValue().toUtf8();
}
+ bool bExternal = false;
+ const SfxBoolItem* pExternal = rReq.GetArg<SfxBoolItem>(FN_PARAM_3);
+ if (pExternal)
+ {
+ bExternal = pExternal->GetValue();
+ }
SfxViewFrame* pFrame = GetFrame();
SfxViewShell* pViewShell = pFrame ? pFrame->GetViewShell() : nullptr;
if (pViewShell)
{
- uno::Reference<security::XCertificate> xSigningCertificate;
+ svl::crypto::CertificateOrName aCertificateOrName;
if (!aSignatureCert.empty() && !aSignatureKey.empty())
{
- xSigningCertificate = SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey);
+ aCertificateOrName.m_xCertificate = SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey);
+ }
+ else if (bExternal)
+ {
+ aCertificateOrName.m_aName = mpDrawView->GetAuthor();
}
// Always set the signing certificate, to clear data from a previous dispatch.
- pViewShell->SetSigningCertificate(xSigningCertificate);
+ pViewShell->SetSigningCertificate(aCertificateOrName);
}
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 674afcbad1d2..e02cc2646b9c 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -665,13 +665,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
SfxViewShell* pViewShell = pFrame ? pFrame->GetViewShell() : nullptr;
if (pViewShell)
{
- uno::Reference<security::XCertificate> xSigningCertificate;
+ svl::crypto::CertificateOrName aCertificateOrName;
if (!aSignatureCert.empty() && !aSignatureKey.empty())
{
- xSigningCertificate = SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey);
+ aCertificateOrName.m_xCertificate = SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey);
}
// Always set the signing certificate, to clear data from a previous dispatch.
- pViewShell->SetSigningCertificate(xSigningCertificate);
+ pViewShell->SetSigningCertificate(aCertificateOrName);
}
// Async, all code before return has to go into the callback.
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 1dc24eec7a82..83279ae84cee 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -28,6 +28,7 @@
#include <svtools/acceleratorexecute.hxx>
#include <rtl/ref.hxx>
#include <vcl/print.hxx>
+#include <svl/cryptosign.hxx>
#include <chrono>
#include <vector>
@@ -59,7 +60,7 @@ struct SfxViewShell_Impl
static sal_uInt32 m_nLastViewShellId;
const ViewShellId m_nViewShellId;
const ViewShellDocId m_nDocId;
- css::uno::Reference<css::security::XCertificate> m_xSigningCertificate;
+ svl::crypto::CertificateOrName m_aSigningCertificate;
explicit SfxViewShell_Impl(SfxViewShellFlags const nFlags, ViewShellDocId nDocId);
~SfxViewShell_Impl();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index d743cd5ddd02..e42a69ea27aa 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2807,14 +2807,14 @@ int SfxViewShell::getA11yCaretPosition() const
return rDocFocusListener.getCaretPosition();
}
-void SfxViewShell::SetSigningCertificate(const uno::Reference<security::XCertificate>& xCertificate)
+void SfxViewShell::SetSigningCertificate(const svl::crypto::CertificateOrName& rCertificate)
{
- pImpl->m_xSigningCertificate = xCertificate;
+ pImpl->m_aSigningCertificate = rCertificate;
}
-const uno::Reference<security::XCertificate> & SfxViewShell::GetSigningCertificate() const
+svl::crypto::CertificateOrName SfxViewShell::GetSigningCertificate() const
{
- return pImpl->m_xSigningCertificate;
+ return pImpl->m_aSigningCertificate;
}
bool SfxViewShell::PrepareClose
diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx
index 6cf4c6bc10f3..e2c6b58a9dac 100644
--- a/svx/qa/unit/svdraw.cxx
+++ b/svx/qa/unit/svdraw.cxx
@@ -863,7 +863,9 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testVisualSignResize)
return;
}
SdrView* pView = SfxViewShell::Current()->GetDrawView();
- svx::SignatureLineHelper::setShapeCertificate(pView, xCert);
+ svl::crypto::CertificateOrName aCertificateOrName;
+ aCertificateOrName.m_xCertificate = xCert;
+ svx::SignatureLineHelper::setShapeCertificate(pView, aCertificateOrName);
pObjectShell->SetModified(false);
// When resizing the shape by moving the bottom right (last) handle towards top right:
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 449cd55d36d9..edc54923f4d0 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -12416,7 +12416,7 @@ SfxVoidItem AnchorMenu SID_ANCHOR_MENU
]
SfxVoidItem InsertSignatureLine SID_INSERT_SIGNATURELINE
-(SfxStringItem SignatureCert FN_PARAM_1, SfxStringItem SignatureKey FN_PARAM_2)
+(SfxStringItem SignatureCert FN_PARAM_1, SfxStringItem SignatureKey FN_PARAM_2, SfxBoolItem External FN_PARAM_3)
[
AutoUpdate = FALSE,
FastCall = FALSE,
diff --git a/svx/source/dialog/signaturelinehelper.cxx b/svx/source/dialog/signaturelinehelper.cxx
index e079d62d5631..d8a41e8d3cc7 100644
--- a/svx/source/dialog/signaturelinehelper.cxx
+++ b/svx/source/dialog/signaturelinehelper.cxx
@@ -99,10 +99,16 @@ getSignatureCertificate(SfxObjectShell* pShell, SfxViewShell* pViewShell, weld::
return xSignCertificate;
}
-OUString getSignerName(const css::uno::Reference<css::security::XCertificate>& xCertificate)
+OUString getSignerName(const svl::crypto::CertificateOrName& rCertificateOrName)
{
- return comphelper::xmlsec::GetContentPart(xCertificate->getSubjectName(),
- xCertificate->getCertificateKind());
+ if (rCertificateOrName.m_xCertificate.is())
+ {
+ return comphelper::xmlsec::GetContentPart(
+ rCertificateOrName.m_xCertificate->getSubjectName(),
+ rCertificateOrName.m_xCertificate->getCertificateKind());
+ }
+
+ return rCertificateOrName.m_aName;
}
OUString getLocalizedDate()
@@ -130,7 +136,7 @@ uno::Reference<graphic::XGraphic> importSVG(std::u16string_view rSVG)
}
void setShapeCertificate(const SdrView* pView,
- const css::uno::Reference<css::security::XCertificate>& xCertificate)
+ const svl::crypto::CertificateOrName& rCertificateOrName)
{
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if (rMarkList.GetMarkCount() < 1)
@@ -149,15 +155,21 @@ void setShapeCertificate(const SdrView* pView,
uno::Reference<drawing::XShape> xShape = pSignatureLine->getUnoShape();
uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY);
comphelper::SequenceAsHashMap aMap(xShapeProps->getPropertyValue(u"InteropGrabBag"_ustr));
- aMap[u"SignatureCertificate"_ustr] <<= xCertificate;
- xShapeProps->setPropertyValue(u"InteropGrabBag"_ustr,
- uno::Any(aMap.getAsConstPropertyValueList()));
+ if (rCertificateOrName.m_xCertificate.is())
+ {
+ aMap[u"SignatureCertificate"_ustr] <<= rCertificateOrName.m_xCertificate;
+ }
+ else
+ {
+ aMap[u"SignatureCertificate"_ustr] <<= rCertificateOrName.m_aName;
+ }
+ xShapeProps->setPropertyValue("InteropGrabBag", uno::Any(aMap.getAsConstPropertyValueList()));
// Read svg and replace placeholder texts.
OUString aSvgImage(
svx::SignatureLineHelper::getSignatureImage(u"signature-line-draw.svg"_ustr));
aSvgImage = aSvgImage.replaceAll("[SIGNED_BY]", SvxResId(RID_SVXSTR_SIGNATURELINE_DSIGNED_BY));
- OUString aSignerName = svx::SignatureLineHelper::getSignerName(xCertificate);
+ OUString aSignerName = svx::SignatureLineHelper::getSignerName(rCertificateOrName);
aSvgImage = aSvgImage.replaceAll("[SIGNER_NAME]", aSignerName);
OUString aDate = svx::SignatureLineHelper::getLocalizedDate();
aDate = SvxResId(RID_SVXSTR_SIGNATURELINE_DATE).replaceFirst("%1", aDate);
diff --git a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
index b910f55820f0..9964ec88dfb2 100644
--- a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
+++ b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx
@@ -103,7 +103,9 @@ CPPUNIT_TEST_FIXTURE(VclFilterIpdfTest, testPDFAddVisibleSignatureLastPage)
SfxViewShell* pCurrent = SfxViewShell::Current();
CPPUNIT_ASSERT(pCurrent);
SdrView* pView = pCurrent->GetDrawView();
- svx::SignatureLineHelper::setShapeCertificate(pView, xCert);
+ svl::crypto::CertificateOrName aCertificateOrName;
+ aCertificateOrName.m_xCertificate = xCert;
+ svx::SignatureLineHelper::setShapeCertificate(pView, aCertificateOrName);
// the document is modified now, but Sign function can't show SaveAs dialog
// in unit test, so just clear the modified
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index 00a835119642..82a7d2a1ae73 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -774,7 +774,9 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testPDFAddVisibleSignature)
SfxViewShell* pCurrent = SfxViewShell::Current();
CPPUNIT_ASSERT(pCurrent);
SdrView* pView = pCurrent->GetDrawView();
- svx::SignatureLineHelper::setShapeCertificate(pView, xCert);
+ svl::crypto::CertificateOrName aCertificateOrName;
+ aCertificateOrName.m_xCertificate = xCert;
+ svx::SignatureLineHelper::setShapeCertificate(pView, aCertificateOrName);
// the document is modified now, but Sign function can't show SaveAs dialog
// in unit test, so just clear the modified
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index 0cb00f7a049b..fae0bf2a86c4 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -28,6 +28,7 @@
#include <comphelper/xmlsechelper.hxx>
#include <comphelper/lok.hxx>
#include <sfx2/viewsh.hxx>
+#include <svl/cryptosign.hxx>
#include <com/sun/star/security/NoPasswordException.hpp>
#include <com/sun/star/security/CertificateCharacters.hpp>
@@ -227,9 +228,9 @@ void CertificateChooser::ImplInitialize(bool mbSearch)
if (comphelper::LibreOfficeKit::isActive())
{
// The LOK case takes the signing certificate from the view.
- if (m_pViewShell && m_pViewShell->GetSigningCertificate().is())
+ if (m_pViewShell && m_pViewShell->GetSigningCertificate().m_xCertificate.is())
{
- xCerts = { m_pViewShell->GetSigningCertificate() };
+ xCerts = { m_pViewShell->GetSigningCertificate().m_xCertificate };
}
}
else
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 4c865aac9817..d1a9b2af1cb8 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -265,7 +265,7 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
if (comphelper::LibreOfficeKit::isActive())
{
// If the view has a signing certificate, then allow adding a signature.
- if (!pViewShell || !pViewShell->GetSigningCertificate().is())
+ if (!pViewShell || !pViewShell->GetSigningCertificate().m_xCertificate.is())
{
m_xAddBtn->hide();
}