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

Caolán McNamara caolan at kemper.freedesktop.org
Tue Oct 12 07:36:57 PDT 2010


 binfilter/bf_svtools/source/config/svt_pathoptions.cxx |    2 -
 binfilter/bf_svtools/source/config/svt_useroptions.cxx |    2 -
 binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx    |   29 +++++++----------
 filter/source/pdf/pdfexport.cxx                        |   21 +++++-------
 4 files changed, 24 insertions(+), 30 deletions(-)

New commits:
commit 93da963bf61cb16c908fe3cde68879fdabe9e028
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 11 15:20:37 2010 +0100

    #i112786# make ConfigManager a well-behaved singleton

diff --git a/binfilter/bf_svtools/source/config/svt_pathoptions.cxx b/binfilter/bf_svtools/source/config/svt_pathoptions.cxx
index 29b96f6..1e01376 100644
--- a/binfilter/bf_svtools/source/config/svt_pathoptions.cxx
+++ b/binfilter/bf_svtools/source/config/svt_pathoptions.cxx
@@ -522,7 +522,7 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() :
     }
 
     // Set language type!
-    Any aLocale = ConfigManager::GetConfigManager()->GetDirectConfigProperty( ConfigManager::LOCALE );
+    Any aLocale = ConfigManager::GetConfigManager().GetDirectConfigProperty( ConfigManager::LOCALE );
     OUString aLocaleStr;
     if ( aLocale >>= aLocaleStr )
     {
diff --git a/binfilter/bf_svtools/source/config/svt_useroptions.cxx b/binfilter/bf_svtools/source/config/svt_useroptions.cxx
index 5cdf7ff..ed67f53 100644
--- a/binfilter/bf_svtools/source/config/svt_useroptions.cxx
+++ b/binfilter/bf_svtools/source/config/svt_useroptions.cxx
@@ -215,7 +215,7 @@ SvtUserOptions_Impl::SvtUserOptions_Impl() :
     InitUserPropertyNames();
     EnableNotification( PropertyNames::get() );
     Load();
-    Any aAny = ConfigManager::GetConfigManager()->GetDirectConfigProperty( ConfigManager::LOCALE );
+    Any aAny = ConfigManager::GetConfigManager().GetDirectConfigProperty( ConfigManager::LOCALE );
     OUString aLocale;
     if ( aAny >>= aLocale )
         m_aLocale = String( aLocale );
diff --git a/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx b/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx
index 00d4d74..280f727 100644
--- a/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx
+++ b/binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx
@@ -221,22 +221,19 @@ rtl::OUString lcl_GetProductName()
     //  get the correct product name from the configuration
 
     ::rtl::OUStringBuffer aName;
-    utl::ConfigManager* pMgr = utl::ConfigManager::GetConfigManager();
-    if (pMgr)
-    {
-        ::rtl::OUString aValue;
-        uno::Any aAny = pMgr->GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME);
-        if ( (aAny >>= aValue) && aValue.getLength() )
-            aName.append( aValue ).append( (sal_Unicode)' ' );
-
-        aAny = pMgr->GetDirectConfigProperty(utl::ConfigManager::PRODUCTVERSION);
-        if ( (aAny >>= aValue) && aValue.getLength() )
-            aName.append( aValue ).append( (sal_Unicode)' ' );
-
-        aAny = pMgr->GetDirectConfigProperty(utl::ConfigManager::PRODUCTEXTENSION);
-        if ( (aAny >>= aValue) && aValue.getLength() )
-            aName.append( aValue ).append( (sal_Unicode)' ' );
-    }
+    utl::ConfigManager& rMgr = utl::ConfigManager::GetConfigManager();
+    ::rtl::OUString aValue;
+    uno::Any aAny = rMgr.GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME);
+    if ( (aAny >>= aValue) && aValue.getLength() )
+        aName.append( aValue ).append( (sal_Unicode)' ' );
+
+    aAny = rMgr.GetDirectConfigProperty(utl::ConfigManager::PRODUCTVERSION);
+    if ( (aAny >>= aValue) && aValue.getLength() )
+        aName.append( aValue ).append( (sal_Unicode)' ' );
+
+    aAny = rMgr.GetDirectConfigProperty(utl::ConfigManager::PRODUCTEXTENSION);
+    if ( (aAny >>= aValue) && aValue.getLength() )
+        aName.append( aValue ).append( (sal_Unicode)' ' );
     aName.append( (sal_Unicode)'(' );
     aName.appendAscii( TOOLS_INETDEF_OS );
     aName.append( (sal_Unicode)')' );
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 57777fe..c680db9 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -759,18 +759,15 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
             }
             // getting the string for the producer
             String aProducer;
-            ::utl::ConfigManager* pMgr = ::utl::ConfigManager::GetConfigManager();
-            if ( pMgr )
-            {
-                Any aProductName = pMgr->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
-                ::rtl::OUString sProductName;
-                aProductName >>= sProductName;
-                aProducer = sProductName;
-                aProductName = pMgr->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
-                aProductName >>= sProductName;
-                aProducer.AppendAscii(" ");
-                aProducer += String( sProductName );
-            }
+            ::utl::ConfigManager& rMgr = ::utl::ConfigManager::GetConfigManager();
+            Any aProductName = rMgr.GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
+            ::rtl::OUString sProductName;
+            aProductName >>= sProductName;
+            aProducer = sProductName;
+            aProductName = rMgr.GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
+            aProductName >>= sProductName;
+            aProducer.AppendAscii(" ");
+            aProducer += String( sProductName );
             aDocInfo.Producer = aProducer;
             aDocInfo.Creator = aCreator;
 


More information about the Libreoffice-commits mailing list