summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-11-11 22:48:37 +0100
committerStephan Bergmann <sbergman@redhat.com>2011-11-11 22:49:21 +0100
commitc1758889cbd5e8e4afb1044425c908715eb3e1cd (patch)
treeff58b017da12c009f0b17c067787d1dbbd52eb7a /sw
parent4ffcc73fa25f174c2d1e161f02cce2d7afc15e3b (diff)
Heavily simplified utl::ConfigManager.
Diffstat (limited to 'sw')
-rw-r--r--sw/CppunitTest_sw_filters_test.mk2
-rw-r--r--sw/CppunitTest_sw_swdoc_test.mk2
-rw-r--r--sw/prj/build.lst2
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx4
-rw-r--r--sw/source/ui/config/optcomp.cxx30
-rw-r--r--sw/source/ui/config/optload.cxx27
-rw-r--r--sw/source/ui/misc/outline.cxx18
7 files changed, 27 insertions, 58 deletions
diff --git a/sw/CppunitTest_sw_filters_test.mk b/sw/CppunitTest_sw_filters_test.mk
index 500405fd6206..4aa77a4c7ecb 100644
--- a/sw/CppunitTest_sw_filters_test.mk
+++ b/sw/CppunitTest_sw_filters_test.mk
@@ -96,6 +96,7 @@ $(eval $(call gb_CppunitTest_add_components,sw_filters_test,\
))
$(eval $(call gb_CppunitTest_add_old_components,sw_filters_test,\
+ configmgr \
ucb1 \
ucpfile1 \
))
@@ -103,6 +104,7 @@ $(eval $(call gb_CppunitTest_add_old_components,sw_filters_test,\
$(eval $(call gb_CppunitTest_set_args,sw_filters_test,\
--headless \
--protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+ "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry)" \
))
# we need to explicitly depend on library msword because it is not implied
diff --git a/sw/CppunitTest_sw_swdoc_test.mk b/sw/CppunitTest_sw_swdoc_test.mk
index 029088942fd9..f3f44bbf736a 100644
--- a/sw/CppunitTest_sw_swdoc_test.mk
+++ b/sw/CppunitTest_sw_swdoc_test.mk
@@ -104,6 +104,7 @@ $(eval $(call gb_CppunitTest_add_components,sw_swdoc_test,\
))
$(eval $(call gb_CppunitTest_add_old_components,sw_swdoc_test,\
+ configmgr \
ucb1 \
ucpfile1 \
))
@@ -114,6 +115,7 @@ $(call gb_CppunitTest_get_target,sw_swdoc_test) : \
$(eval $(call gb_CppunitTest_set_args,sw_swdoc_test,\
--headless \
--protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+ "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry)" \
))
# we need to explicitly depend on the sw resource files needed at unit-test
diff --git a/sw/prj/build.lst b/sw/prj/build.lst
index 75c602e315ab..e2d759dceb36 100644
--- a/sw/prj/build.lst
+++ b/sw/prj/build.lst
@@ -1,2 +1,2 @@
-sw sw : filter TRANSLATIONS:translations connectivity writerperfect vbahelper svx stoc writerfilter unoxml fileaccess package forms toolkit dbaccess comphelper LIBXSLT:libxslt test NULL
+sw sw : filter TRANSLATIONS:translations configmgr connectivity writerperfect vbahelper svx stoc writerfilter unoxml fileaccess package forms toolkit dbaccess comphelper LIBXSLT:libxslt test NULL
sw sw\prj nmake - all sw_prj NULL
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index efc597d648ff..a36f233070ae 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -441,9 +441,7 @@ void RtfExport::WriteInfo()
}
Strm() << '{' << OOO_STRING_SVTOOLS_RTF_COMMENT << " ";
- OUString sProduct;
- utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct;
- Strm() << OUStringToOString( sProduct, eCurrentEncoding).getStr() << "}{" << OOO_STRING_SVTOOLS_RTF_VERN;
+ Strm() << OUStringToOString( utl::ConfigManager::getProductName(), eCurrentEncoding).getStr() << "}{" << OOO_STRING_SVTOOLS_RTF_VERN;
OutULong( SUPD*10 ) << '}';
Strm() << '}';
}
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 9b4de6e12634..acd941f902aa 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -191,24 +191,18 @@ void SwCompatibilityOptPage::ReplaceFormatName( String& rEntry )
static const String sOpenOfficeName = String::CreateFromAscii("OpenOffice.org");
static const String sAsianName = String::CreateFromAscii("StarSuite");
- Any aAny = ::utl::ConfigManager::
- GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
- rtl::OUString sTmp;
- if ( aAny >>= sTmp )
- {
- String sFormatName = sTmp;
- String sFormatVersion;
- bool bOpenOffice = ( sOpenOfficeName == sFormatName );
- if ( bOpenOffice )
- sFormatVersion = String::CreateFromAscii("1.1");
- else
- sFormatVersion = String::CreateFromAscii("6.0/7");
- if ( !bOpenOffice && ( sAsianName != sFormatName ) )
- sFormatName = String::CreateFromAscii("StarOffice");
-
- rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATNAME"), sFormatName );
- rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATVERSION"), sFormatVersion );
- }
+ String sFormatName( utl::ConfigManager::getProductName() );
+ String sFormatVersion;
+ bool bOpenOffice = ( sOpenOfficeName == sFormatName );
+ if ( bOpenOffice )
+ sFormatVersion = String::CreateFromAscii("1.1");
+ else
+ sFormatVersion = String::CreateFromAscii("6.0/7");
+ if ( !bOpenOffice && ( sAsianName != sFormatName ) )
+ sFormatName = String::CreateFromAscii("StarOffice");
+
+ rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATNAME"), sFormatName );
+ rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATVERSION"), sFormatVersion );
}
sal_uLong convertBools2Ulong_Impl
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index c95cf60d6d38..2729c3ad0eef 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -554,29 +554,10 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet)
SetOptions(nPos++, GRAPHIC_CAP);
// get Productname and -version
- String sComplete, sWithoutVersion;
- ::rtl::OUString sTemp;
- uno::Any aAny =
- ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
- if ( aAny >>= sTemp )
- {
- sComplete = sTemp;
- sWithoutVersion = sTemp;
- aAny = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
- if ( !( aAny >>= sTemp ) )
- {
- OSL_FAIL("Couldn't get PRODUCTVERSION variable" );
- }
- else
- {
- sComplete += ' ';
- sComplete += String( sTemp );
- }
- }
- else
- {
- OSL_FAIL("Couldn't get PRODUCTNAME variable" );
- }
+ rtl::OUString sWithoutVersion( utl::ConfigManager::getProductName() );
+ rtl::OUString sComplete(
+ sWithoutVersion + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) +
+ utl::ConfigManager::getProductVersion() );
SvObjectServerList aObjS;
aObjS.FillInsertObjects();
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index d4e734ed53fd..01a55219d7e9 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -1153,19 +1153,11 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
nPreNum++;
}
pVDev->SetFont(aStdFont);
-
- // Changed as per BugID 79541 Branding/Configuration
- uno::Any MyAny = ::utl::ConfigManager::GetConfigManager().
- GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
- ::rtl::OUString aProductName;
-
- MyAny >>= aProductName;
- String sMsg(C2S("%PRODUCTNAME"));
- sMsg.SearchAndReplaceAscii( "%PRODUCTNAME" , aProductName );
-
- if(pOutlineNames)
- sMsg = pOutlineNames[nLevel];
- pVDev->DrawText( Point(nXStart + nTextOffset, nYStart), sMsg );
+ pVDev->DrawText(
+ Point(nXStart + nTextOffset, nYStart),
+ (pOutlineNames == 0
+ ? utl::ConfigManager::getProductName()
+ : rtl::OUString(pOutlineNames[nLevel])));
}
}
}