summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/stringutil.cxx
diff options
context:
space:
mode:
authorelixir <prashant3.yishu@gmail.com>2013-03-14 13:57:57 +0530
committerFridrich Strba <fridrich@documentfoundation.org>2013-03-14 22:12:59 +0000
commitb0cf3aba085373d84a55ef144b273a8a89d017af (patch)
treec467424c3517618299eccebbcd39b84f548d8eea /sc/source/core/tool/stringutil.cxx
parent36938e69d098c4e42d471963bc433dc914cebd57 (diff)
fdo#38838: Replaced some (Uni)String to OUString in core/sc
Change-Id: I4fa27b933c5b3cf2645b139bf6349b90f613feab Reviewed-on: https://gerrit.libreoffice.org/2735 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sc/source/core/tool/stringutil.cxx')
-rw-r--r--sc/source/core/tool/stringutil.cxx52
1 files changed, 26 insertions, 26 deletions
diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx
index 62e480410ed1..e196d6592502 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -183,22 +183,22 @@ bool ScStringUtil::parseSimpleNumber(
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.Search(cTok) );
+ assert( !(rQuotedPairs.getLength()%2) );
+ assert( rQuotedPairs.indexOf(cTok) );
// empty string: TokenCount is 0 per definition
- if ( !rIn.Len() )
+ if ( rIn.isEmpty() )
return 0;
- xub_StrLen nTokCount = 1;
- sal_Int32 nLen = rIn.Len();
- xub_StrLen nQuotedLen = rQuotedPairs.Len();
+ sal_Int32 nTokCount = 1;
+ sal_Int32 nLen = rIn.getLength();
+ sal_Int32 nQuotedLen = rQuotedPairs.getLength();
sal_Unicode cQuotedEndChar = 0;
- const sal_Unicode* pQuotedStr = rQuotedPairs.GetBuffer();
- const sal_Unicode* pStr = rIn.GetBuffer();
- sal_Int32 nIndex = 0;
+ const sal_Unicode* pQuotedStr = rQuotedPairs.getStr();
+ const sal_Unicode* pStr = rIn.getStr();
+ sal_Int32 nIndex = 0;
while ( nIndex < nLen )
{
sal_Unicode c = *pStr;
@@ -211,7 +211,7 @@ xub_StrLen ScStringUtil::GetQuotedTokenCount(const UniString &rIn, const UniStri
else
{
// Is the char a quote-beginn char ?
- xub_StrLen nQuoteIndex = 0;
+ sal_Int32 nQuoteIndex = 0;
while ( nQuoteIndex < nQuotedLen )
{
if ( pQuotedStr[nQuoteIndex] == c )
@@ -235,20 +235,20 @@ xub_StrLen ScStringUtil::GetQuotedTokenCount(const UniString &rIn, const UniStri
return nTokCount;
}
-UniString ScStringUtil::GetQuotedToken(const UniString &rIn, xub_StrLen nToken, const UniString& rQuotedPairs,
- sal_Unicode cTok, xub_StrLen& rIndex )
+OUString ScStringUtil::GetQuotedToken(const OUString &rIn, sal_Int32 nToken, const OUString& rQuotedPairs,
+ sal_Unicode cTok, sal_Int32& rIndex )
{
assert( !(rQuotedPairs.Len()%2) );
- assert( rQuotedPairs.Search(cTok) == STRING_NOTFOUND );
+ assert( rQuotedPairs.indexOf(cTok) == -1 );
- const sal_Unicode* pStr = rIn.GetBuffer();
- const sal_Unicode* pQuotedStr = rQuotedPairs.GetBuffer();
+ const sal_Unicode* pStr = rIn.getStr();
+ const sal_Unicode* pQuotedStr = rQuotedPairs.getStr();
sal_Unicode cQuotedEndChar = 0;
- xub_StrLen nQuotedLen = rQuotedPairs.Len();
- xub_StrLen nLen = rIn.Len();
- xub_StrLen nTok = 0;
- xub_StrLen nFirstChar = rIndex;
- xub_StrLen i = nFirstChar;
+ sal_Int32 nQuotedLen = rQuotedPairs.getLength();
+ sal_Int32 nLen = rIn.getLength();
+ sal_Int32 nTok = 0;
+ sal_Int32 nFirstChar = rIndex;
+ sal_Int32 i = nFirstChar;
// detect token position and length
pStr += i;
@@ -264,7 +264,7 @@ UniString ScStringUtil::GetQuotedToken(const UniString &rIn, xub_StrLen nToken,
else
{
// Is the char a quote-begin char ?
- xub_StrLen nQuoteIndex = 0;
+ sal_Int32 nQuoteIndex = 0;
while ( nQuoteIndex < nQuotedLen )
{
if ( pQuotedStr[nQuoteIndex] == c )
@@ -300,13 +300,13 @@ UniString ScStringUtil::GetQuotedToken(const UniString &rIn, xub_StrLen nToken,
if ( i < nLen )
rIndex = i+1;
else
- rIndex = STRING_NOTFOUND;
- return rIn.Copy( nFirstChar, i-nFirstChar );
+ rIndex = -1;
+ return rIn.copy( nFirstChar, i-nFirstChar );
}
else
{
- rIndex = STRING_NOTFOUND;
- return UniString();
+ rIndex = -1;
+ return OUString();
}
}