[Libreoffice-commits] .: svl/inc svl/qa svl/source

Olivier Hallot ohallot at kemper.freedesktop.org
Tue Jul 3 17:21:30 PDT 2012


 svl/inc/svl/style.hxx                 |    2 
 svl/qa/unit/svl.cxx                   |    6 -
 svl/qa/unit/test_URIHelper.cxx        |   16 +--
 svl/qa/unit/test_lngmisc.cxx          |   36 ++++----
 svl/source/config/asiancfg.cxx        |   26 +----
 svl/source/config/cjkoptions.cxx      |   21 ++--
 svl/source/config/ctloptions.cxx      |   15 +--
 svl/source/config/languageoptions.cxx |    4 
 svl/source/items/macitem.cxx          |    6 -
 svl/source/misc/inettype.cxx          |    4 
 svl/source/misc/lockfilecommon.cxx    |    4 
 svl/source/misc/urihelper.cxx         |   26 +----
 svl/source/numbers/zforfind.cxx       |    8 -
 svl/source/numbers/zforlist.cxx       |  148 +++++++++++++---------------------
 svl/source/numbers/zformat.cxx        |   16 +--
 15 files changed, 136 insertions(+), 202 deletions(-)

New commits:
commit c6c99966cd4515b574e9cd21e89954dabf56009a
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date:   Tue Jul 3 21:18:15 2012 -0300

    Get rid of RTL_CONSTASCII_USTRINGPARAM in svl/
    
    Change-Id: I64f3f966011bf07a2ee0c7327feb4a46df595210

diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx
index 0fb3e8e..34edeb5 100644
--- a/svl/inc/svl/style.hxx
+++ b/svl/inc/svl/style.hxx
@@ -276,7 +276,7 @@ public:
 
 protected:
     SfxStyleSheet() // do not use! needed by MSVC at compile time to satisfy ImplInheritanceHelper2
-        : SfxStyleSheetBase(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dummy")),
+        : SfxStyleSheetBase(rtl::OUString("dummy"),
             NULL, SFX_STYLE_FAMILY_ALL, 0)
     {
         assert(false);
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index b051d1f..d0cab79 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -267,21 +267,21 @@ void Test::testNumberFormat()
     sal_uInt32 nKey;
     OUString aCode;
     // Thai date format (implicit locale).
-    aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[$-1070000]d/mm/yyyy;@"));
+    aCode = "[$-1070000]d/mm/yyyy;@";
     if (!aFormatter.PutEntry(aCode, nPos, nType, nKey))
     {
         CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[$-1070000]d/mm/yyyy;@'", false);
     }
 
     // Thai date format (explicit locale)
-    aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[$-107041E]d/mm/yyyy;@"));
+    aCode = "[$-107041E]d/mm/yyyy;@";
     if (!aFormatter.PutEntry(aCode, nPos, nType, nKey))
     {
         CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[$-107041E]d/mm/yyyy;@'", false);
     }
 
     // Thai date format (using buddhist calendar type).
-    aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[~buddhist]D MMMM YYYY"));
+    aCode = "[~buddhist]D MMMM YYYY";
     if (!aFormatter.PutEntry(aCode, nPos, nType, nKey))
     {
         CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[~buddhist]D MMMM YYYY'", false);
diff --git a/svl/qa/unit/test_URIHelper.cxx b/svl/qa/unit/test_URIHelper.cxx
index e91cb20..9cb810b 100644
--- a/svl/qa/unit/test_URIHelper.cxx
+++ b/svl/qa/unit/test_URIHelper.cxx
@@ -163,7 +163,7 @@ css::uno::Any Content::execute(
     }
     switch (c) {
     case '1':
-        uri += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+        uri += "/";
         break;
     case '2':
         if (uri.getLength() > 0 && uri[uri.getLength() - 1] == '/') {
@@ -231,18 +231,16 @@ void Test::finish() {
 
 void Test::testNormalizedMakeRelative() {
     css::uno::Sequence< css::uno::Any > args(2);
-    args[0] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local"));
-    args[1] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office"));
+    args[0] <<= rtl::OUString("Local");
+    args[1] <<= rtl::OUString("Office");
     css::uno::Reference< css::ucb::XContentProviderManager >(
         (css::uno::Reference< css::lang::XMultiComponentFactory >(
             m_context->getServiceManager(), css::uno::UNO_QUERY_THROW)->
          createInstanceWithArgumentsAndContext(
-             rtl::OUString(
-                 RTL_CONSTASCII_USTRINGPARAM(
-                     "com.sun.star.ucb.UniversalContentBroker")),
+             rtl::OUString("com.sun.star.ucb.UniversalContentBroker"),
              args, m_context)),
         css::uno::UNO_QUERY_THROW)->registerContentProvider(
-            new Provider, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test")),
+            new Provider, rtl::OUString("test"),
             true);
     struct Data {
         char const * base;
@@ -402,9 +400,7 @@ void Test::testFindFirstURLInText() {
     CharClass charClass(
         css::uno::Reference< css::lang::XMultiServiceFactory >(
             m_context->getServiceManager(), css::uno::UNO_QUERY_THROW),
-        com::sun::star::lang::Locale(
-            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")),
-            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US")), rtl::OUString()));
+        com::sun::star::lang::Locale("en", "US", ""));
     for (std::size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i) {
         rtl::OUString input(rtl::OUString::createFromAscii(tests[i].input));
         xub_StrLen begin = 0;
diff --git a/svl/qa/unit/test_lngmisc.cxx b/svl/qa/unit/test_lngmisc.cxx
index ab2f470..febc64b 100644
--- a/svl/qa/unit/test_lngmisc.cxx
+++ b/svl/qa/unit/test_lngmisc.cxx
@@ -58,8 +58,8 @@ namespace
 
   void LngMiscTest::testRemoveHyphens()
   {
-    ::rtl::OUString str1(RTL_CONSTASCII_USTRINGPARAM(""));
-    ::rtl::OUString str2(RTL_CONSTASCII_USTRINGPARAM("a-b--c---"));
+    ::rtl::OUString str1("");
+    ::rtl::OUString str2("a-b--c---");
 
     ::rtl::OUStringBuffer str3Buf;
     str3Buf.append(SVT_SOFT_HYPHEN);
@@ -67,7 +67,7 @@ namespace
     str3Buf.append(SVT_HARD_HYPHEN);
     ::rtl::OUString str3(str3Buf.makeStringAndClear());
 
-    ::rtl::OUString str4(RTL_CONSTASCII_USTRINGPARAM("asdf"));
+    ::rtl::OUString str4("asdf");
 
     bool bModified = linguistic::RemoveHyphens(str1);
     CPPUNIT_ASSERT(!bModified);
@@ -89,9 +89,9 @@ namespace
 
   void LngMiscTest::testRemoveControlChars()
   {
-    ::rtl::OUString str1(RTL_CONSTASCII_USTRINGPARAM(""));
-    ::rtl::OUString str2(RTL_CONSTASCII_USTRINGPARAM("asdf"));
-    ::rtl::OUString str3(RTL_CONSTASCII_USTRINGPARAM("asdf\nasdf"));
+    ::rtl::OUString str1("");
+    ::rtl::OUString str2("asdf");
+    ::rtl::OUString str3("asdf\nasdf");
 
     ::rtl::OUStringBuffer str4Buf(33);
     str4Buf.setLength(33);
@@ -120,9 +120,9 @@ namespace
 
   void LngMiscTest::testReplaceControlChars()
   {
-    ::rtl::OUString str1(RTL_CONSTASCII_USTRINGPARAM(""));
-    ::rtl::OUString str2(RTL_CONSTASCII_USTRINGPARAM("asdf"));
-    ::rtl::OUString str3(RTL_CONSTASCII_USTRINGPARAM("asdf\nasdf"));
+    ::rtl::OUString str1("");
+    ::rtl::OUString str2("asdf");
+    ::rtl::OUString str3("asdf\nasdf");
 
     ::rtl::OUStringBuffer str4Buf(33);
     str4Buf.setLength(33);
@@ -153,14 +153,14 @@ namespace
 
   void LngMiscTest::testGetThesaurusReplaceText()
   {
-    const ::rtl::OUString str1(RTL_CONSTASCII_USTRINGPARAM(""));
-    const ::rtl::OUString str2(RTL_CONSTASCII_USTRINGPARAM("asdf"));
-    const ::rtl::OUString str3(RTL_CONSTASCII_USTRINGPARAM("asdf (abc)"));
-    const ::rtl::OUString str4(RTL_CONSTASCII_USTRINGPARAM("asdf*"));
-    const ::rtl::OUString str5(RTL_CONSTASCII_USTRINGPARAM("asdf * "));
-    const ::rtl::OUString str6(RTL_CONSTASCII_USTRINGPARAM("asdf (abc) *"));
-    const ::rtl::OUString str7(RTL_CONSTASCII_USTRINGPARAM("asdf asdf * (abc)"));
-    const ::rtl::OUString str8(RTL_CONSTASCII_USTRINGPARAM(" * (abc) asdf *"));
+    const ::rtl::OUString str1("");
+    const ::rtl::OUString str2("asdf");
+    const ::rtl::OUString str3("asdf (abc)");
+    const ::rtl::OUString str4("asdf*");
+    const ::rtl::OUString str5("asdf * ");
+    const ::rtl::OUString str6("asdf (abc) *");
+    const ::rtl::OUString str7("asdf asdf * (abc)");
+    const ::rtl::OUString str8(" * (abc) asdf *");
 
     ::rtl::OUString r = linguistic::GetThesaurusReplaceText(str1);
     CPPUNIT_ASSERT(r.isEmpty());
@@ -181,7 +181,7 @@ namespace
     CPPUNIT_ASSERT(r == str2);
 
     r = linguistic::GetThesaurusReplaceText(str7);
-    CPPUNIT_ASSERT(r == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("asdf asdf")));
+    CPPUNIT_ASSERT(r == "asdf asdf");
 
     r = linguistic::GetThesaurusReplaceText(str8);
     CPPUNIT_ASSERT(r.isEmpty());
diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx
index e1181fb..3d51c75 100644
--- a/svl/source/config/asiancfg.cxx
+++ b/svl/source/config/asiancfg.cxx
@@ -146,14 +146,8 @@ bool SvxAsianConfig::GetStartEndChars(
     css::uno::Reference< css::beans::XPropertySet > el(
         v.get< css::uno::Reference< css::beans::XPropertySet > >(),
         css::uno::UNO_SET_THROW);
-    startChars =
-        el->getPropertyValue(
-            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartCharacters"))).
-        get< rtl::OUString >();
-    endChars =
-        el->getPropertyValue(
-            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EndCharacters"))).
-        get< rtl::OUString >();
+    startChars = el->getPropertyValue("StartCharacters").get< rtl::OUString >();
+    endChars = el->getPropertyValue("EndCharacters").get< rtl::OUString >();
     return true;
 }
 
@@ -183,24 +177,16 @@ void SvxAsianConfig::SetStartEndChars(
             css::uno::Reference< css::beans::XPropertySet > el(
                 v.get< css::uno::Reference< css::beans::XPropertySet > >(),
                 css::uno::UNO_SET_THROW);
-            el->setPropertyValue(
-                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartCharacters")),
-                css::uno::makeAny(*startChars));
-            el->setPropertyValue(
-                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EndCharacters")),
-                css::uno::makeAny(*endChars));
+            el->setPropertyValue("StartCharacters", css::uno::makeAny(*startChars));
+            el->setPropertyValue("EndCharacters", css::uno::makeAny(*endChars));
         } else {
             css::uno::Reference< css::beans::XPropertySet > el(
                 (css::uno::Reference< css::lang::XSingleServiceFactory >(
                     set, css::uno::UNO_QUERY_THROW)->
                  createInstance()),
                 css::uno::UNO_QUERY_THROW);
-            el->setPropertyValue(
-                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartCharacters")),
-                css::uno::makeAny(*startChars));
-            el->setPropertyValue(
-                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EndCharacters")),
-                css::uno::makeAny(*endChars));
+            el->setPropertyValue("StartCharacters", css::uno::makeAny(*startChars));
+            el->setPropertyValue("EndCharacters", css::uno::makeAny(*endChars));
             css::uno::Any v2(css::uno::makeAny(el));
             try {
                 set->insertByName(name, v2);
diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx
index 9ba924a..897c9c8 100644
--- a/svl/source/config/cjkoptions.cxx
+++ b/svl/source/config/cjkoptions.cxx
@@ -34,7 +34,6 @@
 using namespace ::com::sun::star::uno;
 using namespace ::rtl;
 
-#define C2U(cChar) OUString(RTL_CONSTASCII_USTRINGPARAM(cChar))
 #define CFG_READONLY_DEFAULT sal_False
 
 class SvtCJKOptions_Impl : public utl::ConfigItem
@@ -92,7 +91,7 @@ namespace
 }
 
 SvtCJKOptions_Impl::SvtCJKOptions_Impl() :
-    utl::ConfigItem(C2U("Office.Common/I18N/CJK")),
+    utl::ConfigItem("Office.Common/I18N/CJK"),
     bIsLoaded(sal_False),
     bCJKFont(sal_True),
     bVerticalText(sal_True),
@@ -157,15 +156,15 @@ void SvtCJKOptions_Impl::Load()
         rPropertyNames.realloc(9);
         OUString* pNames = rPropertyNames.getArray();
 
-        pNames[0] = C2U("CJKFont");
-        pNames[1] = C2U("VerticalText");
-        pNames[2] = C2U("AsianTypography");
-        pNames[3] = C2U("JapaneseFind");
-        pNames[4] = C2U("Ruby");
-        pNames[5] = C2U("ChangeCaseMap");
-        pNames[6] = C2U("DoubleLines");
-        pNames[7] = C2U("EmphasisMarks");
-        pNames[8] = C2U("VerticalCallOut");
+        pNames[0] = "CJKFont";
+        pNames[1] = "VerticalText";
+        pNames[2] = "AsianTypography";
+        pNames[3] = "JapaneseFind";
+        pNames[4] = "Ruby";
+        pNames[5] = "ChangeCaseMap";
+        pNames[6] = "DoubleLines";
+        pNames[7] = "EmphasisMarks";
+        pNames[8] = "VerticalCallOut";
 
         EnableNotification( rPropertyNames );
     }
diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx
index aaed4d4..e7cb760 100644
--- a/svl/source/config/ctloptions.cxx
+++ b/svl/source/config/ctloptions.cxx
@@ -35,7 +35,6 @@
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
-#define ASCII_STR(s)    rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(s) )
 #define CFG_READONLY_DEFAULT    sal_False
 
 // SvtCJKOptions_Impl ----------------------------------------------------------
@@ -114,7 +113,7 @@ sal_Bool SvtCTLOptions_Impl::IsReadOnly(SvtCTLOptions::EOption eOption) const
 //------------------------------------------------------------------------------
 SvtCTLOptions_Impl::SvtCTLOptions_Impl() :
 
-    utl::ConfigItem( ASCII_STR("Office.Common/I18N/CTL") ),
+    utl::ConfigItem("Office.Common/I18N/CTL"),
 
     m_bIsLoaded             ( sal_False ),
     m_bCTLFontEnabled       ( sal_False ),
@@ -242,12 +241,12 @@ void SvtCTLOptions_Impl::Load()
     {
         rPropertyNames.realloc(6);
         rtl::OUString* pNames = rPropertyNames.getArray();
-        pNames[0] = ASCII_STR("CTLFont");
-        pNames[1] = ASCII_STR("CTLSequenceChecking");
-        pNames[2] = ASCII_STR("CTLCursorMovement");
-        pNames[3] = ASCII_STR("CTLTextNumerals");
-        pNames[4] = ASCII_STR("CTLSequenceCheckingRestricted");
-        pNames[5] = ASCII_STR("CTLSequenceCheckingTypeAndReplace");
+        pNames[0] = "CTLFont";
+        pNames[1] = "CTLSequenceChecking";
+        pNames[2] = "CTLCursorMovement";
+        pNames[3] = "CTLTextNumerals";
+        pNames[4] = "CTLSequenceCheckingRestricted";
+        pNames[5] = "CTLSequenceCheckingTypeAndReplace";
         EnableNotification( rPropertyNames );
     }
     Sequence< Any > aValues = GetProperties( rPropertyNames );
diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx
index d0bced0..5f7678a 100644
--- a/svl/source/config/languageoptions.cxx
+++ b/svl/source/config/languageoptions.cxx
@@ -168,11 +168,11 @@ sal_uInt16 SvtLanguageOptions::GetScriptTypeOfLanguage( sal_uInt16 nLang )
 // -----------------------------------------------------------------------------
 
 SvtSystemLanguageOptions::SvtSystemLanguageOptions() :
-    utl::ConfigItem( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("System/L10N") ))
+    utl::ConfigItem( "System/L10N")
 {
     uno::Sequence< rtl::OUString > aPropertyNames(1);
     rtl::OUString* pNames = aPropertyNames.getArray();
-    pNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SystemLocale"));
+    pNames[0] = "SystemLocale";
     uno::Sequence< uno::Any > aValues = GetProperties( aPropertyNames );
 
     if ( aValues.getLength() )
diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx
index d5d5f9e..5f7714f 100644
--- a/svl/source/items/macitem.cxx
+++ b/svl/source/items/macitem.cxx
@@ -61,15 +61,15 @@ SvxMacro::~SvxMacro()
 {
     if(eType==STARBASIC)
     {
-        return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SVX_MACRO_LANGUAGE_STARBASIC));
+        return ::rtl::OUString(SVX_MACRO_LANGUAGE_STARBASIC);
     }
     else if(eType==JAVASCRIPT)
     {
-        return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT));
+        return ::rtl::OUString(SVX_MACRO_LANGUAGE_JAVASCRIPT);
     }
     else if(eType==EXTENDED_STYPE)
     {
-        return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SVX_MACRO_LANGUAGE_SF));
+        return ::rtl::OUString(SVX_MACRO_LANGUAGE_SF);
 
     }
     return aLibName;
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index 8d0244e..5bbe31c 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -807,9 +807,7 @@ INetContentType INetContentTypes::GetContentTypeFromURL(UniString const &
         if (aToken.EqualsIgnoreCaseAscii(INETTYPE_URL_PROT_FILE))
             if (rURL.GetChar(rURL.Len() - 1) == '/') // folder
                 if (rURL.Len() > RTL_CONSTASCII_LENGTH("file:///"))
-                    if (WildCard(UniString(RTL_CONSTASCII_USTRINGPARAM(
-                                               "*/{*}/"))).
-                            Matches(rURL)) // special folder
+                    if (WildCard("*/{*}/").Matches(rURL)) // special folder
                         eTypeID = CONTENT_TYPE_X_CNT_FSYSSPECIALFOLDER;
                     else
                         // drive? -> "file:///?|/"
diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx
index e6597bd..7df914d 100644
--- a/svl/source/misc/lockfilecommon.cxx
+++ b/svl/source/misc/lockfilecommon.cxx
@@ -65,7 +65,7 @@ LockFileCommon::LockFileCommon( const ::rtl::OUString& aOrigURL, const uno::Refe
     ::rtl::OUString aShareURLString = aDocURL.GetPartBeforeLastName();
     aShareURLString += aPrefix;
     aShareURLString += aDocURL.GetName();
-    aShareURLString += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "%23" ) ); // '#'
+    aShareURLString += "%23"; // '#'
     m_aURL = INetURLObject( aShareURLString ).GetMainURL( INetURLObject::NO_DECODE );
 }
 
@@ -193,7 +193,7 @@ uno::Sequence< ::rtl::OUString > LockFileCommon::ParseEntry( const uno::Sequence
     SvtUserOptions aUserOpt;
     ::rtl::OUString aName = aUserOpt.GetFirstName();
     if ( !aName.isEmpty() )
-        aName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) );
+        aName += " ";
     aName += aUserOpt.GetLastName();
 
     return aName;
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index d1cd8b2..a080eda 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -178,10 +178,7 @@ Result normalizePrefix(
         #endif
             (css::uno::Reference< css::ucb::XCommandProcessor >(
                    content, css::uno::UNO_QUERY_THROW)->execute(
-                       css::ucb::Command(
-                           rtl::OUString(
-                               RTL_CONSTASCII_USTRINGPARAM(
-                                   "getCasePreservingURL")),
+                       css::ucb::Command("getCasePreservingURL",
                            -1, css::uno::Any()),
                        0,
                        css::uno::Reference< css::ucb::XCommandEnvironment >())
@@ -292,22 +289,17 @@ URIHelper::normalizedMakeRelative(
     css::uno::Reference< css::lang::XMultiComponentFactory > componentFactory(
         context->getServiceManager());
     if (!componentFactory.is()) {
-        throw css::uno::RuntimeException(
-            rtl::OUString(
-                RTL_CONSTASCII_USTRINGPARAM(
-                    "component context has no service manager")),
+        throw css::uno::RuntimeException("component context has no service manager",
             css::uno::Reference< css::uno::XInterface >());
     }
     css::uno::Sequence< css::uno::Any > args(2);
-    args[0] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local"));
-    args[1] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office"));
+    args[0] <<= rtl::OUString("Local");
+    args[1] <<= rtl::OUString("Office");
     css::uno::Reference< css::ucb::XContentProvider > broker;
     try {
         broker = css::uno::Reference< css::ucb::XContentProvider >(
             componentFactory->createInstanceWithArgumentsAndContext(
-                rtl::OUString(
-                    RTL_CONSTASCII_USTRINGPARAM(
-                        "com.sun.star.ucb.UniversalContentBroker")),
+                "com.sun.star.ucb.UniversalContentBroker",
                 args, context),
             css::uno::UNO_QUERY_THROW);
     } catch (css::uno::RuntimeException &) {
@@ -315,9 +307,7 @@ URIHelper::normalizedMakeRelative(
     } catch (css::uno::Exception &) {
         css::uno::Any exception(cppu::getCaughtException());
         throw css::lang::WrappedTargetRuntimeException(
-            rtl::OUString(
-                RTL_CONSTASCII_USTRINGPARAM(
-                    "creating com.sun.star.ucb.UniversalContentBroker failed")),
+            "creating com.sun.star.ucb.UniversalContentBroker failed",
             css::uno::Reference< css::uno::XInterface >(),
             exception);
     }
@@ -340,9 +330,7 @@ rtl::OUString URIHelper::simpleNormalizedMakeRelative(
                  com::sun::star::beans::XPropertySet >(
                     comphelper::getProcessServiceFactory(),
                     com::sun::star::uno::UNO_QUERY_THROW)->
-                 getPropertyValue(
-                     rtl::OUString(
-                         RTL_CONSTASCII_USTRINGPARAM("DefaultContext")))),
+                 getPropertyValue("DefaultContext")),
                 com::sun::star::uno::UNO_QUERY_THROW),
             baseUriReference, uriReference));
     return rel.is() ? rel->getUriReference() : uriReference;
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 3e587b5..58c6c14 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -549,8 +549,8 @@ short ImpSvNumberInputScan::GetMonth( const String& rString, xub_StrLen& nPos )
 {
     // #102136# The correct English form of month September abbreviated is
     // SEPT, but almost every data contains SEP instead.
-    static const String aSeptCorrect( RTL_CONSTASCII_USTRINGPARAM( "SEPT" ) );
-    static const String aSepShortened( RTL_CONSTASCII_USTRINGPARAM( "SEP" ) );
+    static const String aSeptCorrect(RTL_CONSTASCII_USTRINGPARAM("SEPT") );
+    static const String aSepShortened(RTL_CONSTASCII_USTRINGPARAM("SEP") );
 
     short res = 0;      // no month found
 
@@ -1738,9 +1738,7 @@ input for the following reasons:
     uno::Reference< lang::XMultiServiceFactory > xSMgr =
         ::comphelper::getProcessServiceFactory();
     uno::Reference< ::com::sun::star::i18n::XCalendar3 > xCal(
-            xSMgr->createInstance( ::rtl::OUString(
-                    RTL_CONSTASCII_USTRINGPARAM(
-                        "com.sun.star.i18n.LocaleCalendar" ) ) ),
+            xSMgr->createInstance( "com.sun.star.i18n.LocaleCalendar" ),
             uno::UNO_QUERY );
     for ( const entry* p = cals; p->lan; ++p )
     {
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 9e4dfb0..934a043 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -921,15 +921,12 @@ sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, bool bNoAdditio
             if ( aLoadedLocale.Language != aLocale.Language ||
                     aLoadedLocale.Country != aLocale.Country )
             {
-                String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                            "SvNumerFormatter::ImpGenerateCL: locales don't match:"));
-                LocaleDataWrapper::outputCheckMessage(
-                        xLocaleData->appendLocaleInfo( aMsg ));
+                rtl::OUString aMsg("SvNumerFormatter::ImpGenerateCL: locales don't match:");
+                LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg ));
             }
             // test XML locale data FormatElement entries
             {
-                uno::Sequence< i18n::FormatElement > xSeq =
-                    xLocaleData->getAllFormats();
+                uno::Sequence< i18n::FormatElement > xSeq = xLocaleData->getAllFormats();
                 // A test for completeness of formatindex="0" ...
                 // formatindex="47" is not needed here since it is done in
                 // ImpGenerateFormats().
@@ -938,30 +935,26 @@ sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, bool bNoAdditio
                 for ( sal_Int32 j = 0; j < xSeq.getLength(); j++ )
                 {
                     sal_Int16 nIdx = xSeq[j].formatIndex;
-                    String aDupes;
+                    rtl::OUString aDupes;
                     for ( sal_Int32 i = 0; i < xSeq.getLength(); i++ )
                     {
                         if ( i != j && xSeq[i].formatIndex == nIdx )
                         {
-                            aDupes += String::CreateFromInt32( i );
-                            aDupes += '(';
-                            aDupes += String( xSeq[i].formatKey );
-                            aDupes += ')';
-                            aDupes += ' ';
+                            aDupes += rtl::OUString::valueOf( i );
+                            aDupes += "(";
+                            aDupes += rtl::OUString( xSeq[i].formatKey );
+                            aDupes += ") ";
                         }
                     }
-                    if ( aDupes.Len() )
+                    if ( !aDupes.isEmpty() )
                     {
-                        String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                                    "XML locale data FormatElement formatindex dupe: "));
-                        aMsg += String::CreateFromInt32( nIdx );
-                        aMsg.AppendAscii( RTL_CONSTASCII_STRINGPARAM(
-                                    "\nFormatElements: "));
-                        aMsg += String::CreateFromInt32( j );
-                        aMsg += '(';
-                        aMsg += String( xSeq[j].formatKey );
-                        aMsg += ')';
-                        aMsg += ' ';
+                        rtl::OUString aMsg("XML locale data FormatElement formatindex dupe: ");
+                        aMsg += rtl::OUString::valueOf( nIdx );
+                        aMsg += "\nFormatElements: ";
+                        aMsg += rtl::OUString::valueOf( j );
+                        aMsg += "(";
+                        aMsg += rtl::OUString( xSeq[j].formatKey );
+                        aMsg += ") ";
                         aMsg += aDupes;
                         LocaleDataWrapper::outputCheckMessage(
                                 xLocaleData->appendLocaleInfo( aMsg ));
@@ -1746,13 +1739,11 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat(
             if (LocaleDataWrapper::areChecksEnabled() &&
                     rCode.Index != NF_CURRENCY_1000DEC2_CCC )
             {
-                String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                            "SvNumberFormatter::ImpInsertFormat: no [$...] on currency format code, index "));
-                aMsg += String::CreateFromInt32( rCode.Index );
-                aMsg.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ":\n"));
-                aMsg += String( rCode.Code );
-                LocaleDataWrapper::outputCheckMessage(
-                        xLocaleData->appendLocaleInfo( aMsg));
+                rtl::OUString aMsg("SvNumberFormatter::ImpInsertFormat: no [$...] on currency format code, index ");
+                aMsg += rtl::OUString::valueOf( rCode.Index );
+                aMsg += ":\n";
+                aMsg += rCode.Code;
+                LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg));
             }
         }
     }
@@ -1766,13 +1757,11 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat(
     {
         if (LocaleDataWrapper::areChecksEnabled())
         {
-            String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                        "SvNumberFormatter::ImpInsertFormat: bad format code, index "));
-            aMsg += String::CreateFromInt32( rCode.Index );
-            aMsg += '\n';
-            aMsg += String( rCode.Code );
-            LocaleDataWrapper::outputCheckMessage(
-                    xLocaleData->appendLocaleInfo( aMsg));
+            rtl::OUString aMsg( "SvNumberFormatter::ImpInsertFormat: bad format code, index " );
+            aMsg += rtl::OUString::valueOf( rCode.Index );
+            aMsg += "\n";
+            aMsg += rCode.Code;
+            LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg));
         }
         delete pFormat;
         return NULL;
@@ -1798,13 +1787,11 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat(
                         break;
                     default:
                     {
-                        String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                                    "SvNumberFormatter::ImpInsertFormat: dup format code, index "));
-                        aMsg += String::CreateFromInt32( rCode.Index );
-                        aMsg += '\n';
-                        aMsg += String( rCode.Code );
-                        LocaleDataWrapper::outputCheckMessage(
-                                xLocaleData->appendLocaleInfo( aMsg));
+                        rtl::OUString aMsg("SvNumberFormatter::ImpInsertFormat: dup format code, index ");
+                        aMsg += rtl::OUString::valueOf( rCode.Index );
+                        aMsg += "\n";
+                        aMsg += rCode.Code;
+                        LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg));
                     }
                 }
             }
@@ -1815,13 +1802,11 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat(
         {
             if (LocaleDataWrapper::areChecksEnabled())
             {
-                String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                            "SvNumberFormatter::ImpInsertFormat: too many format codes, index "));
-                aMsg += String::CreateFromInt32( rCode.Index );
-                aMsg += '\n';
-                aMsg += String( rCode.Code );
-                LocaleDataWrapper::outputCheckMessage(
-                        xLocaleData->appendLocaleInfo( aMsg));
+                rtl::OUString aMsg( "SvNumberFormatter::ImpInsertFormat: too many format codes, index ");
+                aMsg += rtl::OUString::valueOf( rCode.Index );
+                aMsg += "\n";
+                aMsg +=  rCode.Code;
+                LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg));
             }
             delete pFormat;
             return NULL;
@@ -1831,15 +1816,13 @@ SvNumberformat* SvNumberFormatter::ImpInsertFormat(
     {
         if (LocaleDataWrapper::areChecksEnabled())
         {
-            String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                        "ImpInsertFormat: can't insert number format key pos: "));
-            aMsg += String::CreateFromInt32( nPos );
-            aMsg.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ", code index "));
-            aMsg += String::CreateFromInt32( rCode.Index );
-            aMsg += '\n';
-            aMsg += String( rCode.Code );
-            LocaleDataWrapper::outputCheckMessage(
-                    xLocaleData->appendLocaleInfo( aMsg));
+            rtl::OUString aMsg( "ImpInsertFormat: can't insert number format key pos: ");
+            aMsg += rtl::OUString::valueOf( sal_Int32( nPos ) );
+            aMsg += ", code index ";
+            aMsg += rtl::OUString::valueOf( rCode.Index );
+            aMsg += "\n";
+            aMsg += rCode.Code;
+            LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo( aMsg));
         }
         delete pFormat;
         return NULL;
@@ -1970,11 +1953,9 @@ sal_Int32 SvNumberFormatter::ImpGetFormatCodeIndex(
                 || nTabOff == NF_CURRENCY_1000INT_RED
                 || nTabOff == NF_CURRENCY_1000DEC2_CCC))
     {   // currency entries with decimals might not exist, e.g. Italian Lira
-        String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                    "SvNumberFormatter::ImpGetFormatCodeIndex: not found: "));
-        aMsg += String::CreateFromInt32( nTabOff );
-        LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo(
-                    aMsg));
+        rtl::OUString aMsg( "SvNumberFormatter::ImpGetFormatCodeIndex: not found: " );
+        aMsg += rtl::OUString::valueOf( nTabOff );
+        LocaleDataWrapper::outputCheckMessage( xLocaleData->appendLocaleInfo(aMsg));
     }
     if ( nLen )
     {
@@ -2178,14 +2159,10 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio
     if (pStdFormat)
     {
         // This is _the_ standard format.
-        if (LocaleDataWrapper::areChecksEnabled() &&
-                pStdFormat->GetType() != NUMBERFORMAT_NUMBER)
-        {
-            String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                        "SvNumberFormatter::ImpGenerateFormats: General format not NUMBER"));
-            LocaleDataWrapper::outputCheckMessage(
-                    xLocaleData->appendLocaleInfo( aMsg));
-        }
+        if (LocaleDataWrapper::areChecksEnabled() && pStdFormat->GetType() != NUMBERFORMAT_NUMBER)
+                LocaleDataWrapper::outputCheckMessage( xLocaleData->
+                    appendLocaleInfo( "SvNumberFormatter::ImpGenerateFormats: General format not NUMBER"));
+
         pStdFormat->SetType( NUMBERFORMAT_NUMBER );
         pStdFormat->SetStandard();
         pStdFormat->SetLastInsertKey( SV_MAX_ANZ_STANDARD_FORMATE );
@@ -2193,12 +2170,8 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio
     else
     {
         if (LocaleDataWrapper::areChecksEnabled())
-        {
-            String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                        "SvNumberFormatter::ImpGenerateFormats: General format not insertable, nothing will work"));
-            LocaleDataWrapper::outputCheckMessage(
-                    xLocaleData->appendLocaleInfo( aMsg));
-        }
+                LocaleDataWrapper::outputCheckMessage( xLocaleData->
+                    appendLocaleInfo( "SvNumberFormatter::ImpGenerateFormats: General format not insertable, nothing will work"));
     }
 
     // Boolean
@@ -2541,24 +2514,24 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio
     aSingleFormatCode.Usage = i18n::KNumberFormatUsage::FRACTION_NUMBER;
 
      // # ?/?
-    aSingleFormatCode.Code = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "# ?/?" ) );
+    aSingleFormatCode.Code = "# ?/?";
     ImpInsertFormat( aSingleFormatCode,
         CLOffset + SetIndexTable( NF_FRACTION_1, ZF_STANDARD_FRACTION ));
 
     // # ??/??
     //! "??/" would be interpreted by the compiler as a trigraph for '\'
-    aSingleFormatCode.Code = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "# ?\?/?\?" ) );
+    aSingleFormatCode.Code = "# ?\?/?\?";
     ImpInsertFormat( aSingleFormatCode,
         CLOffset + SetIndexTable( NF_FRACTION_2, ZF_STANDARD_FRACTION+1 ));
 
     // # ?/4
-    aSingleFormatCode.Code = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "# ?/4" ) );
+    aSingleFormatCode.Code = "# ?/4";
     ImpInsertNewStandardFormat( aSingleFormatCode,
         CLOffset + SetIndexTable( NF_FRACTION_3, ZF_STANDARD_FRACTION+2 ),
         SV_NUMBERFORMATTER_VERSION_FIXED_FRACTION );
 
     // # ??/100
-    aSingleFormatCode.Code = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "# ?\?/100" ) );
+    aSingleFormatCode.Code = "# ?\?/100";
     ImpInsertNewStandardFormat( aSingleFormatCode,
         CLOffset + SetIndexTable( NF_FRACTION_4, ZF_STANDARD_FRACTION+3 ),
         SV_NUMBERFORMATTER_VERSION_FIXED_FRACTION );
@@ -3448,12 +3421,9 @@ void SvNumberFormatter::GetCompatibilityCurrency( String& rSymbol, String& rAbbr
     if ( j >= nCurrencies )
     {
         if (LocaleDataWrapper::areChecksEnabled())
-        {
-            String aMsg( RTL_CONSTASCII_USTRINGPARAM(
-                        "GetCompatibilityCurrency: none?"));
-            LocaleDataWrapper::outputCheckMessage(
-                    xLocaleData->appendLocaleInfo( aMsg));
-        }
+               LocaleDataWrapper::outputCheckMessage( xLocaleData->
+                   appendLocaleInfo( "GetCompatibilityCurrency: none?"));
+
         rSymbol = xLocaleData->getCurrSymbol();
         rAbbrev = xLocaleData->getCurrBankSymbol();
     }
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 9808bc0..7b66797 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -56,7 +56,7 @@ namespace {
 struct Gregorian
     : public rtl::StaticWithInit<const ::rtl::OUString, Gregorian> {
     const ::rtl::OUString operator () () {
-        return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("gregorian"));
+        return ::rtl::OUString("gregorian");
     }
 };
 
@@ -940,9 +940,9 @@ SvNumberformat::SvNumberformat(String& rString,
                         // e.g. Thai T speciality
                         if (pSc->GetNatNumModifier() && !NumFor[nIndex].GetNatNum().IsSet())
                         {
-                            String aNat( RTL_CONSTASCII_USTRINGPARAM( "[NatNum"));
-                            aNat += String::CreateFromInt32( pSc->GetNatNumModifier());
-                            aNat += ']';
+                            rtl::OUString aNat( "[NatNum");
+                            aNat += rtl::OUString::valueOf( pSc->GetNatNumModifier());
+                            aNat += "]";
                             sStr.Insert( aNat, 0);
                             NumFor[nIndex].SetNatNumNum( pSc->GetNatNumModifier(), false );
                         }
@@ -966,10 +966,10 @@ SvNumberformat::SvNumberformat(String& rString,
                                 NumFor[nIndex].GetNatNum().GetLang() ==
                                 LANGUAGE_DONTKNOW)
                         {
-                            String aLID( RTL_CONSTASCII_USTRINGPARAM( "[$-"));
-                            aLID += String::CreateFromInt32( sal_Int32(
-                                        eLanguage), 16 ).ToUpperAscii();
-                            aLID += ']';
+                            rtl::OUString aLID("[$-");
+                            aLID += rtl::OUString::valueOf( sal_Int32(
+                                        eLanguage), 16 ).toAsciiUpperCase();
+                            aLID += "]";
                             sStr.Insert( aLID, 0);
                             NumFor[nIndex].SetNatNumLang( eLanguage);
                         }


More information about the Libreoffice-commits mailing list