[Libreoffice-commits] core.git: include/svx officecfg/registry svx/sdi svx/source svx/uiconfig sw/sdi sw/source sw/uiconfig
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Tue Sep 26 11:57:11 UTC 2017
include/svx/ClassificationDialog.hxx | 1
include/svx/svxids.hrc | 2
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 5 +
svx/sdi/svx.sdi | 18 ++++++
svx/source/dialog/ClassificationDialog.cxx | 7 ++
svx/uiconfig/ui/classificationdialog.ui | 30 +++++++++-
sw/sdi/_basesh.sdi | 6 ++
sw/source/uibase/app/docsh2.cxx | 14 ++++
sw/source/uibase/shells/basesh.cxx | 5 +
sw/source/uibase/shells/textsh1.cxx | 17 -----
sw/uiconfig/swriter/toolbar/classificationbar.xml | 1
11 files changed, 87 insertions(+), 19 deletions(-)
New commits:
commit 86c5c812b030cea6753b298a70146375c5d58175
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sat Sep 23 21:31:38 2017 -0400
TSCP: paragraph classification dialog
Change-Id: I3a5f201f9ed28452ee7392cb30aebf21955f3620
Reviewed-on: https://gerrit.libreoffice.org/42737
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/include/svx/ClassificationDialog.hxx b/include/svx/ClassificationDialog.hxx
index c0612124df99..9b315c997381 100644
--- a/include/svx/ClassificationDialog.hxx
+++ b/include/svx/ClassificationDialog.hxx
@@ -27,6 +27,7 @@ class SVX_DLLPUBLIC ClassificationDialog : public ModalDialog
{
private:
VclPtr<ClassificationEditView> m_pEditWindow;
+ VclPtr<PushButton> m_pSignButton;
VclPtr<PushButton> m_pBoldButton;
VclPtr<ListBox> m_pClassificationListBox;
VclPtr<ListBox> m_pInternationalClassificationListBox;
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 6300b67b6b19..84103287e776 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -973,7 +973,7 @@
#define SID_DRAW_MEASURELINE ( SID_SVX_START + 1167 )
#define SID_AUTHOR_COLOR ( SID_SVX_START + 1168 )
#define SID_BMPMASK_COLOR ( SID_SVX_START + 1169 )
-#define SID_PARA_SIGNATURE_ADD ( SID_SVX_START + 1170 )
+#define SID_PARAGRAPH_SIGN_CLASSIFY_DLG ( SID_SVX_START + 1170 )
#define SID_CLASSIFICATION_DIALOG ( SID_SVX_START + 1171 )
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index f7a6f30818ce..3b127de80501 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -6404,6 +6404,11 @@
<value xml:lang="en-US">Classification Dialog</value>
</prop>
</node>
+ <node oor:name=".uno:ParagraphClassificationDialog" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Paragraph Classification Dialog</value>
+ </prop>
+ </node>
<node oor:name=".uno:EditSelectMenu" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Select</value>
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 0bc0412023bf..9b9c45297574 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -4391,6 +4391,24 @@ SfxVoidItem ClassificationDialog SID_CLASSIFICATION_DIALOG
GroupId = SfxGroupId::Document;
]
+SfxVoidItem ParagraphClassificationDialog SID_PARAGRAPH_SIGN_CLASSIFY_DLG
+()
+[
+ AutoUpdate = TRUE,
+ FastCall = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Document;
+]
+
SfxBoolItem Init3D SID_3D_INIT
[
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index 478c6469a6ce..7f0b33ec7813 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -37,6 +37,7 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent)
, maInternationalHelper(SfxObjectShell::Current()->getDocProperties(), /*bUseLocalizedPolicy*/ false)
{
get(m_pEditWindow, "classificationEditWindow");
+ get(m_pSignButton, "signButton");
get(m_pBoldButton, "boldButton");
get(m_pClassificationListBox, "classificationCB");
get(m_pInternationalClassificationListBox, "internationalClassificationCB");
@@ -46,6 +47,7 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent)
get(m_pIntellectualPropertyPartAddButton, "intellectualPropertyPartAddButton");
get(m_pIntellectualPropertyPartEdit, "intellectualPropertyPartEntry");
+ m_pSignButton->SetClickHdl(LINK(this, ClassificationDialog, ButtonClicked));
m_pBoldButton->SetClickHdl(LINK(this, ClassificationDialog, ButtonClicked));
m_pIntellectualPropertyPartAddButton->SetClickHdl(LINK(this, ClassificationDialog, ButtonClicked));
@@ -83,6 +85,7 @@ ClassificationDialog::~ClassificationDialog()
void ClassificationDialog::dispose()
{
m_pEditWindow.clear();
+ m_pSignButton.clear();
m_pBoldButton.clear();
m_pClassificationListBox.clear();
m_pInternationalClassificationListBox.clear();
@@ -252,6 +255,10 @@ IMPL_LINK(ClassificationDialog, ButtonClicked, Button*, pButton, void)
{
m_pEditWindow->InvertSelectionWeight();
}
+ else if (pButton == m_pSignButton)
+ {
+ //TODO sign current paragraph
+ }
else if (pButton == m_pIntellectualPropertyPartAddButton)
{
insertField(ClassificationType::INTELLECTUAL_PROPERTY_PART, m_pIntellectualPropertyPartEdit->GetText());
diff --git a/svx/uiconfig/ui/classificationdialog.ui b/svx/uiconfig/ui/classificationdialog.ui
index 02d2afdb644b..bb1297dd76ec 100644
--- a/svx/uiconfig/ui/classificationdialog.ui
+++ b/svx/uiconfig/ui/classificationdialog.ui
@@ -183,6 +183,34 @@
<property name="spacing">6</property>
<property name="homogeneous">True</property>
<child>
+ <object class="GtkButton" id="signButton">
+ <property name="label" context="classificationdialog|signButton" translatable="yes">Sign Paragraph</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">end</property>
+ <property name="vexpand">True</property>
+ <property name="spacing">6</property>
+ <property name="homogeneous">True</property>
+ <child>
<object class="GtkButton" id="boldButton">
<property name="label" context="classificationdialog|boldButton" translatable="yes">Bold</property>
<property name="visible">True</property>
@@ -198,7 +226,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">4</property>
<property name="width">2</property>
</packing>
</child>
diff --git a/sw/sdi/_basesh.sdi b/sw/sdi/_basesh.sdi
index c3275e247d75..23f4d0e5dfdf 100644
--- a/sw/sdi/_basesh.sdi
+++ b/sw/sdi/_basesh.sdi
@@ -383,6 +383,12 @@ interface BaseTextSelection
StateMethod = StateStyle ;
]
+ SID_PARAGRAPH_SIGN_CLASSIFY_DLG
+ [
+ ExecMethod = Execute ;
+ StateMethod = StateStyle ;
+ ]
+
SID_WATERMARK
[
ExecMethod = Execute ;
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index eae9c158ff91..0064f54f0622 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1178,6 +1178,20 @@ void SwDocShell::Execute(SfxRequest& rReq)
pDialog.disposeAndClear();
}
break;
+ case SID_PARAGRAPH_SIGN_CLASSIFY_DLG:
+ {
+ ScopedVclPtr<svx::ClassificationDialog> pDialog(VclPtr<svx::ClassificationDialog>::Create(nullptr));
+
+ SwWrtShell* pShell = GetWrtShell();
+ std::vector<svx::ClassificationResult> aInput = pShell->CollectAdvancedClassification();
+ pDialog->setupValues(aInput);
+
+ if (RET_OK == pDialog->Execute())
+ pShell->ApplyAdvancedClassification(pDialog->getResult());
+
+ pDialog.disposeAndClear();
+ }
+ break;
case SID_WATERMARK:
{
SwWrtShell* pSh = GetWrtShell();
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index e2c87f6bb156..c2180b12e39a 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -957,6 +957,11 @@ void SwBaseShell::Execute(SfxRequest &rReq)
GetView().GetDocShell()->Execute(rReq);
}
break;
+ case SID_PARAGRAPH_SIGN_CLASSIFY_DLG:
+ {
+ GetView().GetDocShell()->Execute(rReq);
+ }
+ break;
case SID_WATERMARK:
{
GetView().GetDocShell()->Execute(rReq);
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index fb8be7dd5cae..ab61baa6bc4c 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1090,23 +1090,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
}
break;
- case SID_PARA_SIGNATURE_ADD:
- {
- SwPaM* pPaM = nullptr;
- if (pArgs)
- {
- const SfxPoolItem* pPaMItem = nullptr;
- pArgs->GetItemState(GetPool().GetWhich(FN_PARAM_PAM), false, &pPaMItem);
- if (pPaMItem)
- pPaM = static_cast< const SwPaMItem* >(pPaMItem)->GetValue();
- }
-
- if (!pPaM)
- pPaM = rWrtSh.GetCursor();
-
- rWrtSh.SignParagraph(pPaM);
- }
- break;
case FN_NUM_CONTINUE:
{
OUString sContinuedListId;
diff --git a/sw/uiconfig/swriter/toolbar/classificationbar.xml b/sw/uiconfig/swriter/toolbar/classificationbar.xml
index f176c094273a..b1ec27a87cf6 100644
--- a/sw/uiconfig/swriter/toolbar/classificationbar.xml
+++ b/sw/uiconfig/swriter/toolbar/classificationbar.xml
@@ -10,4 +10,5 @@
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
<toolbar:toolbaritem xlink:href=".uno:ClassificationApply"/>
<toolbar:toolbaritem xlink:href=".uno:ClassificationDialog"/>
+ <toolbar:toolbaritem xlink:href=".uno:ParagraphClassificationDialog"/>
</toolbar:toolbar>
More information about the Libreoffice-commits
mailing list