summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-09-12 11:29:14 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-09-19 15:22:48 +0200
commitf13618c56a66d034ac5c8a0588ed4ec02608cba8 (patch)
treeb47d784baacecbdabd33f63bfc400e22d9b8021d
parentTSCP: Add IP Part Numbers to BAF Policy and update the Dialog (diff)
downloadcore-f13618c56a66d034ac5c8a0588ed4ec02608cba8.tar.gz
core-f13618c56a66d034ac5c8a0588ed4ec02608cba8.zip
TSCP: Make IP Part section of the dialog functional
Change-Id: Ibb4d9ee103b135ec2a258aed538d9f899e70fe69
-rw-r--r--include/svx/ClassificationDialog.hxx2
-rw-r--r--include/svx/ClassificationField.hxx1
-rw-r--r--svx/source/dialog/ClassificationDialog.cxx17
-rw-r--r--svx/uiconfig/ui/classificationdialog.ui2
4 files changed, 19 insertions, 3 deletions
diff --git a/include/svx/ClassificationDialog.hxx b/include/svx/ClassificationDialog.hxx
index 319ae1e65175..2e678c68177a 100644
--- a/include/svx/ClassificationDialog.hxx
+++ b/include/svx/ClassificationDialog.hxx
@@ -15,6 +15,7 @@
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/lstbox.hxx>
+#include <vcl/edit.hxx>
#include <svx/svxdllapi.h>
#include <svx/ClassificationEditView.hxx>
#include <sfx2/classificationhelper.hxx>
@@ -33,6 +34,7 @@ private:
VclPtr<ListBox> m_pIntellectualPropertyPartListBox;
VclPtr<ListBox> m_pIntellectualPropertyPartNumberListBox;
VclPtr<PushButton> m_pIntellectualPropertyPartAddButton;
+ VclPtr<Edit> m_pIntellectualPropertyPartEdit;
SfxClassificationHelper maHelper;
diff --git a/include/svx/ClassificationField.hxx b/include/svx/ClassificationField.hxx
index ab2b01a8e122..df28d5cf7286 100644
--- a/include/svx/ClassificationField.hxx
+++ b/include/svx/ClassificationField.hxx
@@ -21,6 +21,7 @@ enum class ClassificationType
CLASSIFICATION,
MARKINGS,
TEXT,
+ INTELLECTUAL_PROPERTY_PART
};
class SVX_DLLPUBLIC ClassificationField : public SvxFieldData
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index 7b3f28ca83cd..9c4b10855fee 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -43,6 +43,7 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent)
get(m_pIntellectualPropertyPartNumberListBox, "intellectualPropertyPartNumberCB");
get(m_pIntellectualPropertyPartListBox, "intellectualPropertyPartLB");
get(m_pIntellectualPropertyPartAddButton, "intellectualPropertyPartAddButton");
+ get(m_pIntellectualPropertyPartEdit, "intellectualPropertyPartEntry");
m_pBoldButton->SetClickHdl(LINK(this, ClassificationDialog, ButtonClicked));
m_pIntellectualPropertyPartAddButton->SetClickHdl(LINK(this, ClassificationDialog, ButtonClicked));
@@ -166,12 +167,22 @@ IMPL_LINK(ClassificationDialog, SelectMarkingHdl, ListBox&, rBox, void)
IMPL_LINK(ClassificationDialog, SelectIPPartNumbersHdl, ListBox&, rBox, void)
{
- printf ("DoubleClickIPPartHdl\n");
+ sal_Int32 nSelected = rBox.GetSelectEntryPos();
+ if (nSelected >= 0)
+ {
+ OUString sString = maHelper.GetIntellectualPropertyPartNumbers()[nSelected];
+ m_pIntellectualPropertyPartEdit->SetText(m_pIntellectualPropertyPartEdit->GetText() + sString);
+ }
}
IMPL_LINK(ClassificationDialog, DoubleClickIPPartHdl, ListBox&, rBox, void)
{
- printf ("DoubleClickIPPartHdl\n");
+ sal_Int32 nSelected = rBox.GetSelectEntryPos();
+ if (nSelected >= 0)
+ {
+ OUString sString = maHelper.GetIntellectualPropertyParts()[nSelected];
+ m_pIntellectualPropertyPartEdit->SetText(m_pIntellectualPropertyPartEdit->GetText() + sString);
+ }
}
IMPL_LINK(ClassificationDialog, ButtonClicked, Button*, pButton, void)
@@ -182,6 +193,8 @@ IMPL_LINK(ClassificationDialog, ButtonClicked, Button*, pButton, void)
}
else if (pButton == m_pIntellectualPropertyPartAddButton)
{
+ ClassificationField aField(ClassificationType::INTELLECTUAL_PROPERTY_PART, m_pIntellectualPropertyPartEdit->GetText());
+ m_pEditWindow->InsertField(SvxFieldItem(aField, EE_FEATURE_FIELD));
}
}
diff --git a/svx/uiconfig/ui/classificationdialog.ui b/svx/uiconfig/ui/classificationdialog.ui
index 2f9ced8cb826..be834b815eea 100644
--- a/svx/uiconfig/ui/classificationdialog.ui
+++ b/svx/uiconfig/ui/classificationdialog.ui
@@ -260,7 +260,7 @@
</packing>
</child>
<child>
- <object class="GtkEntry">
+ <object class="GtkEntry" id="intellectualPropertyPartEntry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>