diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-03-22 11:23:31 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-04-13 08:08:15 +0200 |
commit | ca2fd526160b8f69524cdcf8c57f814b0ad48029 (patch) | |
tree | 6ddfd0ff48f3a3ec57ad93c994c44c171ec4cc2f | |
parent | 55e84652ae84bd2374462ee19afd359a8cc90b95 (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | cui/Library_cui.mk | 1 | ||||
-rw-r--r-- | cui/UIConfig_cui.mk | 1 | ||||
-rw-r--r-- | cui/inc/strings.hrc | 1 | ||||
-rw-r--r-- | cui/source/dialogs/SignSignatureLineDialog.cxx | 343 | ||||
-rw-r--r-- | cui/source/factory/cuiexp.cxx | 1 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 14 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 18 | ||||
-rw-r--r-- | cui/source/inc/SignSignatureLineDialog.hxx | 49 | ||||
-rw-r--r-- | cui/uiconfig/ui/signsignatureline.ui | 252 | ||||
-rw-r--r-- | include/svx/svxids.hrc | 3 | ||||
-rw-r--r-- | include/vcl/abstdlg.hxx | 16 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 8 | ||||
-rw-r--r-- | svx/sdi/svx.sdi | 17 | ||||
-rw-r--r-- | sw/sdi/viewsh.sdi | 6 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdlg2.cxx | 14 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 1 | ||||
-rw-r--r-- | sw/uiconfig/swriter/popupmenu/draw.xml | 1 |
17 files changed, 745 insertions, 1 deletions
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 <SignSignatureLineDialog.hxx> + +#include <sal/types.h> + +#include <dialmgr.hxx> +#include <strings.hrc> + +#include <comphelper/processfactory.hxx> +#include <comphelper/xmltools.hxx> +#include <tools/stream.hxx> +#include <unotools/streamwrap.hxx> +#include <vcl/weld.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/drawing/XShape.hpp> +#include <com/sun/star/graphic/GraphicProvider.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/graphic/XGraphicProvider.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/security/DocumentDigitalSignatures.hpp> +#include <com/sun/star/security/XCertificate.hpp> +#include <com/sun/star/security/XDocumentDigitalSignatures.hpp> +#include <com/sun/star/text/TextContentAnchorType.hpp> +#include <com/sun/star/text/XTextContent.hpp> +#include <com/sun/star/text/XTextDocument.hpp> + +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> 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<container::XIndexAccess> 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<XDocumentDigitalSignatures> xSigner(DocumentDigitalSignatures::createWithVersion( + comphelper::getProcessComponentContext(), "1.2")); + OUString aDescription; + Reference<XCertificate> 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> xInputStream(new utl::OSeekableInputStreamWrapper(aSvgStream)); + Reference<XComponentContext> xContext(comphelper::getProcessComponentContext()); + Reference<XGraphicProvider> xProvider = css::graphic::GraphicProvider::create(xContext); + + Sequence<PropertyValue> aMediaProperties(1); + aMediaProperties[0].Name = "InputStream"; + aMediaProperties[0].Value <<= xInputStream; + Reference<XGraphic> xGraphic(xProvider->queryGraphic(aMediaProperties)); + + m_xShapeProperties->setPropertyValue("Graphic", Any(xGraphic)); +} + +OUString SignSignatureLineDialog::getCDataString(const OUString& rString) +{ + return "<![CDATA[" + rString + "]]>"; +} + +OUString SignSignatureLineDialog::getSignatureImage() +{ + OUString const svg( + "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><svg " + "xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" " + "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" " + "xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns=\"http://www.w3.org/2000/svg\" " + "xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" " + "xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" version=\"1.2\" " + "width=\"90mm\" height=\"45mm\" viewBox=\"0 0 9000 4500\" preserveAspectRatio=\"xMidYMid\" " + "fill-rule=\"evenodd\" stroke-width=\"28.222\" stroke-linejoin=\"round\" " + "xml:space=\"preserve\" id=\"svg577\" inkscape:version=\"0.92.2 (5c3e80d, " + "2017-08-06)\"><metadata id=\"metadata581\"><rdf:RDF><cc:Work " + "rdf:about=\"\"><dc:format>image/svg+xml</dc:format><dc:type " + "rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/><dc:title/></cc:Work></rdf:RDF></" + "metadata><sodipodi:namedview pagecolor=\"#ffffff\" bordercolor=\"#666666\" " + "borderopacity=\"1\" objecttolerance=\"10\" gridtolerance=\"10\" guidetolerance=\"10\" " + "inkscape:pageopacity=\"0\" inkscape:pageshadow=\"2\" inkscape:window-width=\"1863\" " + "inkscape:window-height=\"1056\" id=\"namedview579\" showgrid=\"false\" " + "inkscape:zoom=\"0.90252315\" inkscape:cx=\"170.07874\" inkscape:cy=\"85.03937\" " + "inkscape:window-x=\"57\" inkscape:window-y=\"24\" inkscape:window-maximized=\"1\" " + "inkscape:current-layer=\"svg577\" inkscape:pagecheckerboard=\"false\"/><defs " + "class=\"ClipPathGroup\" id=\"defs8\"><clipPath id=\"presentation_clip_path\" " + "clipPathUnits=\"userSpaceOnUse\"><rect x=\"0\" y=\"0\" width=\"9000\" height=\"4500\" " + "id=\"rect2\"/></clipPath></defs><defs id=\"defs49\"/><defs id=\"defs86\"/><defs " + "class=\"TextShapeIndex\" id=\"defs90\"/><defs class=\"EmbeddedBulletChars\" " + "id=\"defs122\"/><defs class=\"TextEmbeddedBitmaps\" id=\"defs124\"/><g id=\"g129\"><g " + "id=\"id2\" class=\"Master_Slide\"><g id=\"bg-id2\" class=\"Background\"/><g id=\"bo-id2\" " + "class=\"BackgroundObjects\"/></g></g><g class=\"SlideGroup\" id=\"g575\"><g " + "id=\"g573\"><g id=\"container-id1\"><g id=\"id1\" class=\"Slide\" " + "clip-path=\"url(#presentation_clip_path)\"><g class=\"Page\" id=\"g569\"><g " + "class=\"com.sun.star.drawing.LineShape\" id=\"g154\"><g id=\"id3\"><rect " + "class=\"BoundingBox\" stroke=\"none\" fill=\"none\" x=\"-27\" y=\"2373\" width=\"9055\" " + "height=\"55\" id=\"rect131\"/><desc id=\"desc133\">150</desc><desc " + "id=\"desc135\">139</desc><desc id=\"desc137\">132</desc><desc id=\"desc139\">512: " + "XPATHSTROKE_SEQ_BEGIN</desc><desc id=\"desc141\">132</desc><desc " + "id=\"desc143\">133</desc><desc id=\"desc145\">109</desc><path fill=\"none\" " + "stroke=\"rgb(0,0,0)\" stroke-width=\"53\" stroke-linejoin=\"round\" d=\"M 0,2400 L " + "9000,2400\" id=\"path147\"/><desc id=\"desc149\">512: XPATHSTROKE_SEQ_END</desc><desc " + "id=\"desc151\">140</desc></g></g><g class=\"com.sun.star.drawing.ClosedBezierShape\" " + "id=\"g173\"><g id=\"id4\"><rect class=\"BoundingBox\" stroke=\"none\" fill=\"none\" " + "x=\"301\" y=\"1400\" width=\"801\" height=\"801\" id=\"rect156\"/><desc " + "id=\"desc158\">150</desc><desc id=\"desc160\">139</desc><desc " + "id=\"desc162\">133</desc><desc id=\"desc164\">132</desc><desc " + "id=\"desc166\">111</desc><path fill=\"rgb(0,0,0)\" stroke=\"none\" d=\"M 969,2200 C " + "880,2083 792,1967 704,1850 614,1967 523,2083 433,2200 389,2200 345,2200 301,2200 413,2061 " + "525,1923 637,1784 533,1656 430,1528 327,1400 371,1400 415,1400 459,1400 541,1505 623,1609 " + "704,1714 784,1609 863,1505 943,1400 987,1400 1031,1400 1075,1400 975,1527 874,1653 " + "773,1780 882,1920 992,2060 1101,2200 1057,2200 1013,2200 969,2200 Z\" " + "id=\"path168\"/><desc id=\"desc170\">140</desc></g></g><g " + "class=\"com.sun.star.drawing.TextShape\" id=\"g236\"><g id=\"id5\"><rect " + "class=\"BoundingBox\" stroke=\"none\" fill=\"none\" x=\"1300\" y=\"1500\" width=\"8001\" " + "height=\"925\" id=\"rect175\"/><desc id=\"desc177\">150</desc><desc id=\"desc179\">512: " + "XTEXT_PAINTSHAPE_BEGIN</desc><text class=\"TextShape\" id=\"text233\"><desc " + "class=\"Paragraph\" id=\"desc181\"/><tspan class=\"TextParagraph\" " + "font-family=\"Liberation Sans, sans-serif\" font-size=\"600px\" font-weight=\"400\" " + "id=\"tspan231\"><desc id=\"desc183\">138</desc><desc id=\"desc185\">136</desc><desc " + "id=\"desc187\">135</desc><desc id=\"desc189\">134</desc><desc " + "id=\"desc191\">113</desc><desc class=\"TextPortion\" id=\"desc193\">type: Text; content: " + "[SIGNATURE]; </desc><tspan class=\"TextPosition\" x=\"1550\" y=\"2171\" " + "id=\"tspan229\"><tspan fill=\"rgb(0,0,0)\" stroke=\"none\" " + "id=\"tspan195\">[SIGNATURE]</tspan><desc id=\"desc197\">512: XTEXT_EOC</desc><desc " + "id=\"desc199\">512: XTEXT_EOC</desc><desc id=\"desc201\">512: XTEXT_EOW</desc><desc " + "id=\"desc203\">512: XTEXT_EOC</desc><desc id=\"desc205\">512: XTEXT_EOC</desc><desc " + "id=\"desc207\">512: XTEXT_EOC</desc><desc id=\"desc209\">512: XTEXT_EOC</desc><desc " + "id=\"desc211\">512: XTEXT_EOC</desc><desc id=\"desc213\">512: XTEXT_EOC</desc><desc " + "id=\"desc215\">512: XTEXT_EOC</desc><desc id=\"desc217\">512: XTEXT_EOC</desc><desc " + "id=\"desc219\">512: XTEXT_EOC</desc><desc id=\"desc221\">512: XTEXT_EOW</desc><desc " + "id=\"desc223\">512: XTEXT_EOL</desc><desc id=\"desc225\">512: XTEXT_EOP</desc><desc " + "id=\"desc227\">512: XTEXT_PAINTSHAPE_END</desc></tspan></tspan></text></g></g><g " + "class=\"com.sun.star.drawing.TextShape\" id=\"g303\"><g id=\"id6\"><rect " + "class=\"BoundingBox\" stroke=\"none\" fill=\"none\" x=\"100\" y=\"2500\" width=\"8901\" " + "height=\"726\" id=\"rect238\"/><desc id=\"desc240\">150</desc><desc id=\"desc242\">512: " + "XTEXT_PAINTSHAPE_BEGIN</desc><text class=\"TextShape\" id=\"text300\"><desc " + "class=\"Paragraph\" id=\"desc244\"/><tspan class=\"TextParagraph\" " + "font-family=\"Liberation Sans, sans-serif\" font-size=\"423px\" font-weight=\"400\" " + "id=\"tspan298\"><desc id=\"desc246\">138</desc><desc id=\"desc248\">136</desc><desc " + "id=\"desc250\">135</desc><desc id=\"desc252\">134</desc><desc " + "id=\"desc254\">113</desc><desc class=\"TextPortion\" id=\"desc256\">type: Text; content: " + "[SIGNER_NAME]; </desc><tspan class=\"TextPosition\" x=\"350\" y=\"3010\" " + "id=\"tspan296\"><tspan fill=\"rgb(0,0,0)\" stroke=\"none\" " + "id=\"tspan258\">[SIGNER_NAME]</tspan><desc id=\"desc260\">512: XTEXT_EOC</desc><desc " + "id=\"desc262\">512: XTEXT_EOC</desc><desc id=\"desc264\">512: XTEXT_EOW</desc><desc " + "id=\"desc266\">512: XTEXT_EOC</desc><desc id=\"desc268\">512: XTEXT_EOC</desc><desc " + "id=\"desc270\">512: XTEXT_EOC</desc><desc id=\"desc272\">512: XTEXT_EOC</desc><desc " + "id=\"desc274\">512: XTEXT_EOC</desc><desc id=\"desc276\">512: XTEXT_EOC</desc><desc " + "id=\"desc278\">512: XTEXT_EOC</desc><desc id=\"desc280\">512: XTEXT_EOC</desc><desc " + "id=\"desc282\">512: XTEXT_EOC</desc><desc id=\"desc284\">512: XTEXT_EOC</desc><desc " + "id=\"desc286\">512: XTEXT_EOC</desc><desc id=\"desc288\">512: XTEXT_EOW</desc><desc " + "id=\"desc290\">512: XTEXT_EOL</desc><desc id=\"desc292\">512: XTEXT_EOP</desc><desc " + "id=\"desc294\">512: XTEXT_PAINTSHAPE_END</desc></tspan></tspan></text></g></g><g " + "class=\"com.sun.star.drawing.TextShape\" id=\"g372\"><g id=\"id7\"><rect " + "class=\"BoundingBox\" stroke=\"none\" fill=\"none\" x=\"100\" y=\"3075\" width=\"8901\" " + "height=\"726\" id=\"rect305\"/><desc id=\"desc307\">150</desc><desc id=\"desc309\">512: " + "XTEXT_PAINTSHAPE_BEGIN</desc><text class=\"TextShape\" id=\"text369\"><desc " + "class=\"Paragraph\" id=\"desc311\"/><tspan class=\"TextParagraph\" " + "font-family=\"Liberation Sans, sans-serif\" font-size=\"423px\" font-weight=\"400\" " + "id=\"tspan367\"><desc id=\"desc313\">138</desc><desc id=\"desc315\">136</desc><desc " + "id=\"desc317\">135</desc><desc id=\"desc319\">134</desc><desc " + "id=\"desc321\">113</desc><desc class=\"TextPortion\" id=\"desc323\">type: Text; content: " + "[SIGNER_TITLE]; </desc><tspan class=\"TextPosition\" x=\"350\" y=\"3585\" " + "id=\"tspan365\"><tspan fill=\"rgb(0,0,0)\" stroke=\"none\" " + "id=\"tspan325\">[SIGNER_TITLE]</tspan><desc id=\"desc327\">512: XTEXT_EOC</desc><desc " + "id=\"desc329\">512: XTEXT_EOC</desc><desc id=\"desc331\">512: XTEXT_EOW</desc><desc " + "id=\"desc333\">512: XTEXT_EOC</desc><desc id=\"desc335\">512: XTEXT_EOC</desc><desc " + "id=\"desc337\">512: XTEXT_EOC</desc><desc id=\"desc339\">512: XTEXT_EOC</desc><desc " + "id=\"desc341\">512: XTEXT_EOC</desc><desc id=\"desc343\">512: XTEXT_EOC</desc><desc " + "id=\"desc345\">512: XTEXT_EOC</desc><desc id=\"desc347\">512: XTEXT_EOC</desc><desc " + "id=\"desc349\">512: XTEXT_EOC</desc><desc id=\"desc351\">512: XTEXT_EOC</desc><desc " + "id=\"desc353\">512: XTEXT_EOC</desc><desc id=\"desc355\">512: XTEXT_EOC</desc><desc " + "id=\"desc357\">512: XTEXT_EOW</desc><desc id=\"desc359\">512: XTEXT_EOL</desc><desc " + "id=\"desc361\">512: XTEXT_EOP</desc><desc id=\"desc363\">512: " + "XTEXT_PAINTSHAPE_END</desc></tspan></tspan></text></g></g><g " + "class=\"com.sun.star.drawing.TextShape\" id=\"g435\"><g id=\"id8\"><rect " + "class=\"BoundingBox\" stroke=\"none\" fill=\"none\" x=\"100\" y=\"3660\" width=\"8901\" " + "height=\"726\" id=\"rect374\"/><desc id=\"desc376\">150</desc><desc id=\"desc378\">512: " + "XTEXT_PAINTSHAPE_BEGIN</desc><text class=\"TextShape\" id=\"text432\"><desc " + "class=\"Paragraph\" id=\"desc380\"/><tspan class=\"TextParagraph\" " + "font-family=\"Liberation Sans, sans-serif\" font-size=\"423px\" font-weight=\"400\" " + "id=\"tspan430\"><desc id=\"desc382\">138</desc><desc id=\"desc384\">136</desc><desc " + "id=\"desc386\">135</desc><desc id=\"desc388\">134</desc><desc " + "id=\"desc390\">113</desc><desc class=\"TextPortion\" id=\"desc392\">type: Text; content: " + "[SIGNED_BY]; </desc><tspan class=\"TextPosition\" x=\"350\" y=\"4170\" " + "id=\"tspan428\"><tspan fill=\"rgb(0,0,0)\" stroke=\"none\" " + "id=\"tspan394\">[SIGNED_BY]</tspan><desc id=\"desc396\">512: XTEXT_EOC</desc><desc " + "id=\"desc398\">512: XTEXT_EOC</desc><desc id=\"desc400\">512: XTEXT_EOW</desc><desc " + "id=\"desc402\">512: XTEXT_EOC</desc><desc id=\"desc404\">512: XTEXT_EOC</desc><desc " + "id=\"desc406\">512: XTEXT_EOC</desc><desc id=\"desc408\">512: XTEXT_EOC</desc><desc " + "id=\"desc410\">512: XTEXT_EOC</desc><desc id=\"desc412\">512: XTEXT_EOC</desc><desc " + "id=\"desc414\">512: XTEXT_EOC</desc><desc id=\"desc416\">512: XTEXT_EOC</desc><desc " + "id=\"desc418\">512: XTEXT_EOC</desc><desc id=\"desc420\">512: XTEXT_EOW</desc><desc " + "id=\"desc422\">512: XTEXT_EOL</desc><desc id=\"desc424\">512: XTEXT_EOP</desc><desc " + "id=\"desc426\">512: XTEXT_PAINTSHAPE_END</desc></tspan></tspan></text></g></g><g " + "class=\"com.sun.star.drawing.TextShape\" id=\"g488\"><g id=\"id9\"><rect " + "class=\"BoundingBox\" stroke=\"none\" fill=\"none\" x=\"4800\" y=\"0\" width=\"4201\" " + "height=\"726\" id=\"rect437\"/><desc id=\"desc439\">150</desc><desc id=\"desc441\">512: " + "XTEXT_PAINTSHAPE_BEGIN</desc><text class=\"TextShape\" id=\"text485\"><desc " + "class=\"Paragraph\" id=\"desc443\"/><tspan class=\"TextParagraph\" " + "font-family=\"Liberation Sans, sans-serif\" font-size=\"423px\" font-weight=\"400\" " + "id=\"tspan483\"><desc id=\"desc445\">138</desc><desc id=\"desc447\">136</desc><desc " + "id=\"desc449\">135</desc><desc id=\"desc451\">134</desc><desc " + "id=\"desc453\">113</desc><desc class=\"TextPortion\" id=\"desc455\">type: Text; content: " + "[DATE]; </desc><tspan class=\"TextPosition\" x=\"7417\" y=\"510\" id=\"tspan481\"><tspan " + "fill=\"rgb(0,0,0)\" stroke=\"none\" id=\"tspan457\">[DATE]</tspan><desc " + "id=\"desc459\">512: XTEXT_EOC</desc><desc id=\"desc461\">512: XTEXT_EOC</desc><desc " + "id=\"desc463\">512: XTEXT_EOW</desc><desc id=\"desc465\">512: XTEXT_EOC</desc><desc " + "id=\"desc467\">512: XTEXT_EOC</desc><desc id=\"desc469\">512: XTEXT_EOC</desc><desc " + "id=\"desc471\">512: XTEXT_EOC</desc><desc id=\"desc473\">512: XTEXT_EOW</desc><desc " + "id=\"desc475\">512: XTEXT_EOL</desc><desc id=\"desc477\">512: XTEXT_EOP</desc><desc " + "id=\"desc479\">512: XTEXT_PAINTSHAPE_END</desc></tspan></tspan></text></g></g><g " + "class=\"com.sun.star.drawing.TextShape\" id=\"g567\"><g id=\"id10\"><rect " + "class=\"BoundingBox\" stroke=\"none\" fill=\"none\" x=\"0\" y=\"1\" width=\"9001\" " + "height=\"726\" id=\"rect490\"/><desc id=\"desc492\">150</desc><desc id=\"desc494\">512: " + "XTEXT_PAINTSHAPE_BEGIN</desc><text class=\"TextShape\" id=\"text564\"><desc " + "class=\"Paragraph\" id=\"desc496\"/><tspan class=\"TextParagraph\" " + "font-family=\"Liberation Sans, sans-serif\" font-size=\"423px\" font-weight=\"700\" " + "id=\"tspan562\"><desc id=\"desc498\">138</desc><desc id=\"desc500\">136</desc><desc " + "id=\"desc502\">135</desc><desc id=\"desc504\">134</desc><desc " + "id=\"desc506\">113</desc><desc class=\"TextPortion\" id=\"desc508\">type: Text; content: " + "[INVALID_SIGNATURE]; </desc><tspan class=\"TextPosition\" x=\"2180\" y=\"511\" " + "id=\"tspan560\"><tspan fill=\"rgb(239,65,61)\" stroke=\"none\" " + "id=\"tspan510\">[INVALID_SIGNATURE]</tspan><desc id=\"desc512\">512: " + "XTEXT_EOC</desc><desc id=\"desc514\">512: XTEXT_EOC</desc><desc id=\"desc516\">512: " + "XTEXT_EOW</desc><desc id=\"desc518\">512: XTEXT_EOC</desc><desc id=\"desc520\">512: " + "XTEXT_EOC</desc><desc id=\"desc522\">512: XTEXT_EOC</desc><desc id=\"desc524\">512: " + "XTEXT_EOC</desc><desc id=\"desc526\">512: XTEXT_EOC</desc><desc id=\"desc528\">512: " + "XTEXT_EOC</desc><desc id=\"desc530\">512: XTEXT_EOC</desc><desc id=\"desc532\">512: " + "XTEXT_EOC</desc><desc id=\"desc534\">512: XTEXT_EOC</desc><desc id=\"desc536\">512: " + "XTEXT_EOC</desc><desc id=\"desc538\">512: XTEXT_EOC</desc><desc id=\"desc540\">512: " + "XTEXT_EOC</desc><desc id=\"desc542\">512: XTEXT_EOC</desc><desc id=\"desc544\">512: " + "XTEXT_EOC</desc><desc id=\"desc546\">512: XTEXT_EOC</desc><desc id=\"desc548\">512: " + "XTEXT_EOC</desc><desc id=\"desc550\">512: XTEXT_EOC</desc><desc id=\"desc552\">512: " + "XTEXT_EOW</desc><desc id=\"desc554\">512: XTEXT_EOL</desc><desc id=\"desc556\">512: " + "XTEXT_EOP</desc><desc id=\"desc558\">512: " + "XTEXT_PAINTSHAPE_END</desc></tspan></tspan></text></g></g></g></g></g></g></g></svg>"); + 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 <cuicharmap.hxx> #include <cuihyperdlg.hxx> #include <cfgutil.hxx> +#include <SignSignatureLineDialog.hxx> #include <SpellDialog.hxx> #include <zoom.hxx> #include <showcols.hxx> 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 <insdlg.hxx> #include <pastedlg.hxx> #include <linkdlg.hxx> +#include <SignSignatureLineDialog.hxx> #include <SpellDialog.hxx> #include <cfg.hxx> #include <numpages.hxx> @@ -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<AbstractScreenshotAnnotationDlg> AbstractDialogFactory_Impl::CreateScreen return VclPtr<AbstractScreenshotAnnotationDlg_Impl>::Create(pDlg); } +VclPtr<AbstractSignSignatureLineDialog> +AbstractDialogFactory_Impl::CreateSignSignatureLineDialog(weld::Window* pParent, + const Reference<XModel> xModel) +{ + return VclPtr<AbstractSignSignatureLineDialog_Impl>::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<SignSignatureLineDialog> 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<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog(weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override; virtual VclPtr<AbstractScreenshotAnnotationDlg> CreateScreenshotAnnotationDlg(vcl::Window * pParent, Dialog& rParentDialog) override; + + virtual VclPtr<AbstractSignSignatureLineDialog> + CreateSignSignatureLineDialog(weld::Window* pParent, + const css::uno::Reference<css::frame::XModel> 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 <vcl/weld.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/security/XCertificate.hpp> +#include <com/sun/star/uno/Reference.hxx> + +class SignSignatureLineDialog : public weld::GenericDialogController +{ +public: + SignSignatureLineDialog(weld::Widget* pParent, css::uno::Reference<css::frame::XModel> xModel); + + short execute(); + +private: + std::unique_ptr<weld::Entry> m_xEditName; + std::unique_ptr<weld::TextView> m_xEditComment; + std::unique_ptr<weld::Button> m_xBtnChooseCertificate; + std::unique_ptr<weld::Button> m_xBtnSign; + + css::uno::Reference<css::frame::XModel> m_xModel; + css::uno::Reference<css::beans::XPropertySet> m_xShapeProperties; + css::uno::Reference<css::security::XCertificate> 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.20.0 --> +<interface domain="sw"> + <requires lib="gtk+" version="3.18"/> + <object class="GtkDialog" id="SignSignatureLineDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes" context="signsignatureline|SignSignatureLineDialog">Sign Signature Line</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="ok"> + <property name="label">Sign</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">6</property> + <property name="margin_right">6</property> + <property name="margin_top">6</property> + <property name="margin_bottom">6</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkEntry" id="edit_name"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="activates_default">True</property> + <property name="placeholder_text" translatable="yes" context="signsignatureline|edit_name">Type your name here</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_name"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes" context="signsignatureline|label_name" comments="Name of the signer">Your Name:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">edit_name</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label_certificate"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes" context="signsignatureline|label_certificate" comments="Certificate to be used for signing">Certificate:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">edit_name</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="btn_select_certificate"> + <property name="label" translatable="yes" context="signsignatureline|btn_select_certificate">Select Certificate</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label_sign"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="signsignatureline|label_sign">Sign</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="label_add_comment"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes" context="signsignatureline|label_add_comment">Add comment:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">edit_comment</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTextView" id="edit_comment"> + <property name="height_request">60</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="signsignatureline|label_more">More</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="-6">cancel</action-widget> + <action-widget response="-5">ok</action-widget> + </action-widgets> + </object> +</interface> 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 <sal/types.h> #include <rtl/ustring.hxx> #include <tools/link.hxx> #include <vcl/dllapi.h> @@ -28,6 +29,9 @@ #include <functional> #include <memory> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/frame/XModel.hpp> + 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<AbstractPasswordToOpenModifyDialog> CreatePasswordToOpenModifyDialog(weld::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) = 0; + // creates instance of SignSignatureDialog from cui + virtual VclPtr<AbstractSignSignatureLineDialog> + CreateSignSignatureLineDialog(weld::Window* pParent, + const css::uno::Reference<css::frame::XModel> xModel) + = 0; + // creates instance of ScreenshotAnnotationDlg from cui virtual VclPtr<AbstractScreenshotAnnotationDlg> 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 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:SignSignatureLine" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">~Sign Signature Line...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> </node> </node> </oor:component-data> 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<frame::XModel> xModel(GetCurrentDocument()); + VclPtr<AbstractSignSignatureLineDialog> 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 @@ <menu:menuitem menu:id=".uno:AddTextBox"/> <menu:menuitem menu:id=".uno:RemoveTextBox"/> <menu:menuitem menu:id=".uno:EditSignatureLine"/> + <menu:menuitem menu:id=".uno:SignSignatureLine"/> </menu:menupopup> |