diff options
-rw-r--r-- | include/unotools/pathoptions.hxx | 3 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/Paths.xcu | 10 | ||||
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 12 | ||||
-rw-r--r-- | sfx2/source/view/classificationhelper.cxx | 6 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 16 |
5 files changed, 31 insertions, 16 deletions
diff --git a/include/unotools/pathoptions.hxx b/include/unotools/pathoptions.hxx index f69954e351bb..ceaee0090cb2 100644 --- a/include/unotools/pathoptions.hxx +++ b/include/unotools/pathoptions.hxx @@ -60,6 +60,7 @@ public: PATH_WORK, PATH_UICONFIG, PATH_FINGERPRINT, + PATH_CLASSIFICATION, PATH_COUNT // should always be the last element }; @@ -91,6 +92,7 @@ public: const OUString& GetWorkPath() const; const OUString& GetUIConfigPath() const; const OUString& GetFingerprintPath() const; + const OUString& GetClassificationPath() const; // set the paths void SetAddinPath( const OUString& rPath ); @@ -115,6 +117,7 @@ public: void SetTemplatePath( const OUString& rPath ); void SetUserConfigPath( const OUString& rPath ); void SetWorkPath( const OUString& rPath ); + void SetClassificationPath( const OUString& rPath ); OUString SubstituteVariable( const OUString& rVar ) const; OUString ExpandMacros( const OUString& rPath ) const; diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu index 965a629ac790..55db320e8b15 100644 --- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu @@ -206,6 +206,16 @@ <value>$(work)</value> </prop> </node> + <node oor:name="Classification" oor:op="fuse" oor:mandatory="true"> + <prop oor:name="IsSinglePath" oor:finalized="true"> + <value>true</value> + </prop> + <node oor:name="InternalPaths" oor:finalized="true"/> + <prop oor:name="UserPaths" oor:finalized="true"/> + <prop oor:name="WritePath"> + <value>$(insturl)/@LIBO_SHARE_FOLDER@/classification/example.xml</value> + </prop> + </node> </node> <node oor:name="Variables"> <prop oor:name="Work"> diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 9ce22f11f95d..e06114ec195f 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -1580,12 +1580,6 @@ </info> <value>$(insturl)/@LIBO_SHARE_FOLDER@/config/symbol</value> </prop> - <prop oor:name="Classification" oor:type="xs:string" oor:nillable="false"> - <info> - <desc>Contains the URL of the current TSCP BAF policy file.</desc> - </info> - <value>$BRAND_BASE_DIR/@LIBO_SHARE_FOLDER@/classification/example.xml</value> - </prop> <prop oor:name="Config" oor:type="xs:string" oor:nillable="false"> <info> <desc>Contains the configuration files. This value cannot be changed @@ -1781,12 +1775,6 @@ </info> <value>$(insturl)/@LIBO_SHARE_FOLDER@/config/symbol</value> </prop> - <prop oor:name="Classification" oor:type="xs:string" oor:nillable="false"> - <info> - <desc>Contains the URL of the default TSCP BAF policy file.</desc> - </info> - <value>$BRAND_BASE_DIR/@LIBO_SHARE_FOLDER@/classification/example.xml</value> - </prop> <prop oor:name="Config" oor:type="xs:string" oor:nillable="false"> <info> <desc>Specifies the default directory where the configuration files diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index cade650267e7..f086ade5ed00 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -22,7 +22,7 @@ #include <sfx2/objsh.hxx> #include <o3tl/make_unique.hxx> #include <comphelper/processfactory.hxx> -#include <rtl/bootstrap.hxx> +#include <unotools/pathoptions.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/streamwrap.hxx> #include <cppuhelper/implbase.hxx> @@ -311,8 +311,8 @@ SfxClassificationHelper::Impl::Impl(SfxObjectShell& rObjectShell) void SfxClassificationHelper::Impl::parsePolicy() { uno::Reference<uno::XComponentContext> xComponentContext = comphelper::getProcessComponentContext(); - OUString aPath = officecfg::Office::Common::Path::Current::Classification::get(xComponentContext); - rtl::Bootstrap::expandMacros(aPath); + SvtPathOptions aOptions; + OUString aPath = aOptions.GetClassificationPath(); SvStream* pStream = utl::UcbStreamHelper::CreateStream(aPath, StreamMode::READ); uno::Reference<io::XInputStream> xInputStream(new utl::OStreamWrapper(*pStream)); xml::sax::InputSource aParserInput; diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 42fcd81cbf76..13fa33500914 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -126,6 +126,7 @@ class SvtPathOptions_Impl const OUString& GetWorkPath() { return GetPath( SvtPathOptions::PATH_WORK ); } const OUString& GetUIConfigPath() { return GetPath( SvtPathOptions::PATH_UICONFIG ); } const OUString& GetFingerprintPath() { return GetPath( SvtPathOptions::PATH_FINGERPRINT ); } + const OUString& GetClassificationPath() { return GetPath( SvtPathOptions::PATH_CLASSIFICATION ); } // set the paths void SetPath( SvtPathOptions::Paths, const OUString& rNewPath ); @@ -151,6 +152,7 @@ class SvtPathOptions_Impl void SetTemplatePath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_TEMPLATE, rPath ); } void SetUserConfigPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_USERCONFIG, rPath ); } void SetWorkPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_WORK, rPath ); } + void SetClassificationPath( const OUString& rPath ) { SetPath( SvtPathOptions::PATH_CLASSIFICATION, rPath ); } OUString SubstVar( const OUString& rVar ) const; OUString ExpandMacros( const OUString& rPath ) const; @@ -202,7 +204,8 @@ static const PropertyStruct aPropNames[] = { "UserConfig", SvtPathOptions::PATH_USERCONFIG }, { "Work", SvtPathOptions::PATH_WORK }, { "UIConfig", SvtPathOptions::PATH_UICONFIG }, - { "Fingerprint", SvtPathOptions::PATH_FINGERPRINT } + { "Fingerprint", SvtPathOptions::PATH_FINGERPRINT }, + { "Classification", SvtPathOptions::PATH_CLASSIFICATION } }; static const VarNameAttribute aVarNameAttribute[] = @@ -584,6 +587,11 @@ const OUString& SvtPathOptions::GetWorkPath() const return pImp->GetWorkPath(); } +const OUString& SvtPathOptions::GetClassificationPath() const +{ + return pImp->GetClassificationPath(); +} + void SvtPathOptions::SetAddinPath( const OUString& rPath ) { pImp->SetAddinPath( rPath ); @@ -694,6 +702,11 @@ void SvtPathOptions::SetWorkPath( const OUString& rPath ) pImp->SetWorkPath( rPath ); } +void SvtPathOptions::SetClassificationPath( const OUString& rPath ) +{ + pImp->SetClassificationPath( rPath ); +} + OUString SvtPathOptions::SubstituteVariable( const OUString& rVar ) const { return pImp->SubstVar( rVar ); @@ -778,6 +791,7 @@ bool SvtPathOptions::SearchFile( OUString& rIniFile, Paths ePath ) case PATH_WORK: aPath = GetWorkPath(); break; case PATH_UICONFIG: aPath = GetUIConfigPath(); break; case PATH_FINGERPRINT: aPath = GetFingerprintPath(); break; + case PATH_CLASSIFICATION: aPath = GetClassificationPath(); break; // coverity[dead_error_begin] - following conditions exist to avoid compiler warning case PATH_USERCONFIG: case PATH_COUNT: |