diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/edit/edfcol.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 00fb5766c836..b57f64590536 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1984,12 +1984,12 @@ bool SwEditShell::RemoveParagraphMetadataFieldAtCursor(const bool bBackspaceNotD return false; } -OUString lcl_GetParagraphClassification(const uno::Reference<frame::XModel>& xModel, const uno::Reference<text::XTextContent>& xParagraph) +OUString lcl_GetParagraphClassification(sfx::ClassificationKeyCreator const & rKeyCreator, const uno::Reference<frame::XModel>& xModel, const uno::Reference<text::XTextContent>& xParagraph) { - const OUString sPolicy = SfxClassificationHelper::policyTypeToString(SfxClassificationHelper::getPolicyType()); - uno::Reference<text::XTextField> xTextField = lcl_FindParagraphClassificationField(xModel, xParagraph, sPolicy + "BusinessAuthorizationCategory:Name"); + + uno::Reference<text::XTextField> xTextField = lcl_FindParagraphClassificationField(xModel, xParagraph, rKeyCreator.makeCategoryNameKey()); if (!xTextField.is()) - xTextField = lcl_FindParagraphClassificationField(xModel, xParagraph, sPolicy + "BusinessAuthorizationCategory:Identifier"); + xTextField = lcl_FindParagraphClassificationField(xModel, xParagraph, rKeyCreator.makeCategoryIdentifierKey()); if (xTextField.is()) { @@ -2013,6 +2013,7 @@ OUString lcl_GetHighestClassificationParagraphClass(SwPaM* pCursor) return sHighestClass; SfxClassificationHelper aHelper(pDocShell->getDocProperties()); + sfx::ClassificationKeyCreator aKeyCreator(SfxClassificationHelper::getPolicyType()); uno::Reference<frame::XModel> xModel = pDocShell->GetBaseModel(); const uno::Reference< text::XTextDocument > xDoc(xModel, uno::UNO_QUERY); @@ -2023,7 +2024,7 @@ OUString lcl_GetHighestClassificationParagraphClass(SwPaM* pCursor) while (xParagraphs->hasMoreElements()) { uno::Reference<text::XTextContent> xParagraph(xParagraphs->nextElement(), uno::UNO_QUERY); - sHighestClass = aHelper.GetHigherClass(sHighestClass, lcl_GetParagraphClassification(xModel, xParagraph)); + sHighestClass = aHelper.GetHigherClass(sHighestClass, lcl_GetParagraphClassification(aKeyCreator, xModel, xParagraph)); } return sHighestClass; |