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

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Feb 24 16:48:21 PST 2011


 svl/inc/svl/zforlist.hxx        |    6 ++++++
 svl/qa/unit/svl.cxx             |    6 +++---
 svl/source/numbers/zforlist.cxx |   13 +++++++++++++
 3 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit da5d69e9295b6212e22bfdd77c1ed5e76e9f6b43
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Feb 24 19:47:04 2011 -0500

    Use OUString instead of String in the unit test code.
    
    Added another method PutEntry() to allow rtl::OUString to be used.
    We'll keep this until UniString gets totally eradicated.

diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx
index a51a0c9..0e484a5 100644
--- a/svl/inc/svl/zforlist.hxx
+++ b/svl/inc/svl/zforlist.hxx
@@ -60,6 +60,9 @@ namespace com { namespace sun { namespace star {
     }
 }}}
 
+namespace rtl {
+    class OUString;
+}
 
 #define SV_COUNTRY_LANGUAGE_OFFSET  5000	// Max count of formats per country/language
 #define SV_MAX_ANZ_STANDARD_FORMATE  100	// Max count of builtin default formats per CL
@@ -414,6 +417,9 @@ public:
     BOOL PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey,
                   LanguageType eLnge = LANGUAGE_DONTKNOW );
 
+    bool PutEntry( rtl::OUString& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey,
+                  LanguageType eLnge = LANGUAGE_DONTKNOW );
+
     /** Same as <method>PutEntry</method> but the format code string is
          considered to be of language/country eLnge and is converted to
         language/country eNewLnge */
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 4e16b49..e88efff 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -264,14 +264,14 @@ void Test::testNumberFormat()
     xub_StrLen nPos;
     short nType = NUMBERFORMAT_DEFINED;
     sal_uInt32 nKey;
-    String aCode;
-    aCode = String(RTL_CONSTASCII_USTRINGPARAM("[$-1070000]d/mm/yyyy;@")); // Thai date format (implicit locale).
+    OUString aCode;
+    aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[$-1070000]d/mm/yyyy;@")); // Thai date format (implicit locale).
     if (!aFormatter.PutEntry(aCode, nPos, nType, nKey))
     {
         CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[$-1070000]d/mm/yyyy;@'", false);
     }
 
-    aCode = String(RTL_CONSTASCII_USTRINGPARAM("[$-107041E]d/mm/yyyy;@")); // Thai date format (explicit locale)
+    aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[$-107041E]d/mm/yyyy;@")); // Thai date format (explicit locale)
     if (!aFormatter.PutEntry(aCode, nPos, nType, nKey))
     {
         CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[$-1070000]d/mm/yyyy;@'", false);
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 5afba91..584e4e8 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -66,6 +66,8 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::i18n;
 using namespace ::com::sun::star::lang;
 
+using ::rtl::OUString;
+
 
 // Constants for type offsets per Country/Language (CL)
 #define ZF_STANDARD              0
@@ -542,6 +544,17 @@ BOOL SvNumberFormatter::PutEntry(String& rString,
     return bCheck;
 }
 
+bool SvNumberFormatter::PutEntry(
+    OUString& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey,
+    LanguageType eLnge)
+{
+    // Wrapper to allow rtl::OUString to be used.
+    String aStr(rString);
+    bool bRet = PutEntry(aStr, nCheckPos, nType, nKey, eLnge);
+    rString = aStr;
+    return bRet;
+}
+
 BOOL SvNumberFormatter::PutandConvertEntry(String& rString,
                                            xub_StrLen& nCheckPos,
                                            short& nType,


More information about the Libreoffice-commits mailing list