[Libreoffice-commits] .: xmloff/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Tue Feb 7 00:06:34 PST 2012


 xmloff/source/core/DocumentSettingsContext.cxx |   23 +++--------------------
 xmloff/source/core/xmlexp.cxx                  |   20 ++++++--------------
 2 files changed, 9 insertions(+), 34 deletions(-)

New commits:
commit b87201e158d598a85fb7f351baa552fc38afe158
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Feb 7 09:06:25 2012 +0100

    Some configmgr usage clean up

diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index c8b78d5..9c962ce 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -26,7 +26,9 @@
  *
  ************************************************************************/
 
+#include "sal/config.h"
 
+#include <officecfg/Office/Common.hxx>
 #include <sax/tools/converter.hxx>
 
 #include <com/sun/star/util/XStringSubstitution.hpp>
@@ -43,21 +45,15 @@
 #include <com/sun/star/container/XIndexContainer.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/formula/SymbolDescriptor.hpp>
-#include <comphelper/processfactory.hxx>
 #include <com/sun/star/util/DateTime.hpp>
 #include <com/sun/star/document/XViewDataSupplier.hpp>
 #include <com/sun/star/document/PrinterIndependentLayout.hpp>
-#include <comphelper/configurationhelper.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <xmlenums.hxx>
 
 using namespace com::sun::star;
 using namespace ::xmloff::token;
 
-#define C2U(cChar) ::rtl::OUString::createFromAscii(cChar)
-
-//------------------------------------------------------------------
-
 class XMLMyList
 {
     std::list<beans::PropertyValue> aProps;
@@ -449,23 +445,10 @@ void XMLDocumentSettingsContext::EndElement()
         }
     }
 
-    sal_Bool bLoadDocPrinter( sal_True );
-
-    try
-    {
-        ::comphelper::ConfigurationHelper::readDirectKey(
-            ::comphelper::getProcessServiceFactory(),
-            C2U("org.openoffice.Office.Common/"), C2U("Save/Document"), C2U("LoadPrinter"),
-            ::comphelper::ConfigurationHelper::E_READONLY ) >>= bLoadDocPrinter;
-    }
-    catch( const uno::Exception& )
-    {
-    }
-
     uno::Sequence<beans::PropertyValue> aSeqConfigProps;
     if ( m_pData->aConfigProps >>= aSeqConfigProps )
     {
-        if ( !bLoadDocPrinter )
+        if (!officecfg::Office::Common::Save::Document::LoadPrinter::get())
         {
             sal_Int32 i = aSeqConfigProps.getLength() - 1;
             int nFound = 0;
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 6db7911..e92545c 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -26,10 +26,9 @@
  *
  ************************************************************************/
 
+#include "sal/config.h"
 
-#ifdef PRECOMPILED
-#include "filt_pch.hxx"
-#endif
+#include <officecfg/Office/Common.hxx>
 #include <xmloff/unointerfacetouniqueidentifiermapper.hxx>
 #include <osl/mutex.hxx>
 #include <tools/debug.hxx>
@@ -43,7 +42,6 @@
 #include <com/sun/star/uri/UriReferenceFactory.hpp>
 #include <com/sun/star/util/MeasureUnit.hpp>
 #include <comphelper/processfactory.hxx>
-#include <comphelper/configurationhelper.hxx>
 #include <xmloff/attrlist.hxx>
 #include <xmloff/nmspmap.hxx>
 #include <xmloff/xmluconv.hxx>
@@ -130,8 +128,6 @@ const sal_Char s_grddl_xsl[] = "http://FIXME";
 
 #define XML_USEPRETTYPRINTING       "UsePrettyPrinting"
 
-#define C2U(cChar) OUString( RTL_CONSTASCII_USTRINGPARAM(cChar) )
-
 struct XMLServiceMapEntry_Impl
 {
     const sal_Char *sModelService;
@@ -438,14 +434,10 @@ void SvXMLExport::_InitCtor()
     // cl: but only if we do export to current oasis format, old openoffice format *must* always be compatible
     if( (getExportFlags() & EXPORT_OASIS) != 0 )
     {
-        sal_Bool bTemp = sal_True;
-        if ( ::comphelper::ConfigurationHelper::readDirectKey(
-                getServiceFactory(),
-                C2U("org.openoffice.Office.Common/"), C2U("Save/Document"), C2U("SaveBackwardCompatibleODF"),
-                ::comphelper::ConfigurationHelper::E_READONLY ) >>= bTemp )
-        {
-            mpImpl->mbSaveBackwardCompatibleODF = bTemp;
-        }
+        mpImpl->mbSaveBackwardCompatibleODF =
+            officecfg::Office::Common::Save::Document::
+            SaveBackwardCompatibleODF::get(
+                mpImpl->mxComponentContext);
     }
 }
 


More information about the Libreoffice-commits mailing list