summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-10-28 13:20:52 +0200
committerNoel Grandin <noel@peralex.com>2013-11-05 13:18:14 +0200
commit3d65dfa3c98e0f79c579cfac23d55092f7554244 (patch)
tree492c438c7af8dc56240add22d259945b67ea130a /sc
parent9802db7ff181a9c4d15cc453725b63b82a941fff (diff)
convert xub_StrLen to sal_Int32
Converts code that calls comphelper::string::getTokenCount() to use sal_Int32 to store the return value. Change-Id: I439605a39d29b1309649e30f3ff40dfa412efcde
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/compiler.cxx7
-rw-r--r--sc/source/filter/excel/xecontent.cxx6
-rw-r--r--sc/source/filter/excel/xlformula.cxx4
-rw-r--r--sc/source/filter/html/htmlexp.cxx4
-rw-r--r--sc/source/filter/html/htmlimp.cxx4
-rw-r--r--sc/source/ui/dbgui/asciiopt.cxx8
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx4
-rw-r--r--sc/source/ui/dbgui/csvruler.cxx4
-rw-r--r--sc/source/ui/dbgui/fieldwnd.cxx4
-rw-r--r--sc/source/ui/dbgui/imoptdlg.cxx2
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx12
-rw-r--r--sc/source/ui/docshell/arealink.cxx2
-rw-r--r--sc/source/ui/docshell/docsh8.cxx2
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx4
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx4
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx4
17 files changed, 39 insertions, 40 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 5a7d8e277348..f640455ed730 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3272,14 +3272,13 @@ void ScCompiler::AutoCorrectParsedSymbol()
else if ( (GetCharTableFlags( c1, 0 ) & SC_COMPILER_C_CHAR_VALUE)
&& (GetCharTableFlags( c2, c2p ) & SC_COMPILER_C_CHAR_VALUE) )
{
- xub_StrLen nXcount;
- if ( (nXcount = comphelper::string::getTokenCount(aCorrectedSymbol, cx)) > 1 )
+ if ( comphelper::string::getTokenCount(aCorrectedSymbol, cx) > 1 )
{ // x => *
sal_Unicode c = mxSymbols->getSymbolChar(ocMul);
aCorrectedSymbol = aCorrectedSymbol.replaceAll(OUString(cx), OUString(c));
bCorrected = true;
}
- if ( (nXcount = comphelper::string::getTokenCount(aCorrectedSymbol, cX)) > 1 )
+ if ( comphelper::string::getTokenCount(aCorrectedSymbol, cX) > 1 )
{ // X => *
sal_Unicode c = mxSymbols->getSymbolChar(ocMul);
aCorrectedSymbol = aCorrectedSymbol.replaceAll(OUString(cX), OUString(c));
@@ -3297,7 +3296,7 @@ void ScCompiler::AutoCorrectParsedSymbol()
aDoc = aSymbol.copy(0, nPosition + 2);
aSymbol = aSymbol.copy(nPosition + 2);
}
- xub_StrLen nRefs = comphelper::string::getTokenCount(aSymbol, ':');
+ sal_Int32 nRefs = comphelper::string::getTokenCount(aSymbol, ':');
bool bColons;
if ( nRefs > 2 )
{ // duplicated or too many ':'? B:2::C10 => B2:C10
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 138ffa8f76c7..65eb8a214626 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1568,9 +1568,9 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
Data validity is BIFF8 only (important for the XclExpString object).
Excel uses the NUL character as string list separator. */
mxString1.reset( new XclExpString( EXC_STR_8BITLENGTH ) );
- xub_StrLen nTokenCnt = comphelper::string::getTokenCount(aString, '\n');
+ sal_Int32 nTokenCnt = comphelper::string::getTokenCount(aString, '\n');
sal_Int32 nStringIx = 0;
- for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken )
+ for( sal_Int32 nToken = 0; nToken < nTokenCnt; ++nToken )
{
OUString aToken( aString.getToken( 0, '\n', nStringIx ) );
if( nToken > 0 )
@@ -1807,7 +1807,7 @@ XclExpWebQuery::XclExpWebQuery(
mbEntireDoc( false )
{
// comma separated list of HTML table names or indexes
- xub_StrLen nTokenCnt = comphelper::string::getTokenCount(rSource, ';');
+ sal_Int32 nTokenCnt = comphelper::string::getTokenCount(rSource, ';');
OUString aNewTables;
OUString aAppendTable;
sal_Int32 nStringIx = 0;
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index 10cc2fe1ce1a..343a46ff2c81 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -797,9 +797,9 @@ void XclTokenArrayHelper::ConvertStringToList( ScTokenArray& rScTokArr, sal_Unic
if( GetString( aString, rScTokArr ) )
{
rScTokArr.Clear();
- xub_StrLen nTokenCnt = comphelper::string::getTokenCount(aString, cStringSep);
+ sal_Int32 nTokenCnt = comphelper::string::getTokenCount(aString, cStringSep);
sal_Int32 nStringIx = 0;
- for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken )
+ for( sal_Int32 nToken = 0; nToken < nTokenCnt; ++nToken )
{
OUString aToken( aString.getToken( 0, cStringSep, nStringIx ) );
if( bTrimLeadingSpaces )
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 0849729ffa4f..19910d8c5b2a 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -372,7 +372,7 @@ void ScHTMLExport::WriteHeader()
<< OOO_STRING_SVTOOLS_HTML_thead << "," << OOO_STRING_SVTOOLS_HTML_tbody << "," << OOO_STRING_SVTOOLS_HTML_tfoot << ","
<< OOO_STRING_SVTOOLS_HTML_tablerow << "," << OOO_STRING_SVTOOLS_HTML_tableheader << ","
<< OOO_STRING_SVTOOLS_HTML_tabledata << "," << OOO_STRING_SVTOOLS_HTML_parabreak << " { " << sFontFamily;
- xub_StrLen nFonts = comphelper::string::getTokenCount(aHTMLStyle.aFontFamilyName, ';');
+ sal_Int32 nFonts = comphelper::string::getTokenCount(aHTMLStyle.aFontFamilyName, ';');
if ( nFonts == 1 )
{
rStrm << '\"';
@@ -1075,7 +1075,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
{
aStr.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_face).
append(RTL_CONSTASCII_STRINGPARAM("=\""));
- xub_StrLen nFonts = comphelper::string::getTokenCount(rFontItem.GetFamilyName(), ';');
+ sal_Int32 nFonts = comphelper::string::getTokenCount(rFontItem.GetFamilyName(), ';');
if ( nFonts == 1 )
{
OString aTmpStr = HTMLOutFuncs::ConvertStringToHTML(
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx
index 482e5e577157..99544ba02368 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -211,9 +211,9 @@ OUString ScHTMLImport::GetHTMLRangeNameList( ScDocument* pDoc, const OUString& r
OUString aNewName;
ScRangeName* pRangeNames = pDoc->GetRangeName();
ScRangeList aRangeList;
- xub_StrLen nTokenCnt = comphelper::string::getTokenCount(rOrigName, ';');
+ sal_Int32 nTokenCnt = comphelper::string::getTokenCount(rOrigName, ';');
sal_Int32 nStringIx = 0;
- for( xub_StrLen nToken = 0; nToken < nTokenCnt; nToken++ )
+ for( sal_Int32 nToken = 0; nToken < nTokenCnt; nToken++ )
{
OUString aToken( rOrigName.getToken( 0, ';', nStringIx ) );
if( pRangeNames && ScfTools::IsHTMLTablesName( aToken ) )
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index d52d4aa32971..1072a89b71be 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -183,8 +183,8 @@ bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const
static OUString lcl_decodeSepString( const OUString & rSepNums, bool & o_bMergeFieldSeps )
{
OUString aFieldSeps;
- xub_StrLen nSub = comphelper::string::getTokenCount( rSepNums, '/');
- for (xub_StrLen i=0; i<nSub; ++i)
+ sal_Int32 nSub = comphelper::string::getTokenCount( rSepNums, '/');
+ for (sal_Int32 i=0; i<nSub; ++i)
{
OUString aCode = rSepNums.getToken( i, '/' );
if ( aCode.equalsAscii(pStrMrg) )
@@ -204,7 +204,7 @@ static OUString lcl_decodeSepString( const OUString & rSepNums, bool & o_bMergeF
void ScAsciiOptions::ReadFromString( const OUString& rString )
{
- xub_StrLen nCount = comphelper::string::getTokenCount(rString, ',');
+ sal_Int32 nCount = comphelper::string::getTokenCount(rString, ',');
OUString aToken;
// Field separator.
@@ -247,7 +247,7 @@ void ScAsciiOptions::ReadFromString( const OUString& rString )
delete[] pColFormat;
aToken = rString.getToken(4,',');
- xub_StrLen nSub = comphelper::string::getTokenCount(aToken, '/');
+ sal_Int32 nSub = comphelper::string::getTokenCount(aToken, '/');
nInfoCount = nSub / 2;
if (nInfoCount)
{
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 221da159997f..2440f850ff35 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -1071,9 +1071,9 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const OUString& rText )
/* #i60296# If string contains mixed script types, the space character
U+0020 may be drawn with a wrong width (from non-fixed-width Asian or
Complex font). Now we draw every non-space portion separately. */
- xub_StrLen nTokenCount = comphelper::string::getTokenCount(aPlainText, ' ');
+ sal_Int32 nTokenCount = comphelper::string::getTokenCount(aPlainText, ' ');
sal_Int32 nCharIxInt = 0;
- for( xub_StrLen nToken = 0; nToken < nTokenCount; ++nToken )
+ for( sal_Int32 nToken = 0; nToken < nTokenCount; ++nToken )
{
sal_Int32 nBeginIx = nCharIxInt;
OUString aToken = aPlainText.getToken( 0, ' ', nCharIxInt );
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index 3ea0d517fc18..0363c09485d4 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -62,8 +62,8 @@ static void load_FixedWidthList(ScCsvSplits &aSplits)
sSplits = sFixedWidthLists;
// String ends with a semi-colon so there is no 'int' after the last one.
- xub_StrLen n = comphelper::string::getTokenCount(sSplits, ';') - 1;
- for (xub_StrLen i = 0; i < n; ++i)
+ sal_Int32 n = comphelper::string::getTokenCount(sSplits, ';') - 1;
+ for (sal_Int32 i = 0; i < n; ++i)
aSplits.Insert( sSplits.getToken(i, ';').toInt32() );
}
}
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 717867bad9c4..ca91ab663bb3 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -579,10 +579,10 @@ void ScDPFieldControlBase::DrawBackground( OutputDevice& rDev )
support hard line breaks here. This part will draw each line of the
text for itself. */
- xub_StrLen nTokenCnt = comphelper::string::getTokenCount(GetText(), '\n');
+ sal_Int32 nTokenCnt = comphelper::string::getTokenCount(GetText(), '\n');
long nY = (aSize.Height() - nTokenCnt * rDev.GetTextHeight()) / 2;
sal_Int32 nStringIx = 0;
- for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken )
+ for( sal_Int32 nToken = 0; nToken < nTokenCnt; ++nToken )
{
OUString aLine( GetText().getToken( 0, '\n', nStringIx ) );
Point aLinePos( (aSize.Width() - rDev.GetCtrlTextWidth( aLine )) / 2, nY );
diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx
index 56d4b74851fd..fd2a18a136b6 100644
--- a/sc/source/ui/dbgui/imoptdlg.cxx
+++ b/sc/source/ui/dbgui/imoptdlg.cxx
@@ -45,7 +45,7 @@ ScImportOptions::ScImportOptions( const OUString& rStr )
bSaveAsShown = sal_True; // "true" if not in string (after CSV import)
bQuoteAllText = false;
bSaveFormulas = false;
- xub_StrLen nTokenCount = comphelper::string::getTokenCount(rStr, ',');
+ sal_Int32 nTokenCount = comphelper::string::getTokenCount(rStr, ',');
if ( nTokenCount >= 3 )
{
// first 3 tokens: common
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 5e2720a1a149..87aa28c7daf7 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -62,8 +62,8 @@ using namespace com::sun::star::uno;
static void lcl_FillCombo( ComboBox& rCombo, const OUString& rList, sal_Unicode cSelect )
{
- xub_StrLen i;
- xub_StrLen nCount = comphelper::string::getTokenCount(rList, '\t');
+ sal_Int32 i;
+ sal_Int32 nCount = comphelper::string::getTokenCount(rList, '\t');
for ( i=0; i<nCount; i+=2 )
rCombo.InsertEntry( rList.getToken(i,'\t') );
@@ -86,8 +86,8 @@ static sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const OUString& rList )
OUString aStr = rCombo.GetText();
if ( !aStr.isEmpty() )
{
- xub_StrLen nCount = comphelper::string::getTokenCount(rList, '\t');
- for ( xub_StrLen i=0; i<nCount; i+=2 )
+ sal_Int32 nCount = comphelper::string::getTokenCount(rList, '\t');
+ for ( sal_Int32 i=0; i<nCount; i+=2 )
{
if ( ScGlobal::GetpTransliteration()->isEqual( aStr, rList.getToken(i,'\t') ) )
c = (sal_Unicode)rList.getToken(i+1,'\t').toInt32();
@@ -404,8 +404,8 @@ ScImportAsciiDlg::ScImportAsciiDlg( Window* pParent,OUString aDatName,
pLbCustomLang->SelectLanguage(static_cast<LanguageType>(nLanguage), true);
// *** column type ListBox ***
- xub_StrLen nCount = comphelper::string::getTokenCount(aColumnUser, ';');
- for (xub_StrLen i=0; i<nCount; i++)
+ sal_Int32 nCount = comphelper::string::getTokenCount(aColumnUser, ';');
+ for (sal_Int32 i=0; i<nCount; i++)
pLbType->InsertEntry( aColumnUser.getToken( i, ';' ) );
pLbType->SetSelectHdl( LINK( this, ScImportAsciiDlg, LbColTypeHdl ) );
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 068ef32a482b..2069141d9aff 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -278,7 +278,7 @@ sal_Bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilt
// find total size of source area
SCCOL nWidth = 0;
SCROW nHeight = 0;
- xub_StrLen nTokenCnt = comphelper::string::getTokenCount(aTempArea, ';');
+ sal_Int32 nTokenCnt = comphelper::string::getTokenCount(aTempArea, ';');
sal_Int32 nStringIx = 0;
xub_StrLen nToken;
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 87a7226de05f..2df6c366875b 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -523,7 +523,7 @@ void lcl_GetColumnTypes(
{
aString = pDoc->GetString(nCol, nFirstRow, nTab);
aString = aString.toAsciiUpperCase();
- xub_StrLen nToken = comphelper::string::getTokenCount(aString, ',');
+ sal_Int32 nToken = comphelper::string::getTokenCount(aString, ',');
if ( nToken > 1 )
{
aFieldName = aString.getToken( 0, ',' );
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 1ec55dc6b69f..a94369211044 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -148,8 +148,8 @@ bool ScFormulaReferenceHelper::ParseWithNames( ScRangeList& rRanges, const OUStr
ScAddress::Details aDetails(pDoc->GetAddressConvention(), 0, 0);
ScRangeUtil aRangeUtil;
- xub_StrLen nTokenCnt = comphelper::string::getTokenCount(rStr, ';');
- for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken )
+ sal_Int32 nTokenCnt = comphelper::string::getTokenCount(rStr, ';');
+ for( sal_Int32 nToken = 0; nToken < nTokenCnt; ++nToken )
{
ScRange aRange;
OUString aRangeStr( rStr.getToken( nToken, ';' ) );
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index 830d0438e79d..af88fed007a3 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -175,8 +175,8 @@ void ScLinkedAreaDlg::InitFromOldLink( const OUString& rFile, const OUString& rF
UpdateSourceRanges();
- xub_StrLen nRangeCount = comphelper::string::getTokenCount(rSource, ';');
- for ( xub_StrLen i=0; i<nRangeCount; i++ )
+ sal_Int32 nRangeCount = comphelper::string::getTokenCount(rSource, ';');
+ for ( sal_Int32 i=0; i<nRangeCount; i++ )
{
OUString aRange = rSource.getToken(i,';');
m_pLbRanges->SelectEntry( aRange );
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 5fcb9bf0a74b..cf16ad40e2e7 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -314,9 +314,9 @@ void ScTpUserLists::MakeListStr( OUString& rListStr )
{
OUString aStr;
- xub_StrLen nToken = comphelper::string::getTokenCount(rListStr, LF);
+ sal_Int32 nToken = comphelper::string::getTokenCount(rListStr, LF);
- for(xub_StrLen i=0;i<nToken;i++)
+ for(sal_Int32 i=0; i<nToken; i++)
{
OUString aString = comphelper::string::strip(rListStr.getToken(i, LF), ' ');
aStr += aString;
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index d9d708365490..2c071e86d48f 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -372,8 +372,8 @@ sal_Bool ScPrintAreasDlg::Impl_CheckRefStrings()
ScAddress aAddr;
ScRange aRange;
- xub_StrLen nSepCount = comphelper::string::getTokenCount(aStrPrintArea, sep);
- for ( xub_StrLen i = 0; i < nSepCount && bPrintAreaOk; ++i )
+ sal_Int32 nSepCount = comphelper::string::getTokenCount(aStrPrintArea, sep);
+ for ( sal_Int32 i = 0; i < nSepCount && bPrintAreaOk; ++i )
{
OUString aOne = aStrPrintArea.getToken(i, sep);
sal_uInt16 nResult = aRange.Parse( aOne, pDoc, eConv );