From 3d65dfa3c98e0f79c579cfac23d55092f7554244 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 28 Oct 2013 13:20:52 +0200 Subject: 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 --- sc/source/core/tool/compiler.cxx | 7 +++---- sc/source/filter/excel/xecontent.cxx | 6 +++--- sc/source/filter/excel/xlformula.cxx | 4 ++-- sc/source/filter/html/htmlexp.cxx | 4 ++-- sc/source/filter/html/htmlimp.cxx | 4 ++-- sc/source/ui/dbgui/asciiopt.cxx | 8 ++++---- sc/source/ui/dbgui/csvgrid.cxx | 4 ++-- sc/source/ui/dbgui/csvruler.cxx | 4 ++-- sc/source/ui/dbgui/fieldwnd.cxx | 4 ++-- sc/source/ui/dbgui/imoptdlg.cxx | 2 +- sc/source/ui/dbgui/scuiasciiopt.cxx | 12 ++++++------ sc/source/ui/docshell/arealink.cxx | 2 +- sc/source/ui/docshell/docsh8.cxx | 2 +- sc/source/ui/miscdlgs/anyrefdg.cxx | 4 ++-- sc/source/ui/miscdlgs/linkarea.cxx | 4 ++-- sc/source/ui/optdlg/tpusrlst.cxx | 4 ++-- sc/source/ui/pagedlg/areasdlg.cxx | 4 ++-- 17 files changed, 39 insertions(+), 40 deletions(-) (limited to 'sc') 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= 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; iisEqual( 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(nLanguage), true); // *** column type ListBox *** - xub_StrLen nCount = comphelper::string::getTokenCount(aColumnUser, ';'); - for (xub_StrLen i=0; iInsertEntry( 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; iSelectEntry( 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