Kaydet (Commit) e5bc780e authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

TSCP: use classification key creator instead of strings

Change-Id: I2bc224aa0e290b0fab1c989834e5d79a72de35aa
Reviewed-on: https://gerrit.libreoffice.org/44574Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 574bac67
...@@ -1984,12 +1984,12 @@ bool SwEditShell::RemoveParagraphMetadataFieldAtCursor(const bool bBackspaceNotD ...@@ -1984,12 +1984,12 @@ bool SwEditShell::RemoveParagraphMetadataFieldAtCursor(const bool bBackspaceNotD
return false; 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()) if (!xTextField.is())
xTextField = lcl_FindParagraphClassificationField(xModel, xParagraph, sPolicy + "BusinessAuthorizationCategory:Identifier"); xTextField = lcl_FindParagraphClassificationField(xModel, xParagraph, rKeyCreator.makeCategoryIdentifierKey());
if (xTextField.is()) if (xTextField.is())
{ {
...@@ -2013,6 +2013,7 @@ OUString lcl_GetHighestClassificationParagraphClass(SwPaM* pCursor) ...@@ -2013,6 +2013,7 @@ OUString lcl_GetHighestClassificationParagraphClass(SwPaM* pCursor)
return sHighestClass; return sHighestClass;
SfxClassificationHelper aHelper(pDocShell->getDocProperties()); SfxClassificationHelper aHelper(pDocShell->getDocProperties());
sfx::ClassificationKeyCreator aKeyCreator(SfxClassificationHelper::getPolicyType());
uno::Reference<frame::XModel> xModel = pDocShell->GetBaseModel(); uno::Reference<frame::XModel> xModel = pDocShell->GetBaseModel();
const uno::Reference< text::XTextDocument > xDoc(xModel, uno::UNO_QUERY); const uno::Reference< text::XTextDocument > xDoc(xModel, uno::UNO_QUERY);
...@@ -2023,7 +2024,7 @@ OUString lcl_GetHighestClassificationParagraphClass(SwPaM* pCursor) ...@@ -2023,7 +2024,7 @@ OUString lcl_GetHighestClassificationParagraphClass(SwPaM* pCursor)
while (xParagraphs->hasMoreElements()) while (xParagraphs->hasMoreElements())
{ {
uno::Reference<text::XTextContent> xParagraph(xParagraphs->nextElement(), uno::UNO_QUERY); 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; return sHighestClass;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment