Kaydet (Commit) b0cf3aba authored tarafından elixir's avatar elixir Kaydeden (comit) Fridrich Strba

fdo#38838: Replaced some (Uni)String to OUString in core/sc

Change-Id: I4fa27b933c5b3cf2645b139bf6349b90f613feab
Reviewed-on: https://gerrit.libreoffice.org/2735Reviewed-by: 's avatarFridrich Strba <fridrich@documentfoundation.org>
Tested-by: 's avatarFridrich Strba <fridrich@documentfoundation.org>
üst 36938e69
...@@ -635,14 +635,14 @@ public: ...@@ -635,14 +635,14 @@ public:
@param bEscapeEmbedded If <TRUE/>, embedded quote characters are @param bEscapeEmbedded If <TRUE/>, embedded quote characters are
escaped by doubling them. escaped by doubling them.
*/ */
SC_DLLPUBLIC static void AddQuotes( String& rString, sal_Unicode cQuote = '\'', bool bEscapeEmbedded = true ); SC_DLLPUBLIC static void AddQuotes( OUString& rString, sal_Unicode cQuote = '\'', bool bEscapeEmbedded = true );
/** Erases the character cQuote from rString, if it exists at beginning AND end. /** Erases the character cQuote from rString, if it exists at beginning AND end.
@param bUnescapeEmbedded If <TRUE/>, embedded doubled quote characters @param bUnescapeEmbedded If <TRUE/>, embedded doubled quote characters
are unescaped by replacing them with a are unescaped by replacing them with a
single instance. single instance.
*/ */
SC_DLLPUBLIC static void EraseQuotes( String& rString, sal_Unicode cQuote = '\'', bool bUnescapeEmbedded = true ); SC_DLLPUBLIC static void EraseQuotes( OUString& rString, sal_Unicode cQuote = '\'', bool bUnescapeEmbedded = true );
/** Finds an unquoted instance of cChar in rString, starting at /** Finds an unquoted instance of cChar in rString, starting at
offset nStart. Unquoted instances may occur when concatenating two offset nStart. Unquoted instances may occur when concatenating two
......
...@@ -106,9 +106,9 @@ public: ...@@ -106,9 +106,9 @@ public:
static bool parseSimpleNumber( static bool parseSimpleNumber(
const ::rtl::OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal); const ::rtl::OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal);
static xub_StrLen SC_DLLPUBLIC GetQuotedTokenCount(const UniString &rIn, const UniString& rQuotedPairs, sal_Unicode cTok = ';' ); static sal_Int32 SC_DLLPUBLIC GetQuotedTokenCount(const OUString &rIn, const OUString& rQuotedPairs, sal_Unicode cTok = ';' );
static UniString SC_DLLPUBLIC GetQuotedToken(const UniString &rIn, xub_StrLen nToken, const UniString& rQuotedPairs, static OUString SC_DLLPUBLIC GetQuotedToken(const OUString &rIn, sal_Int32 nToken, const OUString& rQuotedPairs,
sal_Unicode cTok, xub_StrLen& rIndex ); sal_Unicode cTok, sal_Int32& rIndex );
}; };
......
...@@ -814,7 +814,7 @@ bool ScGlobal::IsQuoted( const String& rString, sal_Unicode cQuote ) ...@@ -814,7 +814,7 @@ bool ScGlobal::IsQuoted( const String& rString, sal_Unicode cQuote )
return (rString.Len() >= 2) && (rString.GetChar( 0 ) == cQuote) && (rString.GetChar( rString.Len() - 1 ) == cQuote); return (rString.Len() >= 2) && (rString.GetChar( 0 ) == cQuote) && (rString.GetChar( rString.Len() - 1 ) == cQuote);
} }
void ScGlobal::AddQuotes( String& rString, sal_Unicode cQuote, bool bEscapeEmbedded ) void ScGlobal::AddQuotes( OUString& rString, sal_Unicode cQuote, bool bEscapeEmbedded )
{ {
if (bEscapeEmbedded) if (bEscapeEmbedded)
{ {
...@@ -822,23 +822,23 @@ void ScGlobal::AddQuotes( String& rString, sal_Unicode cQuote, bool bEscapeEmbed ...@@ -822,23 +822,23 @@ void ScGlobal::AddQuotes( String& rString, sal_Unicode cQuote, bool bEscapeEmbed
pQ[0] = pQ[1] = cQuote; pQ[0] = pQ[1] = cQuote;
pQ[2] = 0; pQ[2] = 0;
rtl::OUString aQuotes( pQ ); rtl::OUString aQuotes( pQ );
rString.SearchAndReplaceAll( rtl::OUString(cQuote), aQuotes); rString.replaceAll( OUString(cQuote), aQuotes);
} }
rString.Insert( cQuote, 0 ).Append( cQuote ); rString = OUString( cQuote ) + OUString( cQuote );
} }
void ScGlobal::EraseQuotes( String& rString, sal_Unicode cQuote, bool bUnescapeEmbedded ) void ScGlobal::EraseQuotes( OUString& rString, sal_Unicode cQuote, bool bUnescapeEmbedded )
{ {
if ( IsQuoted( rString, cQuote ) ) if ( IsQuoted( rString, cQuote ) )
{ {
rString.Erase( rString.Len() - 1 ).Erase( 0, 1 ); rString = rString.copy( 0, rString.getLength() - 1 ).copy( 1 );
if (bUnescapeEmbedded) if (bUnescapeEmbedded)
{ {
sal_Unicode pQ[3]; sal_Unicode pQ[3];
pQ[0] = pQ[1] = cQuote; pQ[0] = pQ[1] = cQuote;
pQ[2] = 0; pQ[2] = 0;
rtl::OUString aQuotes( pQ ); rtl::OUString aQuotes( pQ );
rString.SearchAndReplaceAll( aQuotes, rtl::OUString(cQuote)); rString.replaceAll( aQuotes, OUString(cQuote));
} }
} }
} }
......
...@@ -183,22 +183,22 @@ bool ScStringUtil::parseSimpleNumber( ...@@ -183,22 +183,22 @@ bool ScStringUtil::parseSimpleNumber(
return true; return true;
} }
xub_StrLen ScStringUtil::GetQuotedTokenCount(const UniString &rIn, const UniString& rQuotedPairs, sal_Unicode cTok ) sal_Int32 ScStringUtil::GetQuotedTokenCount(const OUString &rIn, const OUString& rQuotedPairs, sal_Unicode cTok )
{ {
assert( !(rQuotedPairs.Len()%2) ); assert( !(rQuotedPairs.getLength()%2) );
assert( rQuotedPairs.Search(cTok) ); assert( rQuotedPairs.indexOf(cTok) );
// empty string: TokenCount is 0 per definition // empty string: TokenCount is 0 per definition
if ( !rIn.Len() ) if ( rIn.isEmpty() )
return 0; return 0;
xub_StrLen nTokCount = 1; sal_Int32 nTokCount = 1;
sal_Int32 nLen = rIn.Len(); sal_Int32 nLen = rIn.getLength();
xub_StrLen nQuotedLen = rQuotedPairs.Len(); sal_Int32 nQuotedLen = rQuotedPairs.getLength();
sal_Unicode cQuotedEndChar = 0; sal_Unicode cQuotedEndChar = 0;
const sal_Unicode* pQuotedStr = rQuotedPairs.GetBuffer(); const sal_Unicode* pQuotedStr = rQuotedPairs.getStr();
const sal_Unicode* pStr = rIn.GetBuffer(); const sal_Unicode* pStr = rIn.getStr();
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
while ( nIndex < nLen ) while ( nIndex < nLen )
{ {
sal_Unicode c = *pStr; sal_Unicode c = *pStr;
...@@ -211,7 +211,7 @@ xub_StrLen ScStringUtil::GetQuotedTokenCount(const UniString &rIn, const UniStri ...@@ -211,7 +211,7 @@ xub_StrLen ScStringUtil::GetQuotedTokenCount(const UniString &rIn, const UniStri
else else
{ {
// Is the char a quote-beginn char ? // Is the char a quote-beginn char ?
xub_StrLen nQuoteIndex = 0; sal_Int32 nQuoteIndex = 0;
while ( nQuoteIndex < nQuotedLen ) while ( nQuoteIndex < nQuotedLen )
{ {
if ( pQuotedStr[nQuoteIndex] == c ) if ( pQuotedStr[nQuoteIndex] == c )
...@@ -235,20 +235,20 @@ xub_StrLen ScStringUtil::GetQuotedTokenCount(const UniString &rIn, const UniStri ...@@ -235,20 +235,20 @@ xub_StrLen ScStringUtil::GetQuotedTokenCount(const UniString &rIn, const UniStri
return nTokCount; return nTokCount;
} }
UniString ScStringUtil::GetQuotedToken(const UniString &rIn, xub_StrLen nToken, const UniString& rQuotedPairs, OUString ScStringUtil::GetQuotedToken(const OUString &rIn, sal_Int32 nToken, const OUString& rQuotedPairs,
sal_Unicode cTok, xub_StrLen& rIndex ) sal_Unicode cTok, sal_Int32& rIndex )
{ {
assert( !(rQuotedPairs.Len()%2) ); assert( !(rQuotedPairs.Len()%2) );
assert( rQuotedPairs.Search(cTok) == STRING_NOTFOUND ); assert( rQuotedPairs.indexOf(cTok) == -1 );
const sal_Unicode* pStr = rIn.GetBuffer(); const sal_Unicode* pStr = rIn.getStr();
const sal_Unicode* pQuotedStr = rQuotedPairs.GetBuffer(); const sal_Unicode* pQuotedStr = rQuotedPairs.getStr();
sal_Unicode cQuotedEndChar = 0; sal_Unicode cQuotedEndChar = 0;
xub_StrLen nQuotedLen = rQuotedPairs.Len(); sal_Int32 nQuotedLen = rQuotedPairs.getLength();
xub_StrLen nLen = rIn.Len(); sal_Int32 nLen = rIn.getLength();
xub_StrLen nTok = 0; sal_Int32 nTok = 0;
xub_StrLen nFirstChar = rIndex; sal_Int32 nFirstChar = rIndex;
xub_StrLen i = nFirstChar; sal_Int32 i = nFirstChar;
// detect token position and length // detect token position and length
pStr += i; pStr += i;
...@@ -264,7 +264,7 @@ UniString ScStringUtil::GetQuotedToken(const UniString &rIn, xub_StrLen nToken, ...@@ -264,7 +264,7 @@ UniString ScStringUtil::GetQuotedToken(const UniString &rIn, xub_StrLen nToken,
else else
{ {
// Is the char a quote-begin char ? // Is the char a quote-begin char ?
xub_StrLen nQuoteIndex = 0; sal_Int32 nQuoteIndex = 0;
while ( nQuoteIndex < nQuotedLen ) while ( nQuoteIndex < nQuotedLen )
{ {
if ( pQuotedStr[nQuoteIndex] == c ) if ( pQuotedStr[nQuoteIndex] == c )
...@@ -300,13 +300,13 @@ UniString ScStringUtil::GetQuotedToken(const UniString &rIn, xub_StrLen nToken, ...@@ -300,13 +300,13 @@ UniString ScStringUtil::GetQuotedToken(const UniString &rIn, xub_StrLen nToken,
if ( i < nLen ) if ( i < nLen )
rIndex = i+1; rIndex = i+1;
else else
rIndex = STRING_NOTFOUND; rIndex = -1;
return rIn.Copy( nFirstChar, i-nFirstChar ); return rIn.copy( nFirstChar, i-nFirstChar );
} }
else else
{ {
rIndex = STRING_NOTFOUND; rIndex = -1;
return UniString(); return OUString();
} }
} }
......
...@@ -1797,12 +1797,13 @@ XclExpWebQuery::XclExpWebQuery( ...@@ -1797,12 +1797,13 @@ XclExpWebQuery::XclExpWebQuery(
{ {
// comma separated list of HTML table names or indexes // comma separated list of HTML table names or indexes
xub_StrLen nTokenCnt = comphelper::string::getTokenCount(rSource, ';'); xub_StrLen nTokenCnt = comphelper::string::getTokenCount(rSource, ';');
String aNewTables, aAppendTable; String aNewTables;
OUString aAppendTable;
sal_Int32 nStringIx = 0; sal_Int32 nStringIx = 0;
bool bExitLoop = false; bool bExitLoop = false;
for( xub_StrLen nToken = 0; (nToken < nTokenCnt) && !bExitLoop; ++nToken ) for( xub_StrLen nToken = 0; (nToken < nTokenCnt) && !bExitLoop; ++nToken )
{ {
String aToken( rSource.GetToken( 0, ';', nStringIx ) ); OUString aToken( rSource.GetToken( 0, ';', nStringIx ) );
mbEntireDoc = ScfTools::IsHTMLDocName( aToken ); mbEntireDoc = ScfTools::IsHTMLDocName( aToken );
bExitLoop = mbEntireDoc || ScfTools::IsHTMLTablesName( aToken ); bExitLoop = mbEntireDoc || ScfTools::IsHTMLTablesName( aToken );
if( !bExitLoop && ScfTools::GetHTMLNameFromName( aToken, aAppendTable ) ) if( !bExitLoop && ScfTools::GetHTMLNameFromName( aToken, aAppendTable ) )
......
...@@ -939,23 +939,23 @@ void XclImpWebQuery::ReadWqtables( XclImpStream& rStrm ) ...@@ -939,23 +939,23 @@ void XclImpWebQuery::ReadWqtables( XclImpStream& rStrm )
if( meMode == xlWQSpecTables ) if( meMode == xlWQSpecTables )
{ {
rStrm.Ignore( 4 ); rStrm.Ignore( 4 );
String aTables( rStrm.ReadUniString() ); OUString aTables( rStrm.ReadUniString() );
const sal_Unicode cSep = ';'; const sal_Unicode cSep = ';';
String aQuotedPairs( RTL_CONSTASCII_USTRINGPARAM( "\"\"" ) ); OUString aQuotedPairs( "\"\"" );
xub_StrLen nTokenCnt = ScStringUtil::GetQuotedTokenCount( aTables, aQuotedPairs, ',' ); xub_StrLen nTokenCnt = ScStringUtil::GetQuotedTokenCount( aTables, aQuotedPairs, ',' );
maTables.Erase(); maTables.Erase();
xub_StrLen nStringIx = 0; sal_Int32 nStringIx = 0;
for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken ) for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken )
{ {
String aToken( ScStringUtil::GetQuotedToken( aTables, 0, aQuotedPairs, ',', nStringIx ) ); OUString aToken( ScStringUtil::GetQuotedToken( aTables, 0, aQuotedPairs, ',', nStringIx ) );
sal_Int32 nTabNum = CharClass::isAsciiNumeric( aToken ) ? aToken.ToInt32() : 0; sal_Int32 nTabNum = CharClass::isAsciiNumeric( aToken ) ? aToken.toInt32() : 0;
if( nTabNum > 0 ) if( nTabNum > 0 )
maTables = ScGlobal::addToken( maTables, ScfTools::GetNameFromHTMLIndex( static_cast< sal_uInt32 >( nTabNum ) ), cSep ); maTables = ScGlobal::addToken( maTables, ScfTools::GetNameFromHTMLIndex( static_cast< sal_uInt32 >( nTabNum ) ), cSep );
else else
{ {
ScGlobal::EraseQuotes( aToken, '"', false ); ScGlobal::EraseQuotes( aToken, '"', false );
if( aToken.Len() ) if( aToken.getLength() )
maTables = ScGlobal::addToken( maTables, ScfTools::GetNameFromHTMLName( aToken ), cSep ); maTables = ScGlobal::addToken( maTables, ScfTools::GetNameFromHTMLName( aToken ), cSep );
} }
} }
......
...@@ -114,15 +114,15 @@ rtl_TextEncoding ScfTools::GetSystemTextEncoding() ...@@ -114,15 +114,15 @@ rtl_TextEncoding ScfTools::GetSystemTextEncoding()
return osl_getThreadTextEncoding(); return osl_getThreadTextEncoding();
} }
String ScfTools::GetHexStr( sal_uInt16 nValue ) OUString ScfTools::GetHexStr( sal_uInt16 nValue )
{ {
const sal_Char pHex[] = "0123456789ABCDEF"; const sal_Char pHex[] = "0123456789ABCDEF";
String aStr; OUString aStr;
aStr += pHex[ nValue >> 12 ]; aStr += OUString( pHex[ nValue >> 12 ] );
aStr += pHex[ (nValue >> 8) & 0x000F ]; aStr += OUString( pHex[ (nValue >> 8) & 0x000F ] );
aStr += pHex[ (nValue >> 4) & 0x000F ]; aStr += OUString( pHex[ (nValue >> 4) & 0x000F ] );
aStr += pHex[ nValue & 0x000F ]; aStr += OUString( pHex[ nValue & 0x000F ] );
return aStr; return aStr;
} }
...@@ -223,17 +223,17 @@ void ScfTools::PutItem( SfxItemSet& rItemSet, const SfxPoolItem& rItem, bool bSk ...@@ -223,17 +223,17 @@ void ScfTools::PutItem( SfxItemSet& rItemSet, const SfxPoolItem& rItem, bool bSk
namespace { namespace {
ScStyleSheet& lclMakeStyleSheet( ScStyleSheetPool& rPool, const String& rStyleName, SfxStyleFamily eFamily, bool bForceName ) ScStyleSheet& lclMakeStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName, SfxStyleFamily eFamily, bool bForceName )
{ {
// find an unused name // find an unused name
String aNewName( rStyleName ); OUString aNewName( rStyleName );
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
SfxStyleSheetBase* pOldStyleSheet = 0; SfxStyleSheetBase* pOldStyleSheet = 0;
while( SfxStyleSheetBase* pStyleSheet = rPool.Find( aNewName, eFamily ) ) while( SfxStyleSheetBase* pStyleSheet = rPool.Find( aNewName, eFamily ) )
{ {
if( !pOldStyleSheet ) if( !pOldStyleSheet )
pOldStyleSheet = pStyleSheet; pOldStyleSheet = pStyleSheet;
aNewName.Assign( rStyleName ).Append( ' ' ).Append( OUString::number( ++nIndex ) ); aNewName = rStyleName + " " + OUString::number( ++nIndex );
} }
// rename existing style // rename existing style
...@@ -249,12 +249,12 @@ ScStyleSheet& lclMakeStyleSheet( ScStyleSheetPool& rPool, const String& rStyleNa ...@@ -249,12 +249,12 @@ ScStyleSheet& lclMakeStyleSheet( ScStyleSheetPool& rPool, const String& rStyleNa
} // namespace } // namespace
ScStyleSheet& ScfTools::MakeCellStyleSheet( ScStyleSheetPool& rPool, const String& rStyleName, bool bForceName ) ScStyleSheet& ScfTools::MakeCellStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName, bool bForceName )
{ {
return lclMakeStyleSheet( rPool, rStyleName, SFX_STYLE_FAMILY_PARA, bForceName ); return lclMakeStyleSheet( rPool, rStyleName, SFX_STYLE_FAMILY_PARA, bForceName );
} }
ScStyleSheet& ScfTools::MakePageStyleSheet( ScStyleSheetPool& rPool, const String& rStyleName, bool bForceName ) ScStyleSheet& ScfTools::MakePageStyleSheet( ScStyleSheetPool& rPool, const OUString& rStyleName, bool bForceName )
{ {
return lclMakeStyleSheet( rPool, rStyleName, SFX_STYLE_FAMILY_PAGE, bForceName ); return lclMakeStyleSheet( rPool, rStyleName, SFX_STYLE_FAMILY_PAGE, bForceName );
} }
...@@ -277,32 +277,32 @@ void ScfTools::AppendCString( SvStream& rStrm, String& rString, rtl_TextEncoding ...@@ -277,32 +277,32 @@ void ScfTools::AppendCString( SvStream& rStrm, String& rString, rtl_TextEncoding
// *** HTML table names <-> named range names *** ----------------------------- // *** HTML table names <-> named range names *** -----------------------------
const String& ScfTools::GetHTMLDocName() const OUString& ScfTools::GetHTMLDocName()
{ {
static const String saHTMLDoc( RTL_CONSTASCII_USTRINGPARAM( "HTML_all" ) ); static const OUString saHTMLDoc( "HTML_all" );
return saHTMLDoc; return saHTMLDoc;
} }
const String& ScfTools::GetHTMLTablesName() const OUString& ScfTools::GetHTMLTablesName()
{ {
static const String saHTMLTables( RTL_CONSTASCII_USTRINGPARAM( "HTML_tables" ) ); static const OUString saHTMLTables( "HTML_tables" );
return saHTMLTables; return saHTMLTables;
} }
const String& ScfTools::GetHTMLIndexPrefix() const String& ScfTools::GetHTMLIndexPrefix()
{ {
static const String saHTMLIndexPrefix( RTL_CONSTASCII_USTRINGPARAM( "HTML_" ) ); static const String saHTMLIndexPrefix( "HTML_" );
return saHTMLIndexPrefix; return saHTMLIndexPrefix;
} }
const String& ScfTools::GetHTMLNamePrefix() const String& ScfTools::GetHTMLNamePrefix()
{ {
static const String saHTMLNamePrefix( RTL_CONSTASCII_USTRINGPARAM( "HTML__" ) ); static const String saHTMLNamePrefix( "HTML__" );
return saHTMLNamePrefix; return saHTMLNamePrefix;
} }
String ScfTools::GetNameFromHTMLIndex( sal_uInt32 nIndex ) OUString ScfTools::GetNameFromHTMLIndex( sal_uInt32 nIndex )
{ {
OUString aName = GetHTMLIndexPrefix() + OUString aName = GetHTMLIndexPrefix() +
OUString::number( static_cast< sal_Int32 >( nIndex ) ); OUString::number( static_cast< sal_Int32 >( nIndex ) );
...@@ -316,19 +316,19 @@ String ScfTools::GetNameFromHTMLName( const String& rTabName ) ...@@ -316,19 +316,19 @@ String ScfTools::GetNameFromHTMLName( const String& rTabName )
return aName; return aName;
} }
bool ScfTools::IsHTMLDocName( const String& rSource ) bool ScfTools::IsHTMLDocName( const OUString& rSource )
{ {
return rSource.EqualsIgnoreCaseAscii( GetHTMLDocName() ); return rSource.equalsIgnoreAsciiCase( GetHTMLDocName() );
} }
bool ScfTools::IsHTMLTablesName( const String& rSource ) bool ScfTools::IsHTMLTablesName( const OUString& rSource )
{ {
return rSource.EqualsIgnoreCaseAscii( GetHTMLTablesName() ); return rSource.equalsIgnoreAsciiCase( GetHTMLTablesName() );
} }
bool ScfTools::GetHTMLNameFromName( const String& rSource, String& rName ) bool ScfTools::GetHTMLNameFromName( const String& rSource, OUString& rName )
{ {
rName.Erase(); rName = "";
if( rSource.EqualsIgnoreCaseAscii( GetHTMLNamePrefix(), 0, GetHTMLNamePrefix().Len() ) ) if( rSource.EqualsIgnoreCaseAscii( GetHTMLNamePrefix(), 0, GetHTMLNamePrefix().Len() ) )
{ {
rName = rSource.Copy( GetHTMLNamePrefix().Len() ); rName = rSource.Copy( GetHTMLNamePrefix().Len() );
...@@ -336,11 +336,11 @@ bool ScfTools::GetHTMLNameFromName( const String& rSource, String& rName ) ...@@ -336,11 +336,11 @@ bool ScfTools::GetHTMLNameFromName( const String& rSource, String& rName )
} }
else if( rSource.EqualsIgnoreCaseAscii( GetHTMLIndexPrefix(), 0, GetHTMLIndexPrefix().Len() ) ) else if( rSource.EqualsIgnoreCaseAscii( GetHTMLIndexPrefix(), 0, GetHTMLIndexPrefix().Len() ) )
{ {
String aIndex( rSource.Copy( GetHTMLIndexPrefix().Len() ) ); OUString aIndex( rSource.Copy( GetHTMLIndexPrefix().Len() ) );
if( CharClass::isAsciiNumeric( aIndex ) && (aIndex.ToInt32() > 0) ) if( CharClass::isAsciiNumeric( aIndex ) && (aIndex.toInt32() > 0) )
rName = aIndex; rName = aIndex;
} }
return rName.Len() > 0; return rName.getLength() > 0;
} }
ScFormatFilterPluginImpl::ScFormatFilterPluginImpl() {} ScFormatFilterPluginImpl::ScFormatFilterPluginImpl() {}
......
...@@ -146,7 +146,7 @@ public: ...@@ -146,7 +146,7 @@ public:
/** Returns system text encoding for byte string conversion. */ /** Returns system text encoding for byte string conversion. */
static rtl_TextEncoding GetSystemTextEncoding(); static rtl_TextEncoding GetSystemTextEncoding();
/** Returns a string representing the hexadecimal value of nValue. */ /** Returns a string representing the hexadecimal value of nValue. */
static String GetHexStr( sal_uInt16 nValue ); static OUString GetHexStr( sal_uInt16 nValue );
/** Mixes RGB components with given transparence. /** Mixes RGB components with given transparence.
@param nTrans Foreground transparence (0x00 == full nFore ... 0x80 = full nBack). */ @param nTrans Foreground transparence (0x00 == full nFore ... 0x80 = full nBack). */
...@@ -212,14 +212,14 @@ public: ...@@ -212,14 +212,14 @@ public:
true = Old existing style will be renamed; false = New style gets another name. */ true = Old existing style will be renamed; false = New style gets another name. */
static ScStyleSheet& MakeCellStyleSheet( static ScStyleSheet& MakeCellStyleSheet(
ScStyleSheetPool& rPool, ScStyleSheetPool& rPool,
const String& rStyleName, bool bForceName ); const OUString& rStyleName, bool bForceName );
/** Creates and returns a page style sheet and inserts it into the pool. /** Creates and returns a page style sheet and inserts it into the pool.
@descr If the style sheet is already in the pool, another unused style name is used. @descr If the style sheet is already in the pool, another unused style name is used.
@param bForceName Controls behaviour, if the style already exists: @param bForceName Controls behaviour, if the style already exists:
true = Old existing style will be renamed; false = New style gets another name. */ true = Old existing style will be renamed; false = New style gets another name. */
static ScStyleSheet& MakePageStyleSheet( static ScStyleSheet& MakePageStyleSheet(
ScStyleSheetPool& rPool, ScStyleSheetPool& rPool,
const String& rStyleName, bool bForceName ); const OUString& rStyleName, bool bForceName );
// *** byte string import operations *** -------------------------------------- // *** byte string import operations *** --------------------------------------
...@@ -237,23 +237,23 @@ public: ...@@ -237,23 +237,23 @@ public:
// *** HTML table names <-> named range names *** ----------------------------- // *** HTML table names <-> named range names *** -----------------------------
/** Returns the built-in range name for an HTML document. */ /** Returns the built-in range name for an HTML document. */
static const String& GetHTMLDocName(); static const OUString& GetHTMLDocName();
/** Returns the built-in range name for all HTML tables. */ /** Returns the built-in range name for all HTML tables. */
static const String& GetHTMLTablesName(); static const OUString& GetHTMLTablesName();
/** Returns the built-in range name for an HTML table, specified by table index. */ /** Returns the built-in range name for an HTML table, specified by table index. */
static String GetNameFromHTMLIndex( sal_uInt32 nIndex ); static OUString GetNameFromHTMLIndex( sal_uInt32 nIndex );
/** Returns the built-in range name for an HTML table, specified by table name. */ /** Returns the built-in range name for an HTML table, specified by table name. */
static String GetNameFromHTMLName( const String& rTabName ); static String GetNameFromHTMLName( const String& rTabName );
/** Returns true, if rSource is the built-in range name for an HTML document. */ /** Returns true, if rSource is the built-in range name for an HTML document. */
static bool IsHTMLDocName( const String& rSource ); static bool IsHTMLDocName( const OUString& rSource );
/** Returns true, if rSource is the built-in range name for all HTML tables. */ /** Returns true, if rSource is the built-in range name for all HTML tables. */
static bool IsHTMLTablesName( const String& rSource ); static bool IsHTMLTablesName( const OUString& rSource );
/** Converts a built-in range name to an HTML table name. /** Converts a built-in range name to an HTML table name.
@param rSource The string to be determined. @param rSource The string to be determined.
@param rName The HTML table name. @param rName The HTML table name.
@return true, if conversion was successful. */ @return true, if conversion was successful. */
static bool GetHTMLNameFromName( const String& rSource, String& rName ); static bool GetHTMLNameFromName( const String& rSource, OUString& rName );
private: private:
/** Returns the prefix for table index names. */ /** Returns the prefix for table index names. */
......
...@@ -88,7 +88,7 @@ void ScTPValidationValue::SetReferenceHdl( const ScRange&rRange , ScDocument* pD ...@@ -88,7 +88,7 @@ void ScTPValidationValue::SetReferenceHdl( const ScRange&rRange , ScDocument* pD
if ( m_pRefEdit ) if ( m_pRefEdit )
{ {
String aStr; OUString aStr;
rRange.Format( aStr, SCR_ABS_3D, pDoc ); rRange.Format( aStr, SCR_ABS_3D, pDoc );
m_pRefEdit->SetRefString( aStr ); m_pRefEdit->SetRefString( aStr );
} }
...@@ -250,18 +250,18 @@ ScConditionMode lclGetCondModeFromPos( sal_uInt16 nLbPos ) ...@@ -250,18 +250,18 @@ ScConditionMode lclGetCondModeFromPos( sal_uInt16 nLbPos )
@descr Keeps all empty strings. @descr Keeps all empty strings.
Example: abc\ndef\n\nghi -> "abc";"def";"";"ghi". Example: abc\ndef\n\nghi -> "abc";"def";"";"ghi".
@param rFmlaStr (out-param) The converted formula string. */ @param rFmlaStr (out-param) The converted formula string. */
void lclGetFormulaFromStringList( String& rFmlaStr, const String& rStringList, sal_Unicode cFmlaSep ) void lclGetFormulaFromStringList( OUString& rFmlaStr, const OUString& rStringList, sal_Unicode cFmlaSep )
{ {
rFmlaStr.Erase(); rFmlaStr = "";
xub_StrLen nTokenCnt = comphelper::string::getTokenCount(rStringList, '\n'); xub_StrLen nTokenCnt = comphelper::string::getTokenCount(rStringList, '\n');
for( sal_Int32 nToken = 0, nStringIx = 0; nToken < (sal_Int32) nTokenCnt; ++nToken ) for( sal_Int32 nToken = 0, nStringIx = 0; nToken < (sal_Int32) nTokenCnt; ++nToken )
{ {
String aToken( rStringList.GetToken( 0, '\n', nStringIx ) ); OUString aToken( rStringList.getToken( 0, '\n', nStringIx ) );
ScGlobal::AddQuotes( aToken, '"' ); ScGlobal::AddQuotes( aToken, '"' );
rFmlaStr = ScGlobal::addToken(rFmlaStr, aToken, cFmlaSep); rFmlaStr = ScGlobal::addToken(rFmlaStr, aToken, cFmlaSep);
} }
if( !rFmlaStr.Len() ) if( rFmlaStr.isEmpty() )
rFmlaStr.AssignAscii( "\"\"" ); rFmlaStr = "\"\"";
} }
...@@ -270,20 +270,20 @@ void lclGetFormulaFromStringList( String& rFmlaStr, const String& rStringList, s ...@@ -270,20 +270,20 @@ void lclGetFormulaFromStringList( String& rFmlaStr, const String& rStringList, s
Example: "abc";;;"def";"";"ghi" -> abc\ndef\n\nghi. Example: "abc";;;"def";"";"ghi" -> abc\ndef\n\nghi.
@param rStringList (out-param) The converted line feed separated string list. @param rStringList (out-param) The converted line feed separated string list.
@return true = Conversion successful. */ @return true = Conversion successful. */
bool lclGetStringListFromFormula( String& rStringList, const String& rFmlaStr, sal_Unicode cFmlaSep ) bool lclGetStringListFromFormula( OUString& rStringList, const OUString& rFmlaStr, sal_Unicode cFmlaSep )
{ {
String aQuotes( RTL_CONSTASCII_USTRINGPARAM( "\"\"" ) ); OUString aQuotes( "\"\"" );
xub_StrLen nTokenCnt = ScStringUtil::GetQuotedTokenCount(rFmlaStr, aQuotes, cFmlaSep ); sal_Int32 nTokenCnt = ScStringUtil::GetQuotedTokenCount(rFmlaStr, aQuotes, cFmlaSep );
rStringList.Erase(); rStringList="";
bool bIsStringList = (nTokenCnt > 0); bool bIsStringList = (nTokenCnt > 0);
bool bTokenAdded = false; bool bTokenAdded = false;
for( xub_StrLen nToken = 0, nStringIx = 0; bIsStringList && (nToken < nTokenCnt); ++nToken ) for( sal_Int32 nToken = 0, nStringIx = 0; bIsStringList && (nToken < nTokenCnt); ++nToken )
{ {
String aToken( ScStringUtil::GetQuotedToken(rFmlaStr, 0, aQuotes, cFmlaSep, nStringIx ) ); OUString aToken( ScStringUtil::GetQuotedToken(rFmlaStr, 0, aQuotes, cFmlaSep, nStringIx ) );
aToken = comphelper::string::strip(aToken, ' '); aToken = comphelper::string::strip(aToken, ' ');
if( aToken.Len() ) // ignore empty tokens, i.e. "a";;"b" if( aToken.getLength() ) // ignore empty tokens, i.e. "a";;"b"
{ {
bIsStringList = ScGlobal::IsQuoted( aToken, '"' ); bIsStringList = ScGlobal::IsQuoted( aToken, '"' );
if( bIsStringList ) if( bIsStringList )
...@@ -430,7 +430,7 @@ sal_Bool ScTPValidationValue::FillItemSet( SfxItemSet& rArgSet ) ...@@ -430,7 +430,7 @@ sal_Bool ScTPValidationValue::FillItemSet( SfxItemSet& rArgSet )
String ScTPValidationValue::GetFirstFormula() const String ScTPValidationValue::GetFirstFormula() const
{ {
String aFmlaStr; OUString aFmlaStr;
if( maLbAllow.GetSelectEntryPos() == SC_VALIDDLG_ALLOW_LIST ) if( maLbAllow.GetSelectEntryPos() == SC_VALIDDLG_ALLOW_LIST )
lclGetFormulaFromStringList( aFmlaStr, maEdList.GetText(), mcFmlaSep ); lclGetFormulaFromStringList( aFmlaStr, maEdList.GetText(), mcFmlaSep );
else else
...@@ -443,10 +443,10 @@ String ScTPValidationValue::GetSecondFormula() const ...@@ -443,10 +443,10 @@ String ScTPValidationValue::GetSecondFormula() const
return maEdMax.GetText(); return maEdMax.GetText();
} }
void ScTPValidationValue::SetFirstFormula( const String& rFmlaStr ) void ScTPValidationValue::SetFirstFormula( const OUString& rFmlaStr )
{ {
// try if formula is a string list, validation mode must already be set // try if formula is a string list, validation mode must already be set
String aStringList; OUString aStringList;
if( (maLbAllow.GetSelectEntryPos() == SC_VALIDDLG_ALLOW_RANGE) && if( (maLbAllow.GetSelectEntryPos() == SC_VALIDDLG_ALLOW_RANGE) &&
lclGetStringListFromFormula( aStringList, rFmlaStr, mcFmlaSep ) ) lclGetStringListFromFormula( aStringList, rFmlaStr, mcFmlaSep ) )
{ {
......
...@@ -187,7 +187,7 @@ private: ...@@ -187,7 +187,7 @@ private:
String GetFirstFormula() const; String GetFirstFormula() const;
String GetSecondFormula() const; String GetSecondFormula() const;
void SetFirstFormula( const String& rFmlaStr ); void SetFirstFormula( const OUString& rFmlaStr );
void SetSecondFormula( const String& rFmlaStr ); void SetSecondFormula( const String& rFmlaStr );
DECL_LINK(SelectHdl, void *); DECL_LINK(SelectHdl, void *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment