diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-06-09 18:03:22 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-06-09 23:44:55 +0200 |
commit | f1566f0b813e439531a37154b52d491fd9d3224b (patch) | |
tree | 5da4b80c0928164d9ee595e3d04e8698e9318c0d /svx | |
parent | dbf3eba5514f0ed48683e2b58ac56c96b6d48792 (diff) |
sd signature line: select certificate after drawing the shape's rectangle
Also move the shape-type-specific setup to
FuConstructRectangle::SetAttributes() where the rest of the shape types
are handled.
Change-Id: I9ecf94957ec82ba187f2767b01d96fb14de2b657
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95958
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/signaturelinehelper.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/svx/source/dialog/signaturelinehelper.cxx b/svx/source/dialog/signaturelinehelper.cxx index 69010ec09b10..11ef1face66a 100644 --- a/svx/source/dialog/signaturelinehelper.cxx +++ b/svx/source/dialog/signaturelinehelper.cxx @@ -14,6 +14,7 @@ #include <com/sun/star/security/XCertificate.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/sequenceashashmap.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/xmlsechelper.hxx> #include <config_folders.h> @@ -22,6 +23,8 @@ #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> #include <sfx2/objsh.hxx> +#include <svx/svdmark.hxx> +#include <svx/svdview.hxx> #include <tools/stream.hxx> #include <unotools/localedatawrapper.hxx> #include <unotools/streamwrap.hxx> @@ -119,6 +122,30 @@ uno::Reference<graphic::XGraphic> importSVG(const OUString& rSVG) uno::Reference<graphic::XGraphic> xGraphic(xProvider->queryGraphic(aMediaProperties)); return xGraphic; } + +void setShapeCertificate(SdrView* pView, + const css::uno::Reference<css::security::XCertificate>& xCertificate) +{ + const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); + if (rMarkList.GetMarkCount() < 1) + { + return; + } + + const SdrMark* pMark = rMarkList.GetMark(0); + SdrObject* pSignatureLine = pMark->GetMarkedSdrObj(); + if (!pSignatureLine) + { + return; + } + + // Remember the selected certificate. + uno::Reference<beans::XPropertySet> xShapeProps(pSignatureLine->getUnoShape(), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aMap(xShapeProps->getPropertyValue("InteropGrabBag")); + aMap["SignatureCertificate"] <<= xCertificate; + xShapeProps->setPropertyValue("InteropGrabBag", + uno::makeAny(aMap.getAsConstPropertyValueList())); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |