[Libreoffice-commits] .: binfilter/bf_svtools binfilter/bf_xmloff

Stephan Bergmann sbergmann at kemper.freedesktop.org
Fri Nov 11 13:49:58 PST 2011


 binfilter/bf_svtools/source/config/svt_defaultoptions.cxx              |    1 
 binfilter/bf_svtools/source/config/svt_itemholder1.cxx                 |    1 
 binfilter/bf_svtools/source/config/svt_itemholder2.cxx                 |    1 
 binfilter/bf_svtools/source/config/svt_pathoptions.cxx                 |   21 ++--------
 binfilter/bf_svtools/source/config/svt_useroptions.cxx                 |   11 -----
 binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx |    5 +-
 binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx                    |   14 ++----
 7 files changed, 14 insertions(+), 40 deletions(-)

New commits:
commit 533e3c648db45ba7c7804928a5759e2b60fdb9a2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 11 22:48:55 2011 +0100

    Heavily simplified utl::ConfigManager.

diff --git a/binfilter/bf_svtools/source/config/svt_defaultoptions.cxx b/binfilter/bf_svtools/source/config/svt_defaultoptions.cxx
index 4082d8b..b101b63 100644
--- a/binfilter/bf_svtools/source/config/svt_defaultoptions.cxx
+++ b/binfilter/bf_svtools/source/config/svt_defaultoptions.cxx
@@ -200,7 +200,6 @@ Sequence< OUString > GetDefaultPropertyNames()
 
 SvtDefaultOptions_Impl::SvtDefaultOptions_Impl() : ConfigItem( ASCII_STR("Office.Common/Path/Default") )
 {
-    /*ConfigManager* pCfgMgr =*/ ConfigManager::GetConfigManager();
     Sequence< OUString > aNames = GetDefaultPropertyNames();
     Sequence< Any > aValues = GetProperties( aNames );
     EnableNotification( aNames );
diff --git a/binfilter/bf_svtools/source/config/svt_itemholder1.cxx b/binfilter/bf_svtools/source/config/svt_itemholder1.cxx
index fa18956..68287e7 100644
--- a/binfilter/bf_svtools/source/config/svt_itemholder1.cxx
+++ b/binfilter/bf_svtools/source/config/svt_itemholder1.cxx
@@ -94,7 +94,6 @@ ItemHolder1::ItemHolder1()
         if (xCfg.is())
             xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this));
     }
-// #i37892  got errorhandling from   ConfigManager::GetConfigurationProvider()
 #ifdef DBG_UTIL
     catch(css::uno::Exception& rEx)
     {
diff --git a/binfilter/bf_svtools/source/config/svt_itemholder2.cxx b/binfilter/bf_svtools/source/config/svt_itemholder2.cxx
index 1aa981f..bdbe347 100644
--- a/binfilter/bf_svtools/source/config/svt_itemholder2.cxx
+++ b/binfilter/bf_svtools/source/config/svt_itemholder2.cxx
@@ -78,7 +78,6 @@ ItemHolder2::ItemHolder2()
         if (xCfg.is())
             xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this));
     }
-// #i37892  got errorhandling from   ConfigManager::GetConfigurationProvider()
     catch(css::uno::RuntimeException& rREx)
     {
         throw rREx;
diff --git a/binfilter/bf_svtools/source/config/svt_pathoptions.cxx b/binfilter/bf_svtools/source/config/svt_pathoptions.cxx
index 54ea6ae..1c86baf 100644
--- a/binfilter/bf_svtools/source/config/svt_pathoptions.cxx
+++ b/binfilter/bf_svtools/source/config/svt_pathoptions.cxx
@@ -512,22 +512,11 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() :
     }
 
     // Set language type!
-    Any aLocale = ConfigManager::GetConfigManager().GetDirectConfigProperty( ConfigManager::LOCALE );
-    OUString aLocaleStr;
-    if ( aLocale >>= aLocaleStr )
-    {
-        sal_Int32 nIndex = 0;
-        m_aLocale.Language = aLocaleStr.getToken(0, '-', nIndex );
-        m_aLocale.Country = aLocaleStr.getToken(0, '-', nIndex );
-        m_aLocale.Variant = aLocaleStr.getToken(0, '-', nIndex );
-    }
-    else
-    {
-        DBG_ERRORFILE( "wrong any type" );
-        m_aLocale.Language = OStringToOUString(OString("en"), RTL_TEXTENCODING_UTF8);
-        m_aLocale.Country =  OStringToOUString(OString("US"), RTL_TEXTENCODING_UTF8);
-        m_aLocale.Variant =  OStringToOUString(OString(""), RTL_TEXTENCODING_UTF8);
-    }
+    OUString aLocaleStr( ConfigManager::getLocale() );
+    sal_Int32 nIndex = 0;
+    m_aLocale.Language = aLocaleStr.getToken(0, '-', nIndex );
+    m_aLocale.Country = aLocaleStr.getToken(0, '-', nIndex );
+    m_aLocale.Variant = aLocaleStr.getToken(0, '-', nIndex );
 }
 
 // -----------------------------------------------------------------------
diff --git a/binfilter/bf_svtools/source/config/svt_useroptions.cxx b/binfilter/bf_svtools/source/config/svt_useroptions.cxx
index d358f86..00f870a 100644
--- a/binfilter/bf_svtools/source/config/svt_useroptions.cxx
+++ b/binfilter/bf_svtools/source/config/svt_useroptions.cxx
@@ -28,7 +28,6 @@
 
 #include <bf_svtools/useroptions.hxx>
 
-#include <unotools/configmgr.hxx>
 #include <tools/debug.hxx>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
@@ -73,7 +72,6 @@ private:
 
     String          m_aEmptyString;
     String          m_aFullName;
-    String          m_aLocale;
 
     sal_Bool        m_bIsROCompany;
     sal_Bool        m_bIsROFirstName;
@@ -128,7 +126,6 @@ public:
     const String&   GetApartment() const { return m_aApartment; }
 
     const String&   GetFullName();
-    const String&   GetLocale() const { return m_aLocale; }
 };
 
 // global ----------------------------------------------------------------
@@ -217,14 +214,6 @@ SvtUserOptions_Impl::SvtUserOptions_Impl() :
     InitUserPropertyNames();
     EnableNotification( PropertyNames::get() );
     Load();
-    Any aAny = ConfigManager::GetConfigManager().GetDirectConfigProperty( ConfigManager::LOCALE );
-    OUString aLocale;
-    if ( aAny >>= aLocale )
-        m_aLocale = String( aLocale );
-    else
-    {
-        DBG_ERRORFILE( "SvtUserOptions_Impl::SvtUserOptions_Impl(): no locale found" );
-    }
 }
 // -----------------------------------------------------------------------
 
diff --git a/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx b/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx
index 79df6dc..7f355cb 100644
--- a/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx
+++ b/binfilter/bf_svtools/source/filter.vcl/filter/svt_FilterConfigItem.cxx
@@ -122,8 +122,6 @@ void FilterConfigItem::ImpInitTree( const String& rSubTree )
 {
     bModified = sal_False;
 
-    OUString sTree( ConfigManager::GetConfigBaseURL() );
-    sTree += rSubTree;
     Reference< XMultiServiceFactory > xSMGR = getProcessServiceFactory();   // get global uno service manager
 
     Reference< XMultiServiceFactory > xCfgProv(
@@ -132,6 +130,9 @@ void FilterConfigItem::ImpInitTree( const String& rSubTree )
 
     if ( xCfgProv.is() )
     {
+        OUString sTree(
+            OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.")) +
+            rSubTree);
         if ( ImpIsTreeAvailable( xCfgProv, String( sTree ) ) )
         {
             Any aAny;
diff --git a/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx b/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx
index ec661a6..b53c8e8 100644
--- a/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx
+++ b/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx
@@ -223,20 +223,18 @@ rtl::OUString lcl_GetProductName()
     //  get the correct product name from the configuration
 
     ::rtl::OUStringBuffer aName;
-    utl::ConfigManager& rMgr = utl::ConfigManager::GetConfigManager();
-    ::rtl::OUString aValue;
-    uno::Any aAny = rMgr.GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME);
     ::rtl::OUString os( RTL_CONSTASCII_USTRINGPARAM("$_OS") );
     ::rtl::Bootstrap::expandMacros(os);
-    if ( (aAny >>= aValue) && aValue.getLength() )
+    rtl::OUString aValue( utl::ConfigManager::getProductName() );
+    if ( !aValue.isEmpty() )
         aName.append( aValue ).append( (sal_Unicode)' ' );
 
-    aAny = rMgr.GetDirectConfigProperty(utl::ConfigManager::PRODUCTVERSION);
-    if ( (aAny >>= aValue) && aValue.getLength() )
+    aValue = utl::ConfigManager::getProductVersion();
+    if ( !aValue.isEmpty() )
         aName.append( aValue ).append( (sal_Unicode)' ' );
 
-    aAny = rMgr.GetDirectConfigProperty(utl::ConfigManager::PRODUCTEXTENSION);
-    if ( (aAny >>= aValue) && aValue.getLength() )
+    aValue = utl::ConfigManager::getProductExtension();
+    if ( !aValue.isEmpty() )
         aName.append( aValue ).append( (sal_Unicode)' ' );
     aName.append( (sal_Unicode)'(' );
     aName.append( os );


More information about the Libreoffice-commits mailing list