diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-17 00:48:43 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-17 00:48:43 -0400 |
commit | 7a6d9e1ae64b6c30d23d862327a20ef82a9f0e86 (patch) | |
tree | 1c0044e8b9ffb8f2298071b691e11e592fc370d5 | |
parent | ba0cd696766669c8e8cedd8d2789f0c28d60f1c9 (diff) |
String to rtl::OUString.
-rw-r--r-- | sc/source/filter/excel/xiname.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xltools.cxx | 29 | ||||
-rw-r--r-- | sc/source/filter/inc/xltools.hxx | 8 |
3 files changed, 20 insertions, 19 deletions
diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 19e18d9f22cc..1b3b56f4c120 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -103,7 +103,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : bool bBuiltIn = ::get_flag( nFlags, EXC_NAME_BUILTIN ); // special case for BIFF5 filter range - name appears as plain text without built-in flag - if( (GetBiff() == EXC_BIFF5) && (maXclName == XclTools::GetXclBuiltInDefName( EXC_BUILTIN_FILTERDATABASE )) ) + if( (GetBiff() == EXC_BIFF5) && (maXclName.Equals(XclTools::GetXclBuiltInDefName(EXC_BUILTIN_FILTERDATABASE))) ) { bBuiltIn = true; maXclName.Assign( EXC_BUILTIN_FILTERDATABASE ); diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index 3737116fe90c..8a15e68e3d01 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -456,13 +456,11 @@ sal_uInt16 XclTools::GetXclCodePage( rtl_TextEncoding eTextEnc ) // font names ----------------------------------------------------------------- -String XclTools::GetXclFontName( const String& rFontName ) +OUString XclTools::GetXclFontName( const OUString& rFontName ) { // substitute with MS fonts - String aNewName( GetSubsFontName( rFontName, SUBSFONT_ONLYONE | SUBSFONT_MS ) ); - if( aNewName.Len() ) - return aNewName; - return rFontName; + OUString aNewName = GetSubsFontName(rFontName, SUBSFONT_ONLYONE | SUBSFONT_MS); + return aNewName.isEmpty() ? rFontName : aNewName; } // built-in defined names ----------------------------------------------------- @@ -489,26 +487,29 @@ static const sal_Char* const ppcDefNames[] = "_FilterDatabase" }; -String XclTools::GetXclBuiltInDefName( sal_Unicode cBuiltIn ) +OUString XclTools::GetXclBuiltInDefName( sal_Unicode cBuiltIn ) { OSL_ENSURE( SAL_N_ELEMENTS( ppcDefNames ) == EXC_BUILTIN_UNKNOWN, "XclTools::GetXclBuiltInDefName - built-in defined name list modified" ); - String aDefName; + if( cBuiltIn < SAL_N_ELEMENTS( ppcDefNames ) ) - aDefName.AssignAscii( ppcDefNames[ cBuiltIn ] ); + return rtl::OUString::createFromAscii(ppcDefNames[cBuiltIn]); else - aDefName = String::CreateFromInt32( cBuiltIn ); - return aDefName; + return rtl::OUString::valueOf(static_cast<sal_Int32>(cBuiltIn)); } -String XclTools::GetBuiltInDefName( sal_Unicode cBuiltIn ) +OUString XclTools::GetBuiltInDefName( sal_Unicode cBuiltIn ) { - return String( maDefNamePrefix ).Append( GetXclBuiltInDefName( cBuiltIn ) ); + rtl::OUStringBuffer aBuf(maDefNamePrefix); + aBuf.append(GetXclBuiltInDefName(cBuiltIn)); + return aBuf.makeStringAndClear(); } -String XclTools::GetBuiltInDefNameXml( sal_Unicode cBuiltIn ) +OUString XclTools::GetBuiltInDefNameXml( sal_Unicode cBuiltIn ) { - return String( maDefNamePrefixXml ).Append( GetXclBuiltInDefName( cBuiltIn ) ); + rtl::OUStringBuffer aBuf(maDefNamePrefixXml); + aBuf.append(GetXclBuiltInDefName(cBuiltIn)); + return aBuf.makeStringAndClear(); } sal_Unicode XclTools::GetBuiltInDefNameIndex( const OUString& rDefName ) diff --git a/sc/source/filter/inc/xltools.hxx b/sc/source/filter/inc/xltools.hxx index e219cb6b01d4..92e4fac97b0c 100644 --- a/sc/source/filter/inc/xltools.hxx +++ b/sc/source/filter/inc/xltools.hxx @@ -176,21 +176,21 @@ public: // font names ------------------------------------------------------------- /** Returns the matching Excel font name for a passed Calc font name. */ - static String GetXclFontName( const String& rFontName ); + static rtl::OUString GetXclFontName( const rtl::OUString& rFontName ); // built-in defined names ------------------------------------------------- /** Returns the raw English UI representation of a built-in defined name used in NAME records. @param cBuiltIn Excel index of the built-in name. */ - static String GetXclBuiltInDefName( sal_Unicode cBuiltIn ); + static rtl::OUString GetXclBuiltInDefName( sal_Unicode cBuiltIn ); /** Returns the Calc UI representation of a built-in defined name used in NAME records. @descr Adds a prefix to the representation returned by GetXclBuiltInDefName(). @param cBuiltIn Excel index of the built-in name. */ - static String GetBuiltInDefName( sal_Unicode cBuiltIn ); + static rtl::OUString GetBuiltInDefName( sal_Unicode cBuiltIn ); /** Returns the Excel built-in name with OOXML prefix @descr Adds the "_xlnm." prefix to the representation returned by GetXclBuiltInDefName() @param cBuiltIn Excel index of the built in name.*/ - static String GetBuiltInDefNameXml( sal_Unicode cBuiltIn ); + static rtl::OUString GetBuiltInDefNameXml( sal_Unicode cBuiltIn ); /** Returns the Excel built-in name index of the passed defined name from Calc. @descr Ignores any characters following a valid representation of a built-in name. @param pcBuiltIn (out-param) If not 0, the index of the built-in name will be returned here. |