summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-06-09 18:03:22 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-06-09 23:44:55 +0200
commitf1566f0b813e439531a37154b52d491fd9d3224b (patch)
tree5da4b80c0928164d9ee595e3d04e8698e9318c0d /sd
parentdbf3eba5514f0ed48683e2b58ac56c96b6d48792 (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 'sd')
-rw-r--r--sd/source/ui/func/fuconrec.cxx50
1 files changed, 28 insertions, 22 deletions
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index 63daa06171c4..91ed61ad3d63 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -59,6 +59,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <svx/xfillit0.hxx>
+#include <svx/signaturelinehelper.hxx>
#include <sdresid.hxx>
#include <View.hxx>
@@ -430,28 +431,6 @@ void FuConstructRectangle::Activate()
void FuConstructRectangle::Deactivate()
{
- if (nSlotId == SID_INSERT_SIGNATURELINE)
- {
- const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
- if (rMarkList.GetMarkCount() > 0)
- {
- // Avoid the default solid fill and line, we'll set a graphic instead.
- const SdrMark* pMark = rMarkList.GetMark(0);
- SdrObject* pObject = pMark->GetMarkedSdrObj();
- SfxItemSet aSet = pObject->GetMergedItemSet();
-
- XFillStyleItem aFillStyleItem(aSet.Get(XATTR_FILLSTYLE));
- aFillStyleItem.SetValue(drawing::FillStyle_NONE);
- aSet.Put(aFillStyleItem);
-
- XLineStyleItem aLineStyleItem(aSet.Get(XATTR_LINESTYLE));
- aLineStyleItem.SetValue(drawing::LineStyle_NONE);
- aSet.Put(aLineStyleItem);
-
- pObject->SetMergedItemSet(aSet);
- }
- }
-
if( nSlotId == SID_TOOL_CONNECTOR ||
nSlotId == SID_CONNECTOR_ARROW_START ||
nSlotId == SID_CONNECTOR_ARROW_END ||
@@ -491,6 +470,27 @@ void FuConstructRectangle::Deactivate()
mpView->SetGlueVisible( false );
}
FuConstruct::Deactivate();
+
+ if (nSlotId != SID_INSERT_SIGNATURELINE)
+ {
+ return;
+ }
+
+ // Finished drawing a signature rectangle, now set it up.
+ if (!mpViewShell)
+ {
+ return;
+ }
+
+ uno::Reference<security::XCertificate> xCertificate
+ = svx::SignatureLineHelper::getSignatureCertificate(mpViewShell->GetObjectShell(),
+ mpViewShell->GetFrameWeld());
+ if (!xCertificate.is())
+ {
+ return;
+ }
+
+ svx::SignatureLineHelper::setShapeCertificate(mpView, xCertificate);
}
namespace {
@@ -621,6 +621,12 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
break;
}
}
+ else if (nSlotId == SID_INSERT_SIGNATURELINE)
+ {
+ // Avoid the default solid fill and line, we'll set a graphic instead.
+ rAttr.Put(XFillStyleItem(drawing::FillStyle_NONE));
+ rAttr.Put(XLineStyleItem(drawing::LineStyle_NONE));
+ }
}
/**