summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/classificationhelper.hxx22
-rw-r--r--sd/source/ui/view/drviews2.cxx6
-rw-r--r--sw/source/core/edit/edfcol.cxx12
3 files changed, 27 insertions, 13 deletions
diff --git a/include/sfx2/classificationhelper.hxx b/include/sfx2/classificationhelper.hxx
index 0ea432ffbe99..c5c6294d603b 100644
--- a/include/sfx2/classificationhelper.hxx
+++ b/include/sfx2/classificationhelper.hxx
@@ -116,6 +116,8 @@ private:
const SfxClassificationPolicyType m_ePolicyType;
const OUString m_sPolicy;
sal_Int32 m_nTextNumber;
+ sal_Int32 m_nIPPartNumber;
+ sal_Int32 m_nMarkingNumber;
OUString getPolicyKey() const
{
@@ -126,21 +128,23 @@ public:
: m_ePolicyType(ePolicyType)
, m_sPolicy(SfxClassificationHelper::policyTypeToString(m_ePolicyType))
, m_nTextNumber(1)
+ , m_nIPPartNumber(1)
+ , m_nMarkingNumber(1)
{}
- OUString makeMarkingTextKey() const
+ OUString makeTextKey() const
{
return getPolicyKey() + "Marking:Text";
}
- OUString makeNumberedMarkingTextKey()
+ OUString makeNumberedTextKey()
{
- return makeMarkingTextKey() + ":" + OUString::number(m_nTextNumber++);
+ return makeTextKey() + ":" + OUString::number(m_nTextNumber++);
}
bool isMarkingTextKey(OUString const & aKey) const
{
- return aKey.startsWith(makeMarkingTextKey());
+ return aKey.startsWith(makeTextKey());
}
OUString makeCategoryNameKey() const
@@ -168,6 +172,11 @@ public:
return getPolicyKey() + "Extension:Marking";
}
+ OUString makeNumberedMarkingKey()
+ {
+ return makeMarkingKey() + ":" + OUString::number(m_nMarkingNumber++);
+ }
+
bool isMarkingKey(OUString const & aKey) const
{
return aKey.startsWith(makeMarkingKey());
@@ -178,6 +187,11 @@ public:
return getPolicyKey() + "Extension:IntellectualPropertyPart";
}
+ OUString makeNumberedIntellectualPropertyPartKey()
+ {
+ return makeIntellectualPropertyPartKey() + ":" + OUString::number(m_nIPPartNumber++);
+ }
+
bool isIntellectualPropertyPartKey(OUString const & aKey) const
{
return aKey.startsWith(makeIntellectualPropertyPartKey());
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 02677ab4846d..6e327c690ae1 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -405,7 +405,7 @@ private:
{
case svx::ClassificationType::TEXT:
{
- OUString sKey = m_aKeyCreator.makeNumberedMarkingTextKey();
+ OUString sKey = m_aKeyCreator.makeNumberedTextKey();
svx::classification::addOrInsertDocumentProperty(m_xPropertyContainer, sKey, rResult.msName);
pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msName), EE_FEATURE_FIELD), aPosition);
}
@@ -420,7 +420,7 @@ private:
case svx::ClassificationType::MARKING:
{
- OUString sKey = m_aKeyCreator.makeMarkingKey();
+ OUString sKey = m_aKeyCreator.makeNumberedMarkingKey();
svx::classification::addOrInsertDocumentProperty(m_xPropertyContainer, sKey, rResult.msName);
pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msName), EE_FEATURE_FIELD), aPosition);
}
@@ -428,7 +428,7 @@ private:
case svx::ClassificationType::INTELLECTUAL_PROPERTY_PART:
{
- OUString sKey = m_aKeyCreator.makeIntellectualPropertyPartKey();
+ OUString sKey = m_aKeyCreator.makeNumberedIntellectualPropertyPartKey();
svx::classification::addOrInsertDocumentProperty(m_xPropertyContainer, sKey, rResult.msName);
pOutliner->QuickInsertField(SvxFieldItem(editeng::CustomPropertyField(sKey, rResult.msName), EE_FEATURE_FIELD), aPosition);
}
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index a388be593dc1..8124f7bdaa6e 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -789,7 +789,7 @@ void SwEditShell::ApplyAdvancedClassification(std::vector<svx::ClassificationRes
{
case svx::ClassificationType::TEXT:
{
- OUString sKey = aCreator.makeNumberedMarkingTextKey();
+ OUString sKey = aCreator.makeNumberedTextKey();
svx::classification::addOrInsertDocumentProperty(xPropertyContainer, sKey, rResult.msName);
insertFieldToDocument(xMultiServiceFactory, xHeaderText, xHeaderParagraphCursor, sKey);
@@ -807,7 +807,7 @@ void SwEditShell::ApplyAdvancedClassification(std::vector<svx::ClassificationRes
case svx::ClassificationType::MARKING:
{
- OUString sKey = aCreator.makeMarkingKey();
+ OUString sKey = aCreator.makeNumberedMarkingKey();
svx::classification::addOrInsertDocumentProperty(xPropertyContainer, sKey, rResult.msName);
insertFieldToDocument(xMultiServiceFactory, xHeaderText, xHeaderParagraphCursor, sKey);
insertFieldToDocument(xMultiServiceFactory, xFooterText, xFooterParagraphCursor, sKey);
@@ -816,7 +816,7 @@ void SwEditShell::ApplyAdvancedClassification(std::vector<svx::ClassificationRes
case svx::ClassificationType::INTELLECTUAL_PROPERTY_PART:
{
- OUString sKey = aCreator.makeIntellectualPropertyPartKey();
+ OUString sKey = aCreator.makeNumberedIntellectualPropertyPartKey();
svx::classification::addOrInsertDocumentProperty(xPropertyContainer, sKey, rResult.msName);
insertFieldToDocument(xMultiServiceFactory, xHeaderText, xHeaderParagraphCursor, sKey);
insertFieldToDocument(xMultiServiceFactory, xFooterText, xFooterParagraphCursor, sKey);
@@ -1094,7 +1094,7 @@ void SwEditShell::ApplyParagraphClassification(std::vector<svx::ClassificationRe
{
case svx::ClassificationType::TEXT:
{
- sKey = aKeyCreator.makeNumberedMarkingTextKey();
+ sKey = aKeyCreator.makeNumberedTextKey();
}
break;
@@ -1109,13 +1109,13 @@ void SwEditShell::ApplyParagraphClassification(std::vector<svx::ClassificationRe
case svx::ClassificationType::MARKING:
{
- sKey = aKeyCreator.makeMarkingKey();
+ sKey = aKeyCreator.makeNumberedMarkingKey();
}
break;
case svx::ClassificationType::INTELLECTUAL_PROPERTY_PART:
{
- sKey = aKeyCreator.makeIntellectualPropertyPartKey();
+ sKey = aKeyCreator.makeNumberedIntellectualPropertyPartKey();
}
break;