From c1758889cbd5e8e4afb1044425c908715eb3e1cd Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 11 Nov 2011 22:48:37 +0100 Subject: Heavily simplified utl::ConfigManager. --- svtools/CppunitTest_svtools_filters_test.mk | 5 +++++ svtools/prj/build.lst | 2 +- svtools/source/config/itemholder2.cxx | 1 - svtools/source/dialogs/insdlg.cxx | 24 ++++++------------------ svtools/source/filter/FilterConfigItem.cxx | 5 +++-- 5 files changed, 15 insertions(+), 22 deletions(-) (limited to 'svtools') diff --git a/svtools/CppunitTest_svtools_filters_test.mk b/svtools/CppunitTest_svtools_filters_test.mk index 3ccbd5d06c30..48c39f461b01 100644 --- a/svtools/CppunitTest_svtools_filters_test.mk +++ b/svtools/CppunitTest_svtools_filters_test.mk @@ -63,9 +63,14 @@ $(eval $(call gb_CppunitTest_add_type_rdbs,svtools_filters_test,\ types \ )) +$(eval $(call gb_CppunitTest_add_old_components,svtools_filters_test,\ + configmgr \ +)) + $(eval $(call gb_CppunitTest_set_args,svtools_filters_test,\ --headless \ --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \ + "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry)" \ )) # vim: set noet sw=4 ts=4: diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst index d18c9f9df2a2..b18ec977b997 100644 --- a/svtools/prj/build.lst +++ b/svtools/prj/build.lst @@ -1,2 +1,2 @@ -st svtools : TRANSLATIONS:translations svl offapi toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal salhelper sot jvmfwk LIBXSLT:libxslt ure test NULL +st svtools : TRANSLATIONS:translations svl offapi toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper configmgr sal salhelper sot jvmfwk LIBXSLT:libxslt ure test NULL st svtools\prj nmake - all st_prj NULL diff --git a/svtools/source/config/itemholder2.cxx b/svtools/source/config/itemholder2.cxx index 74766fa2e534..dadb1d6f75ec 100644 --- a/svtools/source/config/itemholder2.cxx +++ b/svtools/source/config/itemholder2.cxx @@ -71,7 +71,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/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx index 7d6bcb9187cf..79e5a6f934fc 100644 --- a/svtools/source/dialogs/insdlg.cxx +++ b/svtools/source/dialogs/insdlg.cxx @@ -157,22 +157,6 @@ void SvObjectServerList::FillInsertObjects() ::rtl::OUString aStringProductVersion( RTL_CONSTASCII_USTRINGPARAM( "%PRODUCTVERSION" ) ); sal_Int32 nStringProductVersionLength = aStringProductVersion.getLength(); - // TODO/LATER: Do the request only once ( needs incompatible change ) - ::rtl::OUString aProductName; - ::rtl::OUString aProductVersion; - uno::Any aProperty = - ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); - if ( !( aProperty >>= aProductName ) ) - { - OSL_FAIL( "Coudn't get PRODUCTNAME variable!\n" ); - aProductName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice" ) ); - } - aProperty = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION ); - if ( !( aProperty >>= aProductVersion ) ) - { - OSL_FAIL( "Coudn't get PRODUCTVERSION variable!\n" ); - } - for( nInd = 0; nInd < seqNames.getLength(); nInd++ ) { uno::Reference< container::XNameAccess > xEntry ; @@ -190,7 +174,9 @@ void SvObjectServerList::FillInsertObjects() sal_Int32 nIndex = aUIName.indexOf( aStringProductName ); while( nIndex != -1 ) { - aUIName = aUIName.replaceAt( nIndex, nStringProductNameLength, aProductName ); + aUIName = aUIName.replaceAt( + nIndex, nStringProductNameLength, + utl::ConfigManager::getProductName() ); nIndex = aUIName.indexOf( aStringProductName ); } @@ -198,7 +184,9 @@ void SvObjectServerList::FillInsertObjects() nIndex = aUIName.indexOf( aStringProductVersion ); while( nIndex != -1 ) { - aUIName = aUIName.replaceAt( nIndex, nStringProductVersionLength, aProductVersion ); + aUIName = aUIName.replaceAt( + nIndex, nStringProductVersionLength, + utl::ConfigManager::getProductVersion() ); nIndex = aUIName.indexOf( aStringProductVersion ); } } diff --git a/svtools/source/filter/FilterConfigItem.cxx b/svtools/source/filter/FilterConfigItem.cxx index bbe40a0604c0..c6dbc5197ce8 100644 --- a/svtools/source/filter/FilterConfigItem.cxx +++ b/svtools/source/filter/FilterConfigItem.cxx @@ -121,8 +121,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( @@ -131,6 +129,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; -- cgit