officecfg/registry/schema/org/openoffice/Office/Common.xcs |   12 ++++++++++++
 sfx2/source/view/classificationhelper.cxx                  |    6 ++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 9bd334a475e24d8454ef51b4d9aa5bd7668ee58e
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Tue Mar 1 17:55:43 2016 +0100

    sfx2 classification: don't hardcode the policy path
    
    This moves the path from code to configuration, UI is still missing to
    actually edit that configuration key though.
    
    Change-Id: Ie9e9fa986544c8df99203b7f50f19f886ad64009
    Reviewed-on: https://gerrit.libreoffice.org/22817
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
    Tested-by: Jenkins <c...@libreoffice.org>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index e06114e..9ce22f1 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -1580,6 +1580,12 @@
           </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
@@ -1775,6 +1781,12 @@
           </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 8fc5190..cade650 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -29,6 +29,7 @@
 #include <sfx2/sfx.hrc>
 #include <sfx2/sfxresid.hxx>
 #include <sfx2/viewfrm.hxx>
+#include <officecfg/Office/Common.hxx>
 #include <config_folders.h>
 
 using namespace com::sun::star;
@@ -309,14 +310,15 @@ SfxClassificationHelper::Impl::Impl(SfxObjectShell& 
rObjectShell)
 
 void SfxClassificationHelper::Impl::parsePolicy()
 {
-    OUString aPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER 
"/classification/example.xml");
+    uno::Reference<uno::XComponentContext> xComponentContext = 
comphelper::getProcessComponentContext();
+    OUString aPath = 
officecfg::Office::Common::Path::Current::Classification::get(xComponentContext);
     rtl::Bootstrap::expandMacros(aPath);
     SvStream* pStream = utl::UcbStreamHelper::CreateStream(aPath, 
StreamMode::READ);
     uno::Reference<io::XInputStream> xInputStream(new 
utl::OStreamWrapper(*pStream));
     xml::sax::InputSource aParserInput;
     aParserInput.aInputStream = xInputStream;
 
-    uno::Reference<xml::sax::XParser> xParser = 
xml::sax::Parser::create(comphelper::getProcessComponentContext());
+    uno::Reference<xml::sax::XParser> xParser = 
xml::sax::Parser::create(xComponentContext);
     rtl::Reference<SfxClassificationParser> xClassificationParser(new 
SfxClassificationParser());
     uno::Reference<xml::sax::XDocumentHandler> 
xHandler(xClassificationParser.get());
     xParser->setDocumentHandler(xHandler);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to