From 5bd7cc788d0b0f4a2595f32f4897abe6e39ce6c8 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Fri, 10 Nov 2017 16:26:56 +0900 Subject: TSCP: Remember the origin and on save, act accordingly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we created the document classification via pop-up (BAF policy) then the highest classification needs to apply the classification from the BAF policy. In other case the classification was set via the advanced classification dialog, we only need to reset the document properties. Change-Id: I0aa0c010e8de3c16920b64a97e5e4dd2e643c2cd Reviewed-on: https://gerrit.libreoffice.org/44576 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/sfx2/classificationhelper.hxx | 17 ++++++++++++++++- include/svx/ClassificationCommon.hxx | 8 ++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sfx2/classificationhelper.hxx b/include/sfx2/classificationhelper.hxx index c5c6294d603b..a3f32788c2d9 100644 --- a/include/sfx2/classificationhelper.hxx +++ b/include/sfx2/classificationhelper.hxx @@ -110,6 +110,15 @@ public: namespace sfx { + +/// Specifies the origin: either defined by the BAF policy or manual via. the advanced classification dialog +enum class ClassificationCreationOrigin +{ + NONE, + BAF_POLICY, + MANUAL +}; + class ClassificationKeyCreator { private: @@ -199,7 +208,13 @@ public: OUString makeFullTextualRepresentationKey() const { - return getPolicyKey() + "FullTexturalRepresentation"; + return getPolicyKey() + "Extension:FullTexturalRepresentation"; + } + + /// Classification creation origin key + OUString makeCreationOriginKey() const + { + return getPolicyKey() + "CreationOrigin"; } }; diff --git a/include/svx/ClassificationCommon.hxx b/include/svx/ClassificationCommon.hxx index eb8d864ff21b..c08ecd7293ad 100644 --- a/include/svx/ClassificationCommon.hxx +++ b/include/svx/ClassificationCommon.hxx @@ -43,6 +43,14 @@ SVX_DLLPUBLIC void insertFullTextualRepresentationAsDocumentProperty( css::uno::Reference const& rxPropertyContainer, sfx::ClassificationKeyCreator const& rKeyCreator, std::vector const& rResults); + +SVX_DLLPUBLIC void insertCreationOrigin(css::uno::Reference const & rxPropertyContainer, + sfx::ClassificationKeyCreator const & rKeyCreator, + sfx::ClassificationCreationOrigin eOrigin); + +SVX_DLLPUBLIC sfx::ClassificationCreationOrigin getCreationOriginProperty(css::uno::Reference const & rxPropertyContainer, + sfx::ClassificationKeyCreator const & rKeyCreator); + } } // end svx::classification namespace -- cgit