diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-01 17:55:43 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-01 17:33:07 +0000 |
commit | 9bd334a475e24d8454ef51b4d9aa5bd7668ee58e (patch) | |
tree | 45a78cfdc48e88ec104688df5186525af1a7bcec /sfx2 | |
parent | 398fadca9a82917ed865e328ba454d8015803b66 (diff) |
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 <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/classificationhelper.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index 8fc5190a2804..cade650267e7 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); |