summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-11-10 13:23:48 +0900
committerTomaž Vajngerl <quikee@gmail.com>2017-11-11 00:47:23 +0100
commite5bc780e92ecf4790869e365142e625b087c5057 (patch)
treea9045624976531bedeb9baab73bcd9143bb0f531
parent574bac673366bc317e8ef10f288945d8dd5c2050 (diff)
TSCP: use classification key creator instead of strings
Change-Id: I2bc224aa0e290b0fab1c989834e5d79a72de35aa Reviewed-on: https://gerrit.libreoffice.org/44574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--sw/source/core/edit/edfcol.cxx11
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;