summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-09-11 23:52:18 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-09-19 15:22:48 +0200
commitc9a2cb806cfbdb8a74ee4374e67773b801b5d941 (patch)
tree8a33583f105e98643329ab47ba1172cd68e01f6c
parentTSCP: Advanced document classification dialog (diff)
downloadcore-c9a2cb806cfbdb8a74ee4374e67773b801b5d941.tar.gz
core-c9a2cb806cfbdb8a74ee4374e67773b801b5d941.zip
TSCP: Add IP Part Numbers to BAF Policy and update the Dialog
Change-Id: I1d67b9449752d351b7dd154d664801bc9d2bb32c
-rw-r--r--include/sfx2/classificationhelper.hxx1
-rw-r--r--include/svx/ClassificationDialog.hxx3
-rw-r--r--sfx2/classification/baf.xsd2
-rw-r--r--sfx2/classification/baf_loext.xsd5
-rw-r--r--sfx2/classification/example.xml5
-rw-r--r--sfx2/classification/example_sl-SI.xml5
-rw-r--r--sfx2/source/view/classificationhelper.cxx15
-rw-r--r--svx/source/dialog/ClassificationDialog.cxx11
-rw-r--r--svx/uiconfig/ui/classificationdialog.ui11
9 files changed, 39 insertions, 19 deletions
diff --git a/include/sfx2/classificationhelper.hxx b/include/sfx2/classificationhelper.hxx
index f43fa07ed6c0..9cda08768a87 100644
--- a/include/sfx2/classificationhelper.hxx
+++ b/include/sfx2/classificationhelper.hxx
@@ -81,6 +81,7 @@ public:
const std::vector<OUString> GetMarkings();
const std::vector<OUString> GetIntellectualPropertyParts();
+ const std::vector<OUString> GetIntellectualPropertyPartNumbers();
/// Does a best-effort conversion of rType to SfxClassificationPolicyType.
static SfxClassificationPolicyType stringToPolicyType(const OUString& rType);
diff --git a/include/svx/ClassificationDialog.hxx b/include/svx/ClassificationDialog.hxx
index 3556439407e2..319ae1e65175 100644
--- a/include/svx/ClassificationDialog.hxx
+++ b/include/svx/ClassificationDialog.hxx
@@ -39,8 +39,7 @@ private:
DECL_LINK(ButtonClicked, Button*, void);
DECL_LINK(SelectClassificationHdl, ListBox&, void);
DECL_LINK(SelectMarkingHdl, ListBox&, void);
-
- DECL_LINK(SelectIPPartHdl, ListBox&, void);
+ DECL_LINK(SelectIPPartNumbersHdl, ListBox&, void);
DECL_LINK(DoubleClickIPPartHdl, ListBox&, void);
public:
diff --git a/sfx2/classification/baf.xsd b/sfx2/classification/baf.xsd
index 02796eb29265..a0bae6cc9ff1 100644
--- a/sfx2/classification/baf.xsd
+++ b/sfx2/classification/baf.xsd
@@ -33,6 +33,7 @@
<xs:element ref="BusinessAuthorizationCategory" maxOccurs="unbounded"/>
<xs:element ref="loext:Marking" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="loext:IntellectualPropertyPart" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="loext:IntellectualPropertyPartNumber" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -42,6 +43,7 @@
<xs:element ref="BusinessAuthorizationCategory" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="loext:Marking" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="loext:IntellectualPropertyPart" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element ref="loext:IntellectualPropertyPartNumber" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
diff --git a/sfx2/classification/baf_loext.xsd b/sfx2/classification/baf_loext.xsd
index 2d4ee5bb21a8..593eb01173d5 100644
--- a/sfx2/classification/baf_loext.xsd
+++ b/sfx2/classification/baf_loext.xsd
@@ -11,4 +11,9 @@
<xs:attribute name="Name" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
+ <xs:element name="IntellectualPropertyPartNumber">
+ <xs:complexType>
+ <xs:attribute name="Name" type="xs:string" use="optional"/>
+ </xs:complexType>
+ </xs:element>
</xs:schema>
diff --git a/sfx2/classification/example.xml b/sfx2/classification/example.xml
index 5df86f9a9005..82098031ff91 100644
--- a/sfx2/classification/example.xml
+++ b/sfx2/classification/example.xml
@@ -79,7 +79,10 @@
</baf:ImpactLevel>
</baf:BusinessAuthorizationCategory>
<loext:Marking Name="Example Marking" />
- <loext:IntellectualPropertyPart Name="Example IP Part" />
+ <loext:IntellectualPropertyPart Name="Example First IP Part" />
+ <loext:IntellectualPropertyPart Name="Example Second IP Part" />
+ <loext:IntellectualPropertyPartNumber Name="1" />
+ <loext:IntellectualPropertyPartNumber Name="2" />
</baf:Included>
</baf:BusinessAuthorization>
<!-- vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sfx2/classification/example_sl-SI.xml b/sfx2/classification/example_sl-SI.xml
index 89bb5c5f6f8f..727e0a390ef1 100644
--- a/sfx2/classification/example_sl-SI.xml
+++ b/sfx2/classification/example_sl-SI.xml
@@ -66,7 +66,10 @@
</baf:ImpactLevel>
</baf:BusinessAuthorizationCategory>
<loext:Marking Name="Example Marking" />
- <loext:IntellectualPropertyPart Name="Example IP Part" />
+ <loext:IntellectualPropertyPart Name="Example First IP Part" />
+ <loext:IntellectualPropertyPart Name="Example Second IP Part" />
+ <loext:IntellectualPropertyPartNumber Name="1" />
+ <loext:IntellectualPropertyPartNumber Name="2" />
</baf:Included>
</baf:BusinessAuthorization>
<!-- vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx
index eb9de5f9a3ff..24aaee5da8e5 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -100,6 +100,7 @@ public:
std::vector<SfxClassificationCategory> m_aCategories;
std::vector<OUString> m_aMarkings;
std::vector<OUString> m_aIPParts;
+ std::vector<OUString> m_aIPPartNumbers;
OUString m_aPolicyAuthorityName;
bool m_bInPolicyAuthorityName = false;
@@ -222,6 +223,11 @@ void SAL_CALL SfxClassificationParser::startElement(const OUString& rName, const
OUString aName = xAttribs->getValueByName("Name");
m_aIPParts.push_back(aName);
}
+ else if (rName == "loext:IntellectualPropertyPartNumber")
+ {
+ OUString aName = xAttribs->getValueByName("Name");
+ m_aIPPartNumbers.push_back(aName);
+ }
else if (rName == "baf:Scale")
{
m_aScale.clear();
@@ -333,6 +339,7 @@ public:
std::vector<SfxClassificationCategory> m_aCategories;
std::vector<OUString> m_aMarkings;
std::vector<OUString> m_aIPParts;
+ std::vector<OUString> m_aIPPartNumbers;
uno::Reference<document::XDocumentProperties> m_xDocumentProperties;
@@ -387,6 +394,7 @@ void SfxClassificationHelper::Impl::parsePolicy()
m_aCategories = xClassificationParser->m_aCategories;
m_aMarkings = xClassificationParser->m_aMarkings;
m_aIPParts = xClassificationParser->m_aIPParts;
+ m_aIPPartNumbers = xClassificationParser->m_aIPPartNumbers;
}
bool lcl_containsProperty(const uno::Sequence<beans::Property>& rProperties, const OUString& rName)
@@ -561,7 +569,12 @@ const std::vector<OUString> SfxClassificationHelper::GetMarkings()
const std::vector<OUString> SfxClassificationHelper::GetIntellectualPropertyParts()
{
- return m_pImpl->m_aMarkings;
+ return m_pImpl->m_aIPParts;
+}
+
+const std::vector<OUString> SfxClassificationHelper::GetIntellectualPropertyPartNumbers()
+{
+ return m_pImpl->m_aIPPartNumbers;
}
const OUString& SfxClassificationHelper::GetBACName(SfxClassificationPolicyType eType)
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index d71add613182..7b3f28ca83cd 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -57,7 +57,11 @@ ClassificationDialog::ClassificationDialog(vcl::Window* pParent)
m_pMarkingListBox->InsertEntry(rName);
m_pMarkingListBox->EnableAutoSize(true);
- m_pIntellectualPropertyPartListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectIPPartHdl));
+ m_pIntellectualPropertyPartNumberListBox->SetSelectHdl(LINK(this, ClassificationDialog, SelectIPPartNumbersHdl));
+ for (const OUString& rName : maHelper.GetIntellectualPropertyPartNumbers())
+ m_pIntellectualPropertyPartNumberListBox->InsertEntry(rName);
+ m_pIntellectualPropertyPartNumberListBox->EnableAutoSize(true);
+
m_pIntellectualPropertyPartListBox->SetDoubleClickHdl(LINK(this, ClassificationDialog, DoubleClickIPPartHdl));
for (const OUString& rName : maHelper.GetIntellectualPropertyParts())
m_pIntellectualPropertyPartListBox->InsertEntry(rName);
@@ -154,14 +158,15 @@ IMPL_LINK(ClassificationDialog, SelectMarkingHdl, ListBox&, rBox, void)
}
}
- OUString aString = maHelper.GetBACNames()[nSelected];
+ OUString aString = maHelper.GetMarkings()[nSelected];
ClassificationField aField(ClassificationType::MARKINGS, aString);
m_pEditWindow->InsertField(SvxFieldItem(aField, EE_FEATURE_FIELD));
}
}
-IMPL_LINK(ClassificationDialog, SelectIPPartHdl, ListBox&, rBox, void)
+IMPL_LINK(ClassificationDialog, SelectIPPartNumbersHdl, ListBox&, rBox, void)
{
+ printf ("DoubleClickIPPartHdl\n");
}
IMPL_LINK(ClassificationDialog, DoubleClickIPPartHdl, ListBox&, rBox, void)
diff --git a/svx/uiconfig/ui/classificationdialog.ui b/svx/uiconfig/ui/classificationdialog.ui
index 097e5260767f..2f9ced8cb826 100644
--- a/svx/uiconfig/ui/classificationdialog.ui
+++ b/svx/uiconfig/ui/classificationdialog.ui
@@ -241,17 +241,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">0</property>
- <items>
- <item id="1">1</item>
- <item id="2">2</item>
- <item id="3">3</item>
- <item id="4">4</item>
- <item id="5">5</item>
- <item id="6">6</item>
- <item id="7">7</item>
- <item id="8">8</item>
- <item id="9">9</item>
- </items>
</object>
<packing>
<property name="left_attach">2</property>