diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-10-11 15:20:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-10-11 15:20:37 +0100 |
commit | 93da963bf61cb16c908fe3cde68879fdabe9e028 (patch) | |
tree | 1969f4bef17d7066182bf4db72eb08b41dad44b7 | |
parent | c465d663ee7a13888a49a8bf89bbe24407123abc (diff) |
#i112786# make ConfigManager a well-behaved singleton
-rw-r--r-- | binfilter/bf_svtools/source/config/svt_pathoptions.cxx | 2 | ||||
-rw-r--r-- | binfilter/bf_svtools/source/config/svt_useroptions.cxx | 2 | ||||
-rw-r--r-- | binfilter/bf_xmloff/source/meta/xmloff_xmlmetae.cxx | 29 | ||||
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 21 |
4 files changed, 24 insertions, 30 deletions
diff --git a/binfilter/bf_svtools/source/config/svt_pathoptions.cxx b/binfilter/bf_svtools/source/config/svt_pathoptions.cxx index 29b96f633..1e01376bc 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 5cdf7ff87..ed67f5326 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 00d4d7495..280f727a0 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 57777fecc..c680db965 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; |