From ca2fd526160b8f69524cdcf8c57f814b0ad48029 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Thu, 22 Mar 2018 11:23:31 +0100 Subject: tdf#83877 Add dialog to sign signature lines actual signing still missing Change-Id: I41f013a2867f923155203dcee58ff453a43fa7c2 Reviewed-on: https://gerrit.libreoffice.org/51735 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- cui/Library_cui.mk | 1 + cui/UIConfig_cui.mk | 1 + cui/inc/strings.hrc | 1 + cui/source/dialogs/SignSignatureLineDialog.cxx | 343 +++++++++++++++++++++ cui/source/factory/cuiexp.cxx | 1 + cui/source/factory/dlgfact.cxx | 14 + cui/source/factory/dlgfact.hxx | 18 ++ cui/source/inc/SignSignatureLineDialog.hxx | 49 +++ cui/uiconfig/ui/signsignatureline.ui | 252 +++++++++++++++ include/svx/svxids.hrc | 3 +- include/vcl/abstdlg.hxx | 16 + .../org/openoffice/Office/UI/GenericCommands.xcu | 8 + svx/sdi/svx.sdi | 17 + sw/sdi/viewsh.sdi | 6 + sw/source/uibase/uiview/viewdlg2.cxx | 14 + sw/source/uibase/uiview/viewstat.cxx | 1 + sw/uiconfig/swriter/popupmenu/draw.xml | 1 + 17 files changed, 745 insertions(+), 1 deletion(-) create mode 100644 cui/source/dialogs/SignSignatureLineDialog.cxx create mode 100644 cui/source/inc/SignSignatureLineDialog.hxx create mode 100644 cui/uiconfig/ui/signsignatureline.ui diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index c6dc353f59b4..afa01ef24a96 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -121,6 +121,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\ cui/source/dialogs/pastedlg \ cui/source/dialogs/postdlg \ cui/source/dialogs/scriptdlg \ + cui/source/dialogs/SignSignatureLineDialog \ cui/source/dialogs/sdrcelldlg \ cui/source/dialogs/showcols \ cui/source/dialogs/SpellAttrib \ diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 234e4d7f3a42..8bf3c3073d06 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -180,6 +180,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/shadowtabpage \ cui/uiconfig/ui/showcoldialog \ cui/uiconfig/ui/similaritysearchdialog \ + cui/uiconfig/ui/signsignatureline \ cui/uiconfig/ui/slantcornertabpage \ cui/uiconfig/ui/smarttagoptionspage \ cui/uiconfig/ui/smoothdialog \ diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc index 330931871a47..5ee718467f54 100644 --- a/cui/inc/strings.hrc +++ b/cui/inc/strings.hrc @@ -382,6 +382,7 @@ #define RID_SVXSTR_SHADOW_STYLE_TOPRIGHT NC_("RID_SVXSTR_SHADOW_STYLE_TOPRIGHT", "Cast Shadow to Top Right") #define RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT NC_("RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT", "Cast Shadow to Bottom Left") #define RID_SVXSTR_SHADOW_STYLE_TOPLEFT NC_("RID_SVXSTR_SHADOW_STYLE_TOPLEFT", "Cast Shadow to Top Left") +#define RID_SVXSTR_SIGNATURELINE_SIGNED_BY NC_("RID_SVXSTR_SIGNATURELINE_SIGNED_BY", "Signed by: %1") #endif diff --git a/cui/source/dialogs/SignSignatureLineDialog.cxx b/cui/source/dialogs/SignSignatureLineDialog.cxx new file mode 100644 index 000000000000..94bb4497e93b --- /dev/null +++ b/cui/source/dialogs/SignSignatureLineDialog.cxx @@ -0,0 +1,343 @@ +/* -*- 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 + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace css; +using namespace css::uno; +using namespace css::beans; +using namespace css::frame; +using namespace css::io; +using namespace css::lang; +using namespace css::frame; +using namespace css::text; +using namespace css::drawing; +using namespace css::graphic; +using namespace css::security; + +SignSignatureLineDialog::SignSignatureLineDialog(weld::Widget* pParent, Reference xModel) + : GenericDialogController(pParent, "cui/ui/signsignatureline.ui", "SignSignatureLineDialog") + , m_xEditName(m_xBuilder->weld_entry("edit_name")) + , m_xEditComment(m_xBuilder->weld_text_view("edit_comment")) + , m_xBtnChooseCertificate(m_xBuilder->weld_button("btn_select_certificate")) + , m_xBtnSign(m_xBuilder->weld_button("ok")) + , m_xModel(xModel) +{ + Reference xIndexAccess(m_xModel->getCurrentSelection(), + UNO_QUERY_THROW); + m_xShapeProperties.set(xIndexAccess->getByIndex(0), UNO_QUERY_THROW); + //m_xShapeProperties = xProps; + + bool bIsSignatureLine; + m_xShapeProperties->getPropertyValue("IsSignatureLine") >>= bIsSignatureLine; + if (!bIsSignatureLine) + { + SAL_WARN("cui.dialogs", "No signature line selected!"); + return; + } + + m_xBtnChooseCertificate->connect_clicked( + LINK(this, SignSignatureLineDialog, chooseCertificate)); + + bool bCanAddComment; + m_xShapeProperties->getPropertyValue("SignatureLineCanAddComment") >>= bCanAddComment; + m_xEditComment->show(bCanAddComment); + if (bCanAddComment) + m_xEditComment->set_size_request(m_xEditComment->get_approximate_digit_width() * 48, + m_xEditComment->get_text_height() * 5); + else + m_xEditComment->set_size_request(0, 0); + + // Read properties from selected signature line + m_xShapeProperties->getPropertyValue("SignatureLineId") >>= m_aSignatureLineId; + m_xShapeProperties->getPropertyValue("SignatureLineSuggestedSignerName") + >>= m_aSuggestedSignerName; + m_xShapeProperties->getPropertyValue("SignatureLineSuggestedSignerTitle") + >>= m_aSuggestedSignerTitle; + m_xShapeProperties->getPropertyValue("SignatureLineShowSignDate") >>= m_bShowSignDate; + + ValidateFields(); +} + +short SignSignatureLineDialog::execute() +{ + short nRet = run(); + if (nRet == RET_OK) + Apply(); + return nRet; +} + +IMPL_LINK_NOARG(SignSignatureLineDialog, chooseCertificate, weld::Button&, void) +{ + Reference xSigner(DocumentDigitalSignatures::createWithVersion( + comphelper::getProcessComponentContext(), "1.2")); + OUString aDescription; + Reference xSignCertificate = xSigner->chooseSigningCertificate(aDescription); + + if (xSignCertificate.is()) + { + m_xSelectedCertifate = xSignCertificate; + m_xBtnChooseCertificate->set_label(xSignCertificate->getIssuerName()); + } + ValidateFields(); +} + +void SignSignatureLineDialog::ValidateFields() +{ + bool bEnable = m_xSelectedCertifate.is() && !m_xEditName->get_text().isEmpty(); + m_xBtnSign->set_sensitive(bEnable); +} + +void SignSignatureLineDialog::Apply() +{ + // Read svg and replace placeholder texts + OUString aSvgImage(getSignatureImage()); + aSvgImage = aSvgImage.replaceAll("[SIGNER_NAME]", getCDataString(m_aSuggestedSignerName)); + aSvgImage = aSvgImage.replaceAll("[SIGNER_TITLE]", getCDataString(m_aSuggestedSignerTitle)); + + aSvgImage = aSvgImage.replaceAll("[SIGNATURE]", getCDataString(m_xEditName->get_text())); + OUString aIssuerLine = CuiResId(RID_SVXSTR_SIGNATURELINE_SIGNED_BY) + .replaceFirst("%1", m_xSelectedCertifate->getIssuerName()); + aSvgImage = aSvgImage.replaceAll("[SIGNED_BY]", getCDataString(aIssuerLine)); + aSvgImage = aSvgImage.replaceAll("[INVALID_SIGNATURE]", ""); + + OUString aDate; + if (m_bShowSignDate) + { + const SvtSysLocale aSysLocale; + const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData(); + Date aDateTime(Date::SYSTEM); + aDate = rLocaleData.getDate(aDateTime); + } + aSvgImage = aSvgImage.replaceAll("[DATE]", aDate); + + // Insert/Update graphic + SvMemoryStream aSvgStream(4096, 4096); + aSvgStream.WriteOString(OUStringToOString(aSvgImage, RTL_TEXTENCODING_UTF8)); + Reference xInputStream(new utl::OSeekableInputStreamWrapper(aSvgStream)); + Reference xContext(comphelper::getProcessComponentContext()); + Reference xProvider = css::graphic::GraphicProvider::create(xContext); + + Sequence aMediaProperties(1); + aMediaProperties[0].Name = "InputStream"; + aMediaProperties[0].Value <<= xInputStream; + Reference xGraphic(xProvider->queryGraphic(aMediaProperties)); + + m_xShapeProperties->setPropertyValue("Graphic", Any(xGraphic)); +} + +OUString SignSignatureLineDialog::getCDataString(const OUString& rString) +{ + return ""; +} + +OUString SignSignatureLineDialog::getSignatureImage() +{ + OUString const svg( + "image/svg+xml150139132512: " + "XPATHSTROKE_SEQ_BEGIN132133109512: XPATHSTROKE_SEQ_END140150139133132111140150512: " + "XTEXT_PAINTSHAPE_BEGIN138136135134113type: Text; content: " + "[SIGNATURE]; [SIGNATURE]512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOW512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOW512: XTEXT_EOL512: XTEXT_EOP512: XTEXT_PAINTSHAPE_END150512: " + "XTEXT_PAINTSHAPE_BEGIN138136135134113type: Text; content: " + "[SIGNER_NAME]; [SIGNER_NAME]512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOW512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOW512: XTEXT_EOL512: XTEXT_EOP512: XTEXT_PAINTSHAPE_END150512: " + "XTEXT_PAINTSHAPE_BEGIN138136135134113type: Text; content: " + "[SIGNER_TITLE]; [SIGNER_TITLE]512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOW512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOW512: XTEXT_EOL512: XTEXT_EOP512: " + "XTEXT_PAINTSHAPE_END150512: " + "XTEXT_PAINTSHAPE_BEGIN138136135134113type: Text; content: " + "[SIGNED_BY]; [SIGNED_BY]512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOW512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOW512: XTEXT_EOL512: XTEXT_EOP512: XTEXT_PAINTSHAPE_END150512: " + "XTEXT_PAINTSHAPE_BEGIN138136135134113type: Text; content: " + "[DATE]; [DATE]512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOW512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOC512: XTEXT_EOW512: XTEXT_EOL512: XTEXT_EOP512: XTEXT_PAINTSHAPE_END150512: " + "XTEXT_PAINTSHAPE_BEGIN138136135134113type: Text; content: " + "[INVALID_SIGNATURE]; [INVALID_SIGNATURE]512: " + "XTEXT_EOC512: XTEXT_EOC512: " + "XTEXT_EOW512: XTEXT_EOC512: " + "XTEXT_EOC512: XTEXT_EOC512: " + "XTEXT_EOC512: XTEXT_EOC512: " + "XTEXT_EOC512: XTEXT_EOC512: " + "XTEXT_EOC512: XTEXT_EOC512: " + "XTEXT_EOC512: XTEXT_EOC512: " + "XTEXT_EOC512: XTEXT_EOC512: " + "XTEXT_EOC512: XTEXT_EOC512: " + "XTEXT_EOC512: XTEXT_EOC512: " + "XTEXT_EOW512: XTEXT_EOL512: " + "XTEXT_EOP512: " + "XTEXT_PAINTSHAPE_END"); + return svg; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/factory/cuiexp.cxx b/cui/source/factory/cuiexp.cxx index 9a8a26bcbd03..104293936dec 100644 --- a/cui/source/factory/cuiexp.cxx +++ b/cui/source/factory/cuiexp.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 2002a4339183..5157aae3b303 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -191,6 +192,11 @@ void AbstractSvxCharacterMapDialog_Impl::SetText(const OUString& rStr) m_xDlg->set_title(rStr); } +short AbstractSignSignatureLineDialog_Impl::Execute() +{ + return m_xDlg->execute(); +} + IMPL_ABSTDLG_BASE(AbstractScreenshotAnnotationDlg_Impl); @@ -1569,4 +1575,12 @@ VclPtr AbstractDialogFactory_Impl::CreateScreen return VclPtr::Create(pDlg); } +VclPtr +AbstractDialogFactory_Impl::CreateSignSignatureLineDialog(weld::Window* pParent, + const Reference xModel) +{ + return VclPtr::Create( + new SignSignatureLineDialog(pParent, xModel)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 731b37a27530..a5f26ee47a48 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -533,6 +533,20 @@ class AbstractScreenshotAnnotationDlg_Impl : public AbstractScreenshotAnnotation DECL_ABSTDLG_BASE(AbstractScreenshotAnnotationDlg_Impl, ScreenshotAnnotationDlg) }; +class SignSignatureLineDialog; +class AbstractSignSignatureLineDialog_Impl : public AbstractSignSignatureLineDialog +{ +protected: + std::unique_ptr m_xDlg; + +public: + explicit AbstractSignSignatureLineDialog_Impl(SignSignatureLineDialog* p) + : m_xDlg(p) + { + } + virtual short Execute() override; +}; + //AbstractDialogFactory_Impl implementations class AbstractDialogFactory_Impl : public SvxAbstractDialogFactory { @@ -711,6 +725,10 @@ public: virtual VclPtr CreatePasswordToOpenModifyDialog(weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override; virtual VclPtr CreateScreenshotAnnotationDlg(vcl::Window * pParent, Dialog& rParentDialog) override; + + virtual VclPtr + CreateSignSignatureLineDialog(weld::Window* pParent, + const css::uno::Reference xModel) override; }; #endif diff --git a/cui/source/inc/SignSignatureLineDialog.hxx b/cui/source/inc/SignSignatureLineDialog.hxx new file mode 100644 index 000000000000..70ff87200793 --- /dev/null +++ b/cui/source/inc/SignSignatureLineDialog.hxx @@ -0,0 +1,49 @@ +/* -*- 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/. + */ +#ifndef INCLUDED_CUI_INC_SIGNSIGNATURELINEDIALOG_HXX +#define INCLUDED_CUI_INC_SIGNSIGNATURELINEDIALOG_HXX + +#include + +#include +#include +#include + +class SignSignatureLineDialog : public weld::GenericDialogController +{ +public: + SignSignatureLineDialog(weld::Widget* pParent, css::uno::Reference xModel); + + short execute(); + +private: + std::unique_ptr m_xEditName; + std::unique_ptr m_xEditComment; + std::unique_ptr m_xBtnChooseCertificate; + std::unique_ptr m_xBtnSign; + + css::uno::Reference m_xModel; + css::uno::Reference m_xShapeProperties; + css::uno::Reference m_xSelectedCertifate; + OUString m_aSignatureLineId; + OUString m_aSuggestedSignerName; + OUString m_aSuggestedSignerTitle; + bool m_bShowSignDate; + + void ValidateFields(); + void Apply(); + OUString getCDataString(const OUString& rString); + OUString getSignatureImage(); + + DECL_LINK(chooseCertificate, weld::Button&, void); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/uiconfig/ui/signsignatureline.ui b/cui/uiconfig/ui/signsignatureline.ui new file mode 100644 index 000000000000..860da621d4f4 --- /dev/null +++ b/cui/uiconfig/ui/signsignatureline.ui @@ -0,0 +1,252 @@ + + + + + + False + 6 + Sign Signature Line + True + 0 + 0 + dialog + + + False + vertical + 2 + + + False + end + + + gtk-cancel + True + True + True + True + + + True + True + 0 + + + + + Sign + True + True + True + True + True + + + True + True + 1 + + + + + False + False + 1 + + + + + True + False + 6 + 6 + 6 + 6 + True + True + 6 + 6 + + + True + False + True + 0 + none + + + True + False + 6 + 12 + + + True + False + 6 + 12 + + + True + True + True + True + Type your name here + + + 1 + 0 + + + + + True + False + start + Your Name: + True + edit_name + + + 0 + 0 + + + + + True + False + start + Certificate: + True + edit_name + + + 0 + 1 + + + + + Select Certificate + True + True + True + + + 1 + 1 + + + + + + + + + True + False + Sign + + + + + + + + 0 + 0 + + + + + True + False + True + True + 0 + none + + + True + False + 6 + 12 + + + True + False + 6 + 12 + + + True + False + start + Add comment: + True + edit_comment + + + 0 + 0 + + + + + True + True + True + True + in + + + 60 + True + True + True + True + + + + + 0 + 1 + + + + + + + + + True + False + More + + + + + + + + 0 + 1 + + + + + False + True + 0 + + + + + + cancel + ok + + + diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index bd3e28f3b1b4..6c5ae5c13117 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -966,10 +966,11 @@ class SfxStringItem; #define SID_INSERT_SIGNATURELINE ( SID_SVX_START + 1173 ) #define SID_EDIT_SIGNATURELINE ( SID_SVX_START + 1174 ) +#define SID_SIGN_SIGNATURELINE ( SID_SVX_START + 1175 ) // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE ( SID_EDIT_SIGNATURELINE + 1 ) +#define SID_SVX_FIRSTFREE ( SID_SIGN_SIGNATURELINE + 1 ) // Overflow check for slot IDs #if SID_SVX_FIRSTFREE > SID_SVX_END diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx index 29eeaaf71147..9ae88a3bdebd 100644 --- a/include/vcl/abstdlg.hxx +++ b/include/vcl/abstdlg.hxx @@ -19,6 +19,7 @@ #ifndef INCLUDED_VCL_ABSTDLG_HXX #define INCLUDED_VCL_ABSTDLG_HXX +#include #include #include #include @@ -28,6 +29,9 @@ #include #include +#include +#include + namespace vcl { class Window; } class Dialog; class Bitmap; @@ -115,6 +119,12 @@ protected: virtual ~AbstractScreenshotAnnotationDlg() override = default; }; +class VCL_DLLPUBLIC AbstractSignSignatureLineDialog : public VclAbstractDialog +{ +protected: + virtual ~AbstractSignSignatureLineDialog() override = default; +}; + class VCL_DLLPUBLIC VclAbstractDialogFactory { public: @@ -126,6 +136,12 @@ public: // creates instance of PasswordToOpenModifyDialog from cui virtual VclPtr CreatePasswordToOpenModifyDialog(weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) = 0; + // creates instance of SignSignatureDialog from cui + virtual VclPtr + CreateSignSignatureLineDialog(weld::Window* pParent, + const css::uno::Reference xModel) + = 0; + // creates instance of ScreenshotAnnotationDlg from cui virtual VclPtr CreateScreenshotAnnotationDlg( vcl::Window* pParent, diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index bbc47f8387fa..84bb3a2fb6d0 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -6553,6 +6553,14 @@ 1 + + + ~Sign Signature Line... + + + 1 + + diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 02b7f4c9d3fe..b42f0c2e7c11 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -11978,3 +11978,20 @@ SfxVoidItem EditSignatureLine SID_EDIT_SIGNATURELINE ToolBoxConfig = TRUE, GroupId = SfxGroupId::Edit; ] + +SfxVoidItem SignSignatureLine SID_SIGN_SIGNATURELINE +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = SfxGroupId::Edit; +] diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi index f0c2a5b2ce3a..9980f21153cd 100644 --- a/sw/sdi/viewsh.sdi +++ b/sw/sdi/viewsh.sdi @@ -48,6 +48,12 @@ interface TextEditView : BaseTextEditView StateMethod = GetState ; DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; ] + SID_SIGN_SIGNATURELINE // status() + [ + ExecMethod = ExecDlgExt ; + StateMethod = GetState ; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] FN_EDIT_FOOTNOTE // status(final|play) [ ExecMethod = ExecDlgExt ; diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx index 554555c5b0fb..f0766d4f0f58 100644 --- a/sw/source/uibase/uiview/viewdlg2.cxx +++ b/sw/source/uibase/uiview/viewdlg2.cxx @@ -79,6 +79,20 @@ void SwView::ExecDlgExt(SfxRequest const &rReq) pDialog->Execute(); break; } + case SID_SIGN_SIGNATURELINE: + { + VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create(); + assert(pFact && "VclAbstractDialogFactory fail!"); + + const uno::Reference xModel(GetCurrentDocument()); + VclPtr pDialog + = pFact->CreateSignSignatureLineDialog(GetFrameWeld(), xModel); + assert(pDialog && "Dialog creation failed!"); + + if (pDialog) + pDialog->Execute(); + break; + } case FN_EDIT_FOOTNOTE: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index d194793aa089..6a7723cc33e4 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -104,6 +104,7 @@ void SwView::GetState(SfxItemSet &rSet) } break; case SID_EDIT_SIGNATURELINE: + case SID_SIGN_SIGNATURELINE: if (!isSignatureLineSelected()) rSet.DisableItem(nWhich); break; diff --git a/sw/uiconfig/swriter/popupmenu/draw.xml b/sw/uiconfig/swriter/popupmenu/draw.xml index f9920588aa03..ae0337da30ec 100644 --- a/sw/uiconfig/swriter/popupmenu/draw.xml +++ b/sw/uiconfig/swriter/popupmenu/draw.xml @@ -69,4 +69,5 @@ + -- cgit v1.2.3