diff options
author | elixir <prashant3.yishu@gmail.com> | 2013-03-07 19:35:49 +0530 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-03-11 15:50:44 +0000 |
commit | 7d1f4cdec307bb1e761bb5dd3d8231bba5833e10 (patch) | |
tree | 106a20fe24e8935e9b4943f17dad49dba67aa013 | |
parent | c9d7427707ca36f60079833f53efd435202fe231 (diff) |
fdo#38838: Converting String/UniString to OUString
Change-Id: If64db96005fcd8a42e4fa24041867b99183965f9
Reviewed-on: https://gerrit.libreoffice.org/2586
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
66 files changed, 319 insertions, 301 deletions
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index cb843d621c50..f172160dc0dc 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -355,7 +355,7 @@ SbMethod* MacroChooser::CreateMacro() // extract the module name from the string like "Sheet1 (Example1)" if( aDesc.GetLibSubName() == IDE_RESSTR(RID_STR_DOCUMENT_OBJECTS) ) { - sal_uInt16 nIndex = 0; + sal_Int32 nIndex = 0; aModName = aModName.GetToken( 0, ' ', nIndex ); } pModule = pBasic->FindModule( aModName ); @@ -663,7 +663,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) // extract the module name from the string like "Sheet1 (Example1)" if( aDesc.GetLibSubName() == IDE_RESSTR(RID_STR_DOCUMENT_OBJECTS) ) { - sal_uInt16 nIndex = 0; + sal_Int32 nIndex = 0; aMod = aMod.GetToken( 0, ' ', nIndex ); } String aSub( aDesc.GetMethodName() ); diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 7bfbbf521fde..cc3bcc0076c5 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -1232,8 +1232,8 @@ void SvxScriptOrgDialog::RestorePreviousSelection() if( aStoredEntry.Len() <= 0 ) return; SvTreeListEntry* pEntry = 0; - sal_uInt16 nIndex = 0; - while ( nIndex != STRING_NOTFOUND ) + sal_Int32 nIndex = 0; + while ( nIndex != -1 ) { String aTmp( aStoredEntry.GetToken( 0, ';', nIndex ) ); SvTreeListEntry* pTmpEntry = m_pScriptsBox->FirstChild( pEntry ); diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 47f1f9bfffaf..23e37a9fd86c 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -1080,7 +1080,8 @@ void SvxJavaClassPathDlg::SetClassPath( const String& _rPath ) if ( m_sOldPath.Len() == 0 ) m_sOldPath = _rPath; m_aPathList.Clear(); - xub_StrLen i, nIdx = 0; + xub_StrLen i; + sal_Int32 nIdx = 0; xub_StrLen nCount = comphelper::string::getTokenCount(_rPath, CLASSPATH_DELIMITER); for ( i = 0; i < nCount; ++i ) { diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 6df09af10d58..2f11b4c86164 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -350,7 +350,7 @@ void OfaImpBrwString::Paint( aFont.SetWeight( WEIGHT_BOLD ); sal_Bool bFett = sal_True; - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; do { String sTxt( pUserData->pString->GetToken( 0, 1, nPos )); @@ -359,14 +359,14 @@ void OfaImpBrwString::Paint( rDev.DrawText( aNewPos, sTxt ); - if( STRING_NOTFOUND != nPos ) + if( -1 != nPos ) aNewPos.X() += rDev.GetTextWidth( sTxt ); if( bFett ) rDev.SetFont( aOldFont ); bFett = !bFett; - } while( STRING_NOTFOUND != nPos ); + } while( -1 != nPos ); } } diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index 8071cd81a163..3cb6690fcb32 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -386,8 +386,8 @@ void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor) { const String& rFace = rOption.GetString(); String aFontName; - xub_StrLen nPos = 0; - while( nPos != STRING_NOTFOUND ) + sal_Int32 nPos = 0; + while( nPos != -1 ) { // list fo fonts, VCL: semicolon as separator, HTML: comma String aFName = rFace.GetToken( 0, ',', nPos ); diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index db8aa6c6100d..d3144fc3ca71 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -163,7 +163,7 @@ sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cChar, let words own font substitution kick in */ rChrSet = RTL_TEXTENCODING_UNICODE; - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; rFontName = ::GetNextFontToken(rFontName, nIndex); } else diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 74bf784e7dd6..592005cc50f0 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -1467,8 +1467,8 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl if ( _bMultiExt ) { - sal_uInt16 nIdx = 0; - while ( !pFoundFilter && nIdx != STRING_NOTFOUND ) + sal_Int32 nIdx = 0; + while ( !pFoundFilter && nIdx != -1 ) { aSingleType = rType.GetToken( 0, FILEDIALOG_DEF_EXTSEP, nIdx ); #ifdef UNX @@ -3305,7 +3305,8 @@ void SvtFileDialog::appendDefaultExtension(String& _rFileName, if ( ! aType.EqualsAscii(FILEDIALOG_FILTER_ALL) ) { sal_uInt16 nWildCard = comphelper::string::getTokenCount(aType, FILEDIALOG_DEF_EXTSEP); - sal_uInt16 nIndex, nPos = 0; + sal_uInt16 nIndex; + sal_Int32 nPos = 0; for ( nIndex = 0; nIndex < nWildCard; nIndex++ ) { diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 74a496e3cbbb..b4850ca1cfb4 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3395,7 +3395,7 @@ void ScCompiler::AutoCorrectParsedSymbol() if ( nRefs > 2 ) { // duplicated or too many ':'? B:2::C10 => B2:C10 bColons = true; - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; String aTmp1( aSymbol.GetToken( 0, ':', nIndex ) ); xub_StrLen nLen1 = aTmp1.Len(); String aSym, aTmp2; diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 9a7b96e5e5e9..1ff94415f3f2 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -1558,7 +1558,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : Excel uses the NUL character as string list separator. */ mxString1.reset( new XclExpString( EXC_STR_8BITLENGTH ) ); xub_StrLen nTokenCnt = comphelper::string::getTokenCount(aString, '\n'); - xub_StrLen nStringIx = 0; + sal_Int32 nStringIx = 0; for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken ) { String aToken( aString.GetToken( 0, '\n', nStringIx ) ); @@ -1798,7 +1798,7 @@ XclExpWebQuery::XclExpWebQuery( // comma separated list of HTML table names or indexes xub_StrLen nTokenCnt = comphelper::string::getTokenCount(rSource, ';'); String aNewTables, aAppendTable; - xub_StrLen nStringIx = 0; + sal_Int32 nStringIx = 0; bool bExitLoop = false; for( xub_StrLen nToken = 0; (nToken < nTokenCnt) && !bExitLoop; ++nToken ) { diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index a96b263a4582..5c11ee546687 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -747,7 +747,7 @@ void XclTokenArrayHelper::ConvertStringToList( ScTokenArray& rScTokArr, sal_Unic { rScTokArr.Clear(); xub_StrLen nTokenCnt = comphelper::string::getTokenCount(aString, cStringSep); - xub_StrLen nStringIx = 0; + sal_Int32 nStringIx = 0; for( xub_StrLen nToken = 0; nToken < nTokenCnt; ++nToken ) { String aToken( aString.GetToken( 0, cStringSep, nStringIx ) ); diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index fbadc83613cc..e7c74b8a6c08 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -385,7 +385,7 @@ void ScHTMLExport::WriteHeader() { // Fontliste, VCL: Semikolon als Separator, // CSS1: Komma als Separator und jeder einzelne Fontname quoted const String& rList = aHTMLStyle.aFontFamilyName; - for ( xub_StrLen j = 0, nPos = 0; j < nFonts; j++ ) + for ( sal_Int32 j = 0, nPos = 0; j < (sal_Int32) nFonts; j++ ) { rStrm << '\"'; OUT_STR( rList.GetToken( 0, ';', nPos ) ); @@ -1109,7 +1109,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) else { // Fontliste, VCL: Semikolon als Separator, HTML: Komma const String& rList = rFontItem.GetFamilyName(); - for ( xub_StrLen j = 0, nPos = 0; j < nFonts; j++ ) + for ( sal_Int32 j = 0, nPos = 0; j < (sal_Int32)nFonts; j++ ) { rtl::OString aTmpStr = HTMLOutFuncs::ConvertStringToHTML( rList.GetToken( 0, ';', nPos ), eDestEnc, diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx index 98ff6f15610f..e833a8e4baf7 100644 --- a/sc/source/filter/html/htmlimp.cxx +++ b/sc/source/filter/html/htmlimp.cxx @@ -212,7 +212,7 @@ String ScHTMLImport::GetHTMLRangeNameList( ScDocument* pDoc, const String& rOrig ScRangeName* pRangeNames = pDoc->GetRangeName(); ScRangeList aRangeList; xub_StrLen nTokenCnt = comphelper::string::getTokenCount(rOrigName, ';'); - xub_StrLen nStringIx = 0; + sal_Int32 nStringIx = 0; for( xub_StrLen nToken = 0; nToken < nTokenCnt; nToken++ ) { String aToken( rOrigName.GetToken( 0, ';', nStringIx ) ); diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 717c1833324e..a0274f99fc29 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -1555,8 +1555,8 @@ void ScHTMLLayoutParser::FontOn( ImportInfo* pInfo ) { const String& rFace = rOption.GetString(); String aFontName; - xub_StrLen nPos = 0; - while( nPos != STRING_NOTFOUND ) + sal_Int32 nPos = 0; + while( nPos != -1 ) { // Fontliste, VCL: Semikolon als Separator, HTML: Komma String aFName = rFace.GetToken( 0, ',', nPos ); @@ -3068,8 +3068,8 @@ void ScHTMLQueryParser::FontOn( const ImportInfo& rInfo ) { const String& rFace = itr->GetString(); String aFontName; - xub_StrLen nPos = 0; - while( nPos != STRING_NOTFOUND ) + sal_Int32 nPos = 0; + while( nPos != -1 ) { // font list separator: VCL = ';' HTML = ',' String aFName = comphelper::string::strip(rFace.GetToken(0, ',', nPos), ' '); diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index 6da66eb86d05..74eaac258739 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -1072,10 +1072,10 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText ) 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, ' '); - xub_StrLen nCharIx = 0; + sal_Int32 nCharIx = 0; for( xub_StrLen nToken = 0; nToken < nTokenCount; ++nToken ) { - xub_StrLen nBeginIx = nCharIx; + sal_Int32 nBeginIx = nCharIx; String aToken = aPlainText.GetToken( 0, ' ', nCharIx ); if( aToken.Len() > 0 ) { @@ -1086,7 +1086,7 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText ) } nCharIx = 0; - while( (nCharIx = rText.Search( '\t', nCharIx )) != STRING_NOTFOUND ) + while( (nCharIx = rText.Search( '\t', nCharIx )) != -1 ) { sal_Int32 nX1 = rPos.X() + GetCharWidth() * nCharIx; sal_Int32 nX2 = nX1 + GetCharWidth() - 2; @@ -1099,7 +1099,7 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText ) ++nCharIx; } nCharIx = 0; - while( (nCharIx = rText.Search( '\n', nCharIx )) != STRING_NOTFOUND ) + while( (nCharIx = rText.Search( '\n', nCharIx )) != -1 ) { sal_Int32 nX1 = rPos.X() + GetCharWidth() * nCharIx; sal_Int32 nX2 = nX1 + GetCharWidth() - 2; diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 23f6a60f8fdb..f6ad414259eb 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -254,7 +254,7 @@ void lclGetFormulaFromStringList( String& rFmlaStr, const String& rStringList, s { rFmlaStr.Erase(); xub_StrLen nTokenCnt = comphelper::string::getTokenCount(rStringList, '\n'); - for( xub_StrLen nToken = 0, nStringIx = 0; nToken < nTokenCnt; ++nToken ) + for( sal_Int32 nToken = 0, nStringIx = 0; nToken < (sal_Int32) nTokenCnt; ++nToken ) { String aToken( rStringList.GetToken( 0, '\n', nStringIx ) ); ScGlobal::AddQuotes( aToken, '"' ); diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index 9ae886126c69..260801e160ca 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -278,7 +278,7 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter, SCCOL nWidth = 0; SCROW nHeight = 0; xub_StrLen nTokenCnt = comphelper::string::getTokenCount(aTempArea, ';'); - xub_StrLen nStringIx = 0; + sal_Int32 nStringIx = 0; xub_StrLen nToken; for( nToken = 0; nToken < nTokenCnt; nToken++ ) diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx index e277e96981b1..47aeac7ef63a 100644 --- a/sc/source/ui/view/hintwin.cxx +++ b/sc/source/ui/view/hintwin.cxx @@ -46,8 +46,8 @@ ScHintWindow::ScHintWindow( Window* pParent, const String& rTit, const String& r SetFont( aTextFont ); Size aTextSize; - xub_StrLen nIndex = 0; - while ( nIndex != STRING_NOTFOUND ) + sal_Int32 nIndex = 0; + while ( nIndex != -1 ) { String aLine = aMessage.GetToken( 0, CHAR_CR, nIndex ); Size aLineSize( GetTextWidth( aLine ), GetTextHeight() ); @@ -78,9 +78,9 @@ void ScHintWindow::Paint( const Rectangle& /* rRect */ ) DrawText( Point(HINT_MARGIN,HINT_MARGIN), aTitle ); SetFont( aTextFont ); - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; Point aLineStart = aTextStart; - while ( nIndex != STRING_NOTFOUND ) + while ( nIndex != -1 ) { String aLine = aMessage.GetToken( 0, CHAR_CR, nIndex ); DrawText( aLineStart, aLine ); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index a8537b66268d..42b4fb416e72 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -937,7 +937,7 @@ void ScPreviewShell::ReadUserData(const String& rData, sal_Bool /* bBrowse */) xub_StrLen nCount = comphelper::string::getTokenCount(rData, ';'); if (nCount) { - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; pPreview->SetZoom((sal_uInt16)rData.GetToken( 0, SC_USERDATA_SEP, nIndex ).ToInt32()); pPreview->SetPageNo(rData.GetToken( 0, SC_USERDATA_SEP, nIndex ).ToInt32()); eZoom = SVX_ZOOM_PERCENT; diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 798da8c280fb..0df98290416b 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -104,7 +104,7 @@ sal_Bool GetPosSizeFromString( const String& rStr, Point& rPos, Size& rSize ) if ( comphelper::string::getTokenCount(rStr, '/') != 4 ) return sal_False; - xub_StrLen nIdx = 0; + sal_Int32 nIdx = 0; rPos.X() = rStr.GetToken(0, '/', nIdx).ToInt32(); rPos.Y() = rStr.GetToken(0, '/', nIdx).ToInt32(); rSize.Width() = rStr.GetToken(0, '/', nIdx).ToInt32(); diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 91cf2e7bda07..32d3919cb822 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -238,7 +238,7 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * pLink, case OBJECT_CLIENT_GRF: case OBJECT_CLIENT_OLE: { - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; String sFile( sLNm.GetToken( 0, ::sfx2::cTokenSeperator, nPos ) ); String sRange( sLNm.GetToken( 0, ::sfx2::cTokenSeperator, nPos ) ); @@ -262,7 +262,7 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * pLink, break; case OBJECT_CLIENT_DDE: { - sal_uInt16 nTmp = 0; + sal_Int32 nTmp = 0; String sCmd( sLNm ); String sServer( sCmd.GetToken( 0, cTokenSeperator, nTmp ) ); String sTopic( sCmd.GetToken( 0, cTokenSeperator, nTmp ) ); diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 9cbd3b254e0a..f649c603f354 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -602,7 +602,7 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* pItemStt ) return 0; String sNm( rLinkName ); - sal_uInt16 nTokenPos = 0; + sal_Int32 nTokenPos = 0; rtl::OUString sService( sNm.GetToken( 0, cTokenSeperator, nTokenPos ) ); DdeServices& rSvc = DdeService::GetServices(); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 1bd5f8dd9bd8..40f9420ce361 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -320,7 +320,7 @@ void ContentListBox_Impl::InitRoot() { String aRow( pEntries[i] ); String aTitle, aURL; - xub_StrLen nIdx = 0; + sal_Int32 nIdx = 0; aTitle = aRow.GetToken( 0, '\t', nIdx ); aURL = aRow.GetToken( 0, '\t', nIdx ); sal_Unicode cFolder = aRow.GetToken( 0, '\t', nIdx ).GetChar(0); @@ -364,7 +364,7 @@ void ContentListBox_Impl::RequestingChildren( SvTreeListEntry* pParent ) { String aRow( pEntries[i] ); String aTitle, aURL; - xub_StrLen nIdx = 0; + sal_Int32 nIdx = 0; aTitle = aRow.GetToken( 0, '\t', nIdx ); aURL = aRow.GetToken( 0, '\t', nIdx ); sal_Unicode cFolder = aRow.GetToken( 0, '\t', nIdx ).GetChar(0); @@ -1082,7 +1082,7 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, SearchHdl) { String aRow( pFacs[i] ); String aTitle, aType; - xub_StrLen nIdx = 0; + sal_Int32 nIdx = 0; aTitle = aRow.GetToken( 0, '\t', nIdx ); aType = aRow.GetToken( 0, '\t', nIdx ); String* pURL = new String( aRow.GetToken( 0, '\t', nIdx ) ); @@ -1601,7 +1601,7 @@ void SfxHelpIndexWindow_Impl::Initialize() { String aRow( pFacs[i] ); String aTitle, aType, aURL; - xub_StrLen nIdx = 0; + sal_Int32 nIdx = 0; aTitle = aRow.GetToken( 0, '\t', nIdx ); aType = aRow.GetToken( 0, '\t', nIdx ); aURL = aRow.GetToken( 0, '\t', nIdx ); @@ -2952,7 +2952,7 @@ void SfxHelpWindow_Impl::LoadConfig() { aUserData = String( aTemp ); DBG_ASSERT( comphelper::string::getTokenCount(aUserData, ';') == 6, "invalid user data" ); - sal_uInt16 nIdx = 0; + sal_Int32 nIdx = 0; nIndexSize = aUserData.GetToken( 0, ';', nIdx ).ToInt32(); nTextSize = aUserData.GetToken( 0, ';', nIdx ).ToInt32(); sal_Int32 nWidth = aUserData.GetToken( 0, ';', nIdx ).ToInt32(); diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx index 7d7c45ad8cab..c5745f09da26 100644 --- a/sfx2/source/dialog/srchdlg.cxx +++ b/sfx2/source/dialog/srchdlg.cxx @@ -89,7 +89,7 @@ void SearchDialog::LoadConfig() { String sUserData( aTemp ); DBG_ASSERT( comphelper::string::getTokenCount(sUserData, ';') == 5, "invalid config data" ); - xub_StrLen nIdx = 0; + sal_Int32 nIdx = 0; String sSearchText = sUserData.GetToken( 0, ';', nIdx ); m_aWholeWordsBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 ); m_aMatchCaseBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 ); @@ -97,7 +97,7 @@ void SearchDialog::LoadConfig() m_aBackwardsBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 ); nIdx = 0; - while ( nIdx != STRING_NOTFOUND ) + while ( nIdx != -1 ) m_aSearchEdit.InsertEntry( sSearchText.GetToken( 0, '\t', nIdx ) ); m_aSearchEdit.SelectEntryPos(0); } diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index dfb0a1095a54..5b021fb8341b 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1599,7 +1599,7 @@ void SvtFileView::SetConfigString( const String& rCfgStr ) HeaderBar* pBar = mpImp->mpView->GetHeaderBar(); DBG_ASSERT( pBar, "invalid headerbar" ); - sal_uInt16 nIdx = 0; + sal_Int32 nIdx = 0; mpImp->mnSortColumn = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); sal_Bool bUp = (sal_Bool)(sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); HeaderBarItemBits nBits = pBar->GetItemBits( mpImp->mnSortColumn ); @@ -1616,7 +1616,7 @@ void SvtFileView::SetConfigString( const String& rCfgStr ) } pBar->SetItemBits( mpImp->mnSortColumn, nBits ); - while ( nIdx != STRING_NOTFOUND ) + while ( nIdx != -1 ) { sal_uInt16 nItemId = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32(); pBar->SetItemSize( nItemId, rCfgStr.GetToken( 0, ';', nIdx ).ToInt32() ); diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx index 185e0246f5a3..263404c171de 100644 --- a/svtools/source/urlobj/inetimg.cxx +++ b/svtools/source/urlobj/inetimg.cxx @@ -64,7 +64,7 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat ) case SOT_FORMATSTR_ID_INET_IMAGE: { String sINetImg = read_zeroTerminated_uInt8s_ToOUString(rIStm, RTL_TEXTENCODING_UTF8); - xub_StrLen nStart = 0; + sal_Int32 nStart = 0; aImageURL = sINetImg.GetToken( 0, TOKEN_SEPARATOR, nStart ); aTargetURL = sINetImg.GetToken( 0, TOKEN_SEPARATOR, nStart ); aTargetFrame = sINetImg.GetToken( 0, TOKEN_SEPARATOR, nStart ); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index d70655729706..2e4ae8187393 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -598,9 +598,9 @@ static sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName ) // ([Number]+\.)+ (as a regular expression!) // (Number follwed by a period, with 5 repetitions) // i.e.: "1.1.", "1.", "1.1.1." - xub_StrLen nPos = 0; + sal_Int32 nPos = 0; String sNum = rName.GetToken( 0, '.', nPos ); - if( STRING_NOTFOUND == nPos ) + if( -1 == nPos ) return USHRT_MAX; // invalid number! sal_uInt16 nLevelVal[ MAXLEVEL ]; // numbers of all levels @@ -608,7 +608,7 @@ static sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName ) sal_uInt8 nLevel = 0; String sName( rName ); - while( STRING_NOTFOUND != nPos ) + while( -1 != nPos ) { sal_uInt16 nVal = 0; sal_Unicode c; @@ -630,7 +630,7 @@ static sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName ) sNum = sName.GetToken( 0, '.', nPos ); // #i4533# without this check all parts delimited by a dot are treated as outline numbers if(!comphelper::string::isdigitAsciiString(sNum)) - nPos = STRING_NOTFOUND; + nPos = -1; } rName = sName; // that's the follow-up text @@ -643,7 +643,7 @@ static sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName ) SwTxtNode* pNd; nPos = 0; // search in the existing outline nodes for the required outline num array - for( ; nPos < rOutlNds.size(); ++nPos ) + for( ; nPos < (sal_Int32) rOutlNds.size(); ++nPos ) { pNd = rOutlNds[ nPos ]->GetTxtNode(); const int nLvl = pNd->GetAttrOutlineLevel()-1; //<-end,zhaojianwei @@ -679,7 +679,7 @@ static sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName ) } } } - if( nPos >= rOutlNds.size() ) + if( nPos >= (sal_Int32) rOutlNds.size() ) nPos = USHRT_MAX; return nPos; } @@ -710,10 +710,10 @@ bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const //#i4533# leading numbers followed by a dot have been remove while //searching for the outline position //to compensate this they must be removed from the paragraphs text content, too - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; String sTempNum; while(sExpandedText.Len() && (sTempNum = sExpandedText.GetToken(0, '.', nPos)).Len() && - STRING_NOTFOUND != nPos && + -1 != nPos && comphelper::string::isdigitAsciiString(sTempNum)) { sExpandedText.Erase(0, nPos); diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index 8737885e0385..598547f6abfb 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -382,7 +382,7 @@ void SwEditShell::ApplyAutoMark() { String sLine(rtl::OStringToOUString(aRdLine, eChrSet)); - xub_StrLen nTokenPos = 0; + sal_Int32 nTokenPos = 0; String sToSelect( sLine.GetToken(0, ';', nTokenPos ) ); if( sToSelect.Len() ) { diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 5cb84001fabe..5a2e88a3e3f0 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1339,13 +1339,13 @@ SwHiddenTxtField::SwHiddenTxtField( SwHiddenTxtFieldType* pFldType, { if(nSubType == TYP_CONDTXTFLD) { - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; aTRUETxt = rStr.GetToken(0, '|', nPos); - if(nPos != STRING_NOTFOUND) + if(nPos != -1) { aFALSETxt = rStr.GetToken(0, '|', nPos); - if(nPos != STRING_NOTFOUND) + if(nPos != -1) { aContent = rStr.GetToken(0, '|', nPos); bValid = sal_True; @@ -1507,7 +1507,7 @@ void SwHiddenTxtField::SetPar2(const rtl::OUString& rStr) if (nSubType == TYP_CONDTXTFLD) { sal_Int32 nPos = rStr.indexOf('|'); - if (nPos == STRING_NOTFOUND) + if (nPos == -1) aTRUETxt = rStr; else { diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 77af7de971df..4407919bb519 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -722,7 +722,7 @@ bool SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, sal_uInt16* pP ) const //#59900# Die Sortierung soll die Nummer korrekt einordnen //also "10" nach "9" und nicht "10" nach "1" const String& rTmp2 = rNew.sDlgEntry; - xub_StrLen nFndPos2 = 0; + sal_Int32 nFndPos2 = 0; String sNum2( rTmp2.GetToken( 0, ' ', nFndPos2 )); sal_Bool bIsNum2IsNumeric = rCC.isAsciiNumeric( sNum2 ); sal_Int32 nNum2 = bIsNum2IsNumeric ? sNum2.ToInt32() : 0; @@ -735,7 +735,7 @@ bool SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, sal_uInt16* pP ) const //#59900# Die Sortierung soll die Nummer korrekt einordnen //also "10" nach "9" und nicht "10" nach "1" const String& rTmp1 = maData[nM]->sDlgEntry; - xub_StrLen nFndPos1 = 0; + sal_Int32 nFndPos1 = 0; String sNum1( rTmp1.GetToken( 0, ' ', nFndPos1 )); sal_Int32 nCmp; diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index a55543002089..b30c26d93aeb 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -614,7 +614,7 @@ void SwGrfNode::InsertLink( const String& rGrfName, const String& rFltName ) refLink->SetVisible( pIDLA->IsVisibleLinks() ); if( rFltName.EqualsAscii( "DDE" )) { - sal_uInt16 nTmp = 0; + sal_Int32 nTmp = 0; String sApp, sTopic, sItem; sApp = rGrfName.GetToken( 0, sfx2::cTokenSeperator, nTmp ); sTopic = rGrfName.GetToken( 0, sfx2::cTokenSeperator, nTmp ); diff --git a/sw/source/core/swg/SwXMLBlockExport.cxx b/sw/source/core/swg/SwXMLBlockExport.cxx index 9239474f68bc..d35b5cf40323 100644 --- a/sw/source/core/swg/SwXMLBlockExport.cxx +++ b/sw/source/core/swg/SwXMLBlockExport.cxx @@ -121,13 +121,13 @@ sal_uInt32 SwXMLTextBlockExport::exportDoc(const String &rText) { SvXMLElementExport aBody (*this, XML_NAMESPACE_OFFICE, XML_BODY, sal_True, sal_True); { - xub_StrLen nPos = 0; + sal_Int32 nPos = 0; do { String sTemp ( rText.GetToken( 0, '\015', nPos ) ); SvXMLElementExport aPara (*this, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False); GetDocHandler()->characters(sTemp); - } while (STRING_NOTFOUND != nPos ); + } while (-1 != nPos ); } } diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index 98f9eb130273..f8759ae859f7 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -595,7 +595,7 @@ void SwXMLTextBlocks::MakeBlockText( const String& rText ) if( pTxtNode->GetTxtColl() == pDoc->GetDfltTxtFmtColl() ) pTxtNode->ChgFmtColl( pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD )); - xub_StrLen nPos = 0; + sal_Int32 nPos = 0; do { if ( nPos ) @@ -605,7 +605,7 @@ void SwXMLTextBlocks::MakeBlockText( const String& rText ) SwIndex aIdx( pTxtNode ); String sTemp(rText.GetToken( 0, '\015', nPos ) ); pTxtNode->InsertText( sTemp, aIdx ); - } while ( STRING_NOTFOUND != nPos ); + } while ( -1 != nPos ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 3af6dfc5c5e1..2ec74e74015a 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2471,7 +2471,7 @@ static sal_uInt16 lcl_GetIdByName( String& rName, String& rTypeName ) rName.Erase(0, 30); sal_uInt16 nResId = USHRT_MAX; - xub_StrLen nFound = 0; + sal_Int32 nFound = 0; rTypeName = rName.GetToken( 0, '.', nFound ); if(rTypeName.EqualsAscii("User")) nResId = RES_USERFLD; diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 51bce34ebad7..243774fd8695 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -602,7 +602,7 @@ String NameFromCharSet(rtl_TextEncoding nChrSet) void SwAsciiOptions::ReadUserData( const String& rStr ) { - xub_StrLen nToken = 0; + sal_Int32 nToken = 0; sal_uInt16 nCnt = 0; String sToken; do { @@ -630,7 +630,7 @@ void SwAsciiOptions::ReadUserData( const String& rStr ) } } ++nCnt; - } while( STRING_NOTFOUND != nToken ); + } while( -1 != nToken ); } void SwAsciiOptions::WriteUserData( String& rStr ) diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 8dca8b746394..561fc483cd45 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -1170,8 +1170,8 @@ void SwHTMLWriter::PrepareFontList( const SvxFontItem& rFontItem, sal_Bool bContainsKeyword = sal_False; if( rName.Len() ) { - xub_StrLen nStrPos = 0; - while( nStrPos != STRING_NOTFOUND ) + sal_Int32 nStrPos = 0; + while( nStrPos != -1 ) { String aName = rName.GetToken( 0, ';', nStrPos ); aName = comphelper::string::strip(aName, ' '); diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index f03b7614ae97..41d488ed39ef 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -826,10 +826,10 @@ static void lcl_html_setEvents( for( i=0; i< rUnoMacroTbl.size(); i++ ) { const String& rStr(rUnoMacroTbl[i]); - xub_StrLen nIndex = 0; - if( !rStr.GetToken( 0, '-', nIndex ).Len() || STRING_NOTFOUND == nIndex ) + sal_Int32 nIndex = 0; + if( !rStr.GetToken( 0, '-', nIndex ).Len() || -1 == nIndex ) continue; - if( !rStr.GetToken( 0, '-', nIndex ).Len() || STRING_NOTFOUND == nIndex ) + if( !rStr.GetToken( 0, '-', nIndex ).Len() || -1 == nIndex ) continue; if( nIndex < rStr.Len() ) nEvents++; @@ -859,13 +859,13 @@ static void lcl_html_setEvents( for( i=0; i< rUnoMacroTbl.size(); ++i ) { const String& rStr = rUnoMacroTbl[i]; - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; String sListener( rStr.GetToken( 0, '-', nIndex ) ); - if( !sListener.Len() || STRING_NOTFOUND == nIndex ) + if( !sListener.Len() || -1 == nIndex ) continue; String sMethod( rStr.GetToken( 0, '-', nIndex ) ); - if( !sMethod.Len() || STRING_NOTFOUND == nIndex ) + if( !sMethod.Len() || -1 == nIndex ) continue; String sCode( rStr.Copy( nIndex ) ); diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 3be35bdaaf6e..2973f6144cf4 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -1301,8 +1301,8 @@ Writer& OutHTML_DrawFrmFmtAsControl( Writer& rWrt, if( sVal.Len() ) { sVal = convertLineEnd(sVal, LINEEND_LF); - xub_StrLen nPos = 0; - while ( nPos != STRING_NOTFOUND ) + sal_Int32 nPos = 0; + while ( nPos != -1 ) { if( nPos ) rWrt.Strm() << SwHTMLWriter::sNewLine; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 48113a6a02cb..9d8d8db2f6a3 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -3771,8 +3771,8 @@ void SwHTMLParser::NewFontAttr( int nToken ) } sal_Bool bFound = sal_False; - xub_StrLen nStrPos = 0; - while( nStrPos!=STRING_NOTFOUND ) + sal_Int32 nStrPos = 0; + while( nStrPos!= -1 ) { String aFName = aFace.GetToken( 0, ',', nStrPos ); aFName = comphelper::string::strip(aFName, ' '); diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 8e7084522367..31f6d89dca34 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -633,7 +633,7 @@ namespace sw bool IsStarSymbol(const rtl::OUString &rFontName) { - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; rtl::OUString sFamilyNm(GetNextFontToken(rFontName, nIndex)); return (sFamilyNm.equalsIgnoreAsciiCase("starsymbol") || sFamilyNm.equalsIgnoreAsciiCase("opensymbol")); diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index b4afcffff739..f5e1f530c31f 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -453,10 +453,10 @@ namespace sw FontMapExport::FontMapExport(const String &rFamilyName) { - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; msPrimary = GetNextFontToken(rFamilyName, nIndex); msSecondary = myImplHelpers::FindBestMSSubstituteFont(msPrimary); - if (!msSecondary.Len() && nIndex != STRING_NOTFOUND) + if (!msSecondary.Len() && nIndex != -1) msSecondary = GetNextFontToken(rFamilyName, nIndex); } @@ -735,14 +735,14 @@ namespace sw SwapQuotesInField(rParams); // Force to Japanese when finding one of 'geaE' - rtl::OUString sJChars( "geE" ); + OUString sJChars( "geE" ); bool bForceJapanese = ( STRING_NOTFOUND != rParams.SearchChar( sJChars.getStr() ) ); if ( bForceJapanese ) { - rParams.SearchAndReplaceAll( rtl::OUString( "ee" ), - rtl::OUString( "yyyy" ) ); - rParams.SearchAndReplaceAll( rtl::OUString( "EE" ), - rtl::OUString( "YYYY" ) ); + rParams.SearchAndReplaceAll( OUString( "ee" ), + OUString( "yyyy" ) ); + rParams.SearchAndReplaceAll( OUString( "EE" ), + OUString( "YYYY" ) ); } if (LANGUAGE_FRENCH != nDocLang) { diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index baeb447a65d8..4f9161fd7685 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -2194,8 +2194,8 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) const String& rStyles = pTOX->GetStyleNames( n ); if( rStyles.Len() ) { - xub_StrLen nPos = 0; - String sLvl = rtl::OUString(','); + sal_Int32 nPos = 0; + String sLvl = OUString(','); sLvl += OUString::number( n + 1 ); do { String sStyle( rStyles.GetToken( 0, @@ -2210,7 +2210,7 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) ( sTOption += sStyle ) += sLvl; } } - } while( STRING_NOTFOUND != nPos ); + } while( -1 != nPos ); } } @@ -2382,7 +2382,7 @@ void WW8Export::WritePostItBegin( ww::bytes* pOut ) String FieldString(ww::eField eIndex) { - String sRet(rtl::OUString(" ")); + String sRet(OUString(" ")); if (const char *pField = ww::GetEnglishFieldName(eIndex)) sRet.InsertAscii(pField, 1); return sRet; @@ -2653,7 +2653,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField ) case DI_CUSTOM: eFld = ww::eDOCPROPERTY; { - rtl::OUString sQuotes('\"'); + OUString sQuotes('\"'); const SwDocInfoField * pDocInfoField = dynamic_cast<const SwDocInfoField *> (pFld); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 0760c96021fa..97a6641b2c31 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -282,9 +282,9 @@ bool WW8ReadFieldParams::GetTokenSttFromTo(sal_uInt16* pFrom, sal_uInt16* pTo, s String sParams( GetResult() ); - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; String sStart( sParams.GetToken(0, '-', nIndex) ); - if( STRING_NOTFOUND != nIndex ) + if( -1 != nIndex ) { nStart = static_cast<sal_uInt16>(sStart.ToInt32()); nEnd = static_cast<sal_uInt16>(sParams.Copy(nIndex).ToInt32()); @@ -2824,17 +2824,17 @@ static void lcl_toxMatchTSwitch(SwWW8ImplReader& rReader, SwTOXBase& rBase, String sParams( rParam.GetResult() ); if( sParams.Len() ) { - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; // Delimiters between styles and style levels appears to allow both ; and , String sTemplate( sParams.GetToken(0, ';', nIndex) ); - if( STRING_NOTFOUND == nIndex ) + if( -1 == nIndex ) { nIndex=0; sTemplate = sParams.GetToken(0, ',', nIndex); } - if( STRING_NOTFOUND == nIndex ) + if( -1 == nIndex ) { const SwFmt* pStyle = rReader.GetStyleWithOrgWWName(sTemplate); if( pStyle ) @@ -2842,12 +2842,12 @@ static void lcl_toxMatchTSwitch(SwWW8ImplReader& rReader, SwTOXBase& rBase, // Store Style for Level 0 into TOXBase rBase.SetStyleNames( sTemplate, 0 ); } - else while( STRING_NOTFOUND != nIndex ) + else while( -1 != nIndex ) { - xub_StrLen nOldIndex=nIndex; + sal_Int32 nOldIndex=nIndex; sal_uInt16 nLevel = static_cast<sal_uInt16>( sParams.GetToken(0, ';', nIndex).ToInt32()); - if( STRING_NOTFOUND == nIndex ) + if( -1 == nIndex ) { nIndex = nOldIndex; nLevel = static_cast<sal_uInt16>( @@ -2873,7 +2873,7 @@ static void lcl_toxMatchTSwitch(SwWW8ImplReader& rReader, SwTOXBase& rBase, // read next style name... nOldIndex = nIndex; sTemplate = sParams.GetToken(0, ';', nIndex); - if( STRING_NOTFOUND == nIndex ) + if( -1 == nIndex ) { nIndex=nOldIndex; sTemplate = sParams.GetToken(0, ',', nIndex); diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx index fb1da4355e40..3b47034110ec 100644 --- a/sw/source/ui/app/appenv.cxx +++ b/sw/source/ui/app/appenv.cxx @@ -78,8 +78,8 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText String sRet; String aText(comphelper::string::remove(rText, '\r')); - sal_uInt16 nTokenPos = 0; - while( STRING_NOTFOUND != nTokenPos ) + sal_Int32 nTokenPos = 0; + while( -1 != nTokenPos ) { String aLine = aText.GetToken( 0, '\n', nTokenPos ); while ( aLine.Len() ) diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index f7f853273e8d..ad83d23c4540 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -404,7 +404,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog( { //header line xub_StrLen nHeaders = comphelper::string::getTokenCount(sLine, '\t'); - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; for( xub_StrLen nToken = 0; nToken < nHeaders; ++nToken) { String sHeader = sLine.GetToken( 0, '\t', nIndex ); @@ -422,7 +422,7 @@ SwCreateAddressListDialog::SwCreateAddressListDialog( ::std::vector<OUString> aNewData; //analyze data line xub_StrLen nDataCount = comphelper::string::getTokenCount(sLine, '\t'); - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; for( xub_StrLen nToken = 0; nToken < nDataCount; ++nToken) { String sData = sLine.GetToken( 0, '\t', nIndex ); diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 9c6cc3e38b7d..4a89b6eaab10 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1770,7 +1770,7 @@ void SwInsertDBColAutoPilot::Load() pNewData->aDBColumns.insert(pInsDBColumn); } - sal_uInt16 n = 0; + sal_Int32 n = 0; String sTmp( pNewData->sTblList ); if( sTmp.Len() ) { @@ -1826,7 +1826,7 @@ void SwInsertDBColAutoPilot::Load() // now copy the user defined Numberformat strings to the // Shell. Then only these are available as ID - for( n = 0; n < aDBColumns.size() ; ++n ) + for( n = 0; n < (sal_Int32) aDBColumns.size() ; ++n ) { SwInsDBColumn& rSet = *aDBColumns[ n ]; for( sal_uInt16 m = 0; m < pNewData->aDBColumns.size() ; ++m ) diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx b/sw/source/ui/dbui/mailmergechildwindow.cxx index 95b494a264d8..31772621f6ad 100644 --- a/sw/source/ui/dbui/mailmergechildwindow.cxx +++ b/sw/source/ui/dbui/mailmergechildwindow.cxx @@ -589,7 +589,7 @@ void SwSendMailDialog::IterateMails() { String sTokens( pCurrentMailDescriptor->sCC ); sal_uInt16 nTokens = comphelper::string::getTokenCount(sTokens, ';'); - xub_StrLen nPos = 0; + sal_Int32 nPos = 0; for( sal_uInt16 nToken = 0; nToken < nTokens; ++nToken) { String sTmp = sTokens.GetToken( 0, ';', nPos); @@ -601,7 +601,7 @@ void SwSendMailDialog::IterateMails() { String sTokens( pCurrentMailDescriptor->sBCC ); sal_uInt16 nTokens = comphelper::string::getTokenCount(sTokens, ';'); - xub_StrLen nPos = 0; + sal_Int32 nPos = 0; for( sal_uInt16 nToken = 0; nToken < nTokens; ++nToken) { String sTmp = sTokens.GetToken( 0, ';', nPos); diff --git a/sw/source/ui/envelp/envimg.cxx b/sw/source/ui/envelp/envimg.cxx index c0ed4f21e054..d7760d8fc150 100644 --- a/sw/source/ui/envelp/envimg.cxx +++ b/sw/source/ui/envelp/envimg.cxx @@ -55,7 +55,8 @@ SW_DLLPUBLIC String MakeSender() String sRet; String sSenderToken(SW_RES(STR_SENDER_TOKENS)); - xub_StrLen nSttPos = 0, nTokenCount = comphelper::string::getTokenCount(sSenderToken, ';'); + xub_StrLen nTokenCount = comphelper::string::getTokenCount(sSenderToken, ';'); + sal_Int32 nSttPos = 0; bool bLastLength = true; for( xub_StrLen i = 0; i < nTokenCount; i++ ) { diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 3b7279aecd54..86fe43d574ea 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -615,9 +615,9 @@ String SwFldFuncPage::TurnMacroString(const String &rMacro) { // reverse content of aName String sTmp, sBuf; - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; - for (sal_uInt16 i = 0; i < 4 && nPos != STRING_NOTFOUND; i++) + for (sal_uInt16 i = 0; i < 4 && nPos != -1; i++) { if (i == 3) sTmp = rMacro.Copy(nPos); diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index 7053a41221c0..13d3cc2eeaf2 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -200,7 +200,7 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str case TYP_DBNUMSETFLD: case TYP_DBSETNUMBERFLD: { - xub_StrLen nPos = 0; + sal_Int32 nPos = 0; SwDBData aData; aData.sDataSource = rPar1.GetToken(0, DB_DELIM, nPos); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 9546729c6add..7d516a3f4fde 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -4068,7 +4068,7 @@ void SwEntryBrowseBox::ReadEntries(SvStream& rInStr) if( !pToInsert ) pToInsert = new AutoMarkEntry; - sal_uInt16 nSttPos = 0; + sal_Int32 nSttPos = 0; pToInsert->sSearch = sLine.GetToken(0, ';', nSttPos ); pToInsert->sAlternative = sLine.GetToken(0, ';', nSttPos ); pToInsert->sPrimKey = sLine.GetToken(0, ';', nSttPos ); diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 431278b31e05..1795eca83e01 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -1162,7 +1162,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse ) SET_CURR_SHELL(pWrtShell); - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; // Nein, es ist *keine* gute Idee GetToken gleich im Point-Konstr. // aufzurufen, denn welcher Parameter wird zuerst ausgewertet? diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index e89cb631b188..13ec0b791020 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -3104,7 +3104,7 @@ sal_Bool NaviContentBookmark::Paste( TransferableDataHelper& rData ) sal_Bool bRet = rData.GetString( SOT_FORMATSTR_ID_SONLK, sStr ); if( bRet ) { - xub_StrLen nPos = 0; + sal_Int32 nPos = 0; aUrl = sStr.GetToken(0, NAVI_BOOKMARK_DELIM, nPos ); aDescr = sStr.GetToken(0, NAVI_BOOKMARK_DELIM, nPos ); nDefDrag= (sal_uInt16)sStr.GetToken(0, NAVI_BOOKMARK_DELIM, nPos ).ToInt32(); diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index 6be3d7db5709..1c73fe4fb230 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -274,7 +274,7 @@ public: void SetToken( xub_StrLen nToken, sal_Unicode cTok, const UniString& rStr, xub_StrLen nIndex = 0 ); - UniString GetToken( xub_StrLen nToken, sal_Unicode cTok, xub_StrLen& rIndex ) const; + UniString GetToken( xub_StrLen nToken, sal_Unicode cTok, sal_Int32& rIndex ) const; UniString GetToken( xub_StrLen nToken, sal_Unicode cTok = ';' ) const; const sal_Unicode* GetBuffer() const { return mpData->maStr; } @@ -303,7 +303,7 @@ inline UniString UniString::Copy( xub_StrLen nIndex, xub_StrLen nCount ) const inline UniString UniString::GetToken( xub_StrLen nToken, sal_Unicode cTok ) const { - xub_StrLen nTempPos = 0; + sal_Int32 nTempPos = 0; return GetToken( nToken, cTok, nTempPos ); } diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index a66dc6026452..b07cd3c9e8d8 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -520,14 +520,14 @@ void STRING::SetToken( xub_StrLen nToken, STRCODE cTok, const STRING& rStr, Replace( nFirstChar, i-nFirstChar, rStr ); } -STRING STRING::GetToken( xub_StrLen nToken, STRCODE cTok, xub_StrLen& rIndex ) const +STRING STRING::GetToken( xub_StrLen nToken, STRCODE cTok, sal_Int32& rIndex ) const { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); const STRCODE* pStr = mpData->maStr; xub_StrLen nLen = (xub_StrLen)mpData->mnLen; xub_StrLen nTok = 0; - xub_StrLen nFirstChar = rIndex; + sal_Int32 nFirstChar = rIndex; xub_StrLen i = nFirstChar; // Determine token position and length @@ -557,12 +557,12 @@ STRING STRING::GetToken( xub_StrLen nToken, STRCODE cTok, xub_StrLen& rIndex ) c if ( i < nLen ) rIndex = i+1; else - rIndex = STRING_NOTFOUND; + rIndex = -1; return Copy( nFirstChar, i-nFirstChar ); } else { - rIndex = STRING_NOTFOUND; + rIndex = -1; return STRING(); } } diff --git a/unotools/inc/unotools/fontdefs.hxx b/unotools/inc/unotools/fontdefs.hxx index df79a0f26eb2..f92346440f57 100644 --- a/unotools/inc/unotools/fontdefs.hxx +++ b/unotools/inc/unotools/fontdefs.hxx @@ -37,9 +37,9 @@ namespace utl { #define SUBSFONT_PS ((sal_uLong)0x00000004) #define SUBSFONT_HTML ((sal_uLong)0x00000008) -UNOTOOLS_DLLPUBLIC String GetSubsFontName( const String& rName, sal_uLong nFlags ); +UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, sal_uLong nFlags ); -UNOTOOLS_DLLPUBLIC void AddTokenFontName( String& rName, const String& rNewToken ); +UNOTOOLS_DLLPUBLIC void AddTokenFontName( OUString& rName, const OUString& rNewToken ); struct UNOTOOLS_DLLPUBLIC FontNameHash { int operator()(const String&) const; }; @@ -84,9 +84,9 @@ public: #define DEFAULTFONT_CTL_HEADING ((sal_uInt16)4003) #define DEFAULTFONT_CTL_DISPLAY ((sal_uInt16)4004) -UNOTOOLS_DLLPUBLIC String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex ); +UNOTOOLS_DLLPUBLIC OUString GetNextFontToken( const OUString& rTokenStr, sal_Int32& rIndex ); -UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( String& rName ); +UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( OUString& rName ); #endif diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx index a11148884854..fe870ed48d1f 100644 --- a/unotools/source/misc/fontcvt.cxx +++ b/unotools/source/misc/fontcvt.cxx @@ -1432,40 +1432,40 @@ static ConvertChar aImplStarSymbolCvt = { NULL, "StarBats", ImplStarSymbolToStar const ConvertChar* ConvertChar::GetRecodeData( const String& rOrgFontName, const String& rMapFontName ) { const ConvertChar* pCvt = NULL; - String aOrgName( rOrgFontName ); + OUString aOrgName( rOrgFontName ); GetEnglishSearchFontName( aOrgName ); - String aMapName( rMapFontName ); + OUString aMapName( rMapFontName ); GetEnglishSearchFontName( aMapName ); - if( aMapName.EqualsAscii( "starsymbol" ) - || aMapName.EqualsAscii( "opensymbol" ) ) + if( aMapName == "starsymbol" + || aMapName == "opensymbol" ) { int nEntries = SAL_N_ELEMENTS(aStarSymbolRecodeTable); for( int i = 0; i < nEntries; ++i) { RecodeTable& r = aStarSymbolRecodeTable[i]; - if( aOrgName.EqualsAscii( r.pOrgName ) ) + if( aOrgName.equalsAscii( r.pOrgName ) ) { pCvt = &r.aCvt; break; } } } //It's plausible that it's better to implement this //as an additional encoding alongside the existing //adobe-symbol to unicode conversion in rtl instead - else if( aMapName.EqualsAscii("applesymbol") ) + else if( aMapName == "applesymbol" ) { int nEntries = SAL_N_ELEMENTS(aAppleSymbolRecodeTable); for( int i = 0; i < nEntries; ++i) { RecodeTable& r = aAppleSymbolRecodeTable[i]; - if( aOrgName.EqualsAscii( r.pOrgName ) ) + if( aOrgName.equalsAscii( r.pOrgName ) ) { pCvt = &r.aCvt; break; } } } - else if( aMapName.EqualsAscii( "starbats" ) ) + else if( aMapName == "starbats" ) { - if( aOrgName.EqualsAscii( "starsymbol" ) ) + if( aOrgName == "starsymbol" ) pCvt = &aImplStarSymbolCvt; - else if( aOrgName.EqualsAscii( "opensymbol" ) ) + else if( aOrgName == "opensymbol" ) pCvt = &aImplStarSymbolCvt; } @@ -1479,7 +1479,7 @@ FontToSubsFontConverter CreateFontToSubsFontConverter( { const ConvertChar* pCvt = NULL; - String aName = rOrgName; + OUString aName = rOrgName; GetEnglishSearchFontName( aName ); if ( nFlags & FONTTOSUBSFONT_IMPORT ) @@ -1490,15 +1490,15 @@ FontToSubsFontConverter CreateFontToSubsFontConverter( for( int i = 0; i < nEntries; ++i ) { RecodeTable& r = aStarSymbolRecodeTable[i]; - if( aName.EqualsAscii( r.pOrgName ) ) + if( aName.equalsAscii( r.pOrgName ) ) { pCvt = &r.aCvt; break; } } } else { // TODO: FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS - if( aName.EqualsAscii( "starsymbol" ) ) pCvt = &aImplStarSymbolCvt; - else if( aName.EqualsAscii( "opensymbol" ) ) pCvt = &aImplStarSymbolCvt; + if( aName == "starsymbol" ) pCvt = &aImplStarSymbolCvt; + else if( aName == "opensymbol" ) pCvt = &aImplStarSymbolCvt; } return (FontToSubsFontConverter)pCvt; diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index 7785e80757e1..35fe5351e726 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -20,6 +20,7 @@ #include <unotools/fontdefs.hxx> #include <unotools/fontcfg.hxx> #include <boost/unordered_map.hpp> +#include <rtl/ustrbuf.hxx> struct ImplLocalizedFontName { @@ -321,42 +322,42 @@ static ImplLocalizedFontName aImplLocalizedNamesList[] = // ----------------------------------------------------------------------- -void GetEnglishSearchFontName( String& rName ) +void GetEnglishSearchFontName( OUString& rName ) { bool bNeedTranslation = false; - xub_StrLen nLen = rName.Len(); + sal_Int32 nLen = rName.getLength(); // Remove trailing whitespaces - xub_StrLen i = nLen; - while ( i && (rName.GetChar( i-1 ) < 32) ) + sal_Int32 i = nLen; + while ( i && (rName[ i-1 ] < 32) ) i--; if ( i != nLen ) - rName.Erase( i ); + rName.copy( 0, i ); // Remove Script at the end // Scriptname must be the last part of the fontname and // looks like "fontname (scriptname)". So there can only be a // script name at the and of the fontname, when the last char is ')' - if ( (nLen >= 3) && rName.GetChar( nLen-1 ) == ')' ) + if ( (nLen >= 3) && rName[ nLen-1 ] == ')' ) { int nOpen = 1; - xub_StrLen nTempLen = nLen-2; + sal_Int32 nTempLen = nLen-2; while ( nTempLen ) { - if ( rName.GetChar( nTempLen ) == '(' ) + if ( rName[ nTempLen ] == '(' ) { nOpen--; if ( !nOpen ) { // Remove Space at the end - if ( nTempLen && (rName.GetChar( nTempLen-1 ) == ' ') ) + if ( nTempLen && (rName[ nTempLen-1 ] == ' ') ) nTempLen--; - rName.Erase( nTempLen ); + rName.copy( 0, nTempLen ); nLen = nTempLen; break; } } - if ( rName.GetChar( nTempLen ) == ')' ) + if ( rName[ nTempLen ] == ')' ) nOpen++; nTempLen--; } @@ -367,7 +368,7 @@ void GetEnglishSearchFontName( String& rName ) i = 0; while ( i < nLen ) { - sal_Unicode c = rName.GetChar( i ); + sal_Unicode c = rName[ i ]; if ( c > 127 ) { // Translate to Lowercase-ASCII @@ -378,8 +379,13 @@ void GetEnglishSearchFontName( String& rName ) // Upper to Lower if ( (c >= 'A') && (c <= 'Z') ) c += 'a' - 'A'; - rName.SetChar( i, c ); - } + //rName[ i ] = c ; + + OUStringBuffer aTmpStr( rName.getStr() ) ; + aTmpStr[ i ] = c ; + rName = aTmpStr.makeStringAndClear() ; + + } else { // Only Fontnames with None-Ascii-Characters must be translated @@ -393,12 +399,21 @@ void GetEnglishSearchFontName( String& rName ) if ( (c >= 'A') && (c <= 'Z') ) { c += 'a' - 'A'; - rName.SetChar( i, c ); + //rName[ i ] = c ; + + OUStringBuffer aTmpStr( rName.getStr() ) ; + aTmpStr[ i ] = c ; + rName = aTmpStr.makeStringAndClear() ; + } else if( ((c < '0') || (c > '9')) && (c != ';') ) // not 0-9 or semicolon { // Remove white spaces and special characters - rName.Erase( i, 1 ); + + OUStringBuffer aTmpStr( rName.getStr() ) ; + aTmpStr.remove(i,1); + rName = aTmpStr.makeStringAndClear() ; + nLen--; continue; } @@ -423,41 +438,41 @@ void GetEnglishSearchFontName( String& rName ) FontNameDictionary::const_iterator it = aDictionary.find( rName ); if( it != aDictionary.end() ) - rName.AssignAscii( it->second ); + rName = OUString::createFromAscii ( it->second ) ; } } // ----------------------------------------------------------------------- -String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex ) +OUString GetNextFontToken( const OUString& rTokenStr, sal_Int32& rIndex ) { // check for valid start index - int nStringLen = rTokenStr.Len(); + int nStringLen = rTokenStr.getLength(); if( rIndex >= nStringLen ) { - rIndex = STRING_NOTFOUND; - return String(); + rIndex = -1; + return OUString(); } // find the next token delimiter and return the token substring - const sal_Unicode* pStr = rTokenStr.GetBuffer() + rIndex; - const sal_Unicode* pEnd = rTokenStr.GetBuffer() + nStringLen; + const sal_Unicode* pStr = rTokenStr.getStr() + rIndex; + const sal_Unicode* pEnd = rTokenStr.getStr() + nStringLen; for(; pStr < pEnd; ++pStr ) if( (*pStr == ';') || (*pStr == ',') ) break; - xub_StrLen nTokenStart = rIndex; - xub_StrLen nTokenLen; + sal_Int32 nTokenStart = rIndex; + sal_Int32 nTokenLen; if( pStr < pEnd ) { - rIndex = sal::static_int_cast<xub_StrLen>(pStr - rTokenStr.GetBuffer()); + rIndex = sal::static_int_cast<sal_Int32>(pStr - rTokenStr.getStr()); nTokenLen = rIndex - nTokenStart; ++rIndex; // skip over token separator } else { // no token delimiter found => handle last token - rIndex = STRING_NOTFOUND; + rIndex = -1; nTokenLen = STRING_LEN; // optimize if the token string consists of just one token @@ -470,35 +485,35 @@ String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex ) // ======================================================================= -static bool ImplIsFontToken( const String& rName, const String& rToken ) +static bool ImplIsFontToken( const OUString& rName, const String& rToken ) { - String aTempName; - xub_StrLen nIndex = 0; + OUString aTempName; + sal_Int32 nIndex = 0; do { aTempName = GetNextFontToken( rName, nIndex ); if ( rToken == aTempName ) return true; } - while ( nIndex != STRING_NOTFOUND ); + while ( nIndex != -1 ); return false; } // ----------------------------------------------------------------------- -static void ImplAppendFontToken( String& rName, const String& rNewToken ) +static void ImplAppendFontToken( OUString& rName, const String& rNewToken ) { - if ( rName.Len() ) + if ( rName.getLength() ) { - rName.Append( ';' ); - rName.Append( rNewToken ); + rName += ";" ; + rName += rNewToken ; } else rName = rNewToken; } -void AddTokenFontName( String& rName, const String& rNewToken ) +void AddTokenFontName( OUString& rName, const OUString& rNewToken ) { if ( !ImplIsFontToken( rName, rNewToken ) ) ImplAppendFontToken( rName, rNewToken ); @@ -506,18 +521,18 @@ void AddTokenFontName( String& rName, const String& rNewToken ) // ======================================================================= -String GetSubsFontName( const String& rName, sal_uLong nFlags ) +OUString GetSubsFontName( const OUString& rName, sal_uLong nFlags ) { - String aName; + OUString aName; - xub_StrLen nIndex = 0; - String aOrgName = GetNextFontToken( rName, nIndex ); + sal_Int32 nIndex = 0; + OUString aOrgName = GetNextFontToken( rName, nIndex ); GetEnglishSearchFontName( aOrgName ); // #93662# do not try to replace StarSymbol with MS only font if( nFlags == (SUBSFONT_MS|SUBSFONT_ONLYONE) - && ( aOrgName.EqualsAscii( "starsymbol" ) - || aOrgName.EqualsAscii( "opensymbol" ) ) ) + && ( aOrgName == "starsymbol" + || aOrgName == "opensymbol" ) ) return aName; const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get().getSubstInfo( aOrgName ); diff --git a/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx b/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx index 8e2a4bba93af..5703eac989b2 100644 --- a/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx +++ b/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx @@ -296,16 +296,16 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF continue; // convert to unicode name - UniString aUtf16Name; + OUString aUtf16Name; if( eEncoding == RTL_TEXTENCODING_UNICODE ) // we are just interested in UTF16 encoded names - aUtf16Name = rtl::OUString( (const sal_Unicode*)&aNameBuffer[0], nNameLength/2 ); + aUtf16Name = OUString( (const sal_Unicode*)&aNameBuffer[0], nNameLength/2 ); else if( eEncoding == RTL_TEXTENCODING_UCS4 ) - aUtf16Name = UniString(); // TODO + aUtf16Name = OUString(); // TODO else // assume the non-unicode encoded names are byte encoded - aUtf16Name = UniString( &aNameBuffer[0], nNameLength, eEncoding ); ++ aUtf16Name = OUString( &aNameBuffer[0], nNameLength, eEncoding ); // ignore empty strings - if( aUtf16Name.Len() <= 0 ) + if( aUtf16Name.getLength() <= 0 ) continue; // handle the name depending on its namecode @@ -313,7 +313,7 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF { case kFontFamilyName: // ignore font names starting with '.' - if( aUtf16Name.GetChar(0) == '.' ) + if( aUtf16Name[0] == '.' ) nNameValue = 0; else if( rDFA.GetFamilyName().Len() ) { diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx index 2234bdb11a91..fac314cd6fcd 100644 --- a/vcl/generic/fontmanager/fontsubst.cxx +++ b/vcl/generic/fontmanager/fontsubst.cxx @@ -160,8 +160,8 @@ bool FcPreMatchSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelDa if( rFontSelData.IsSymbolFont() ) return false; // StarSymbol is a unicode font, but it still deserves the symbol flag - if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "starsymbol", 10) - || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) ) + if( 0 == rFontSelData.maSearchName.compareTo( "starsymbol", 10) + || 0 == rFontSelData.maSearchName.compareTo( "opensymbol", 10) ) return false; //see fdo#41556 and fdo#47636 @@ -187,7 +187,7 @@ bool FcPreMatchSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelDa rtl::OUString aDummy; const FontSelectPattern aOut = GetFcSubstitute( rFontSelData, aDummy ); - if( !aOut.maSearchName.Len() ) + if( !aOut.maSearchName.getLength() ) return false; const bool bHaveSubstitute = !uselessmatch( rFontSelData, aOut ); @@ -229,8 +229,8 @@ bool FcGlyphFallbackSubstititution::FindFontSubstitute( FontSelectPattern& rFont if( rFontSelData.IsSymbolFont() ) return false; // StarSymbol is a unicode font, but it still deserves the symbol flag - if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "starsymbol", 10) - || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) ) + if( 0 == rFontSelData.maSearchName.compareTo( "starsymbol", 10) + || 0 == rFontSelData.maSearchName.compareTo( "opensymbol", 10) ) return false; const FontSelectPattern aOut = GetFcSubstitute( rFontSelData, rMissingCodes ); @@ -238,7 +238,7 @@ bool FcGlyphFallbackSubstititution::FindFontSubstitute( FontSelectPattern& rFont // FC doing it would be preferable because it knows the invariables // e.g. FC knows the FC rule that all Arial gets replaced by LiberationSans // whereas we would have to check for every size or attribute - if( !aOut.maSearchName.Len() ) + if( !aOut.maSearchName.getLength() ) return false; const bool bHaveSubstitute = !uselessmatch( rFontSelData, aOut ); diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index df24b7662135..aac80883830b 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -945,8 +945,8 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const //Always consider [star]symbol as symbol fonts if ( - (rTo.GetFamilyName().EqualsAscii("OpenSymbol")) || - (rTo.GetFamilyName().EqualsAscii("StarSymbol")) + (rTo.GetFamilyName() == "OpenSymbol" ) || + (rTo.GetFamilyName() == "StarSymbol" ) ) { rTo.SetSymbolFlag( true ); diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx index 79a2d7a421fd..1d1322c7a702 100644 --- a/vcl/generic/glyphs/glyphcache.cxx +++ b/vcl/generic/glyphs/glyphcache.cxx @@ -86,7 +86,7 @@ size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData // TODO: is it worth to improve this hash function? sal_IntPtr nFontId = reinterpret_cast<sal_IntPtr>( rFontSelData.mpFontData ); #ifdef ENABLE_GRAPHITE - if (rFontSelData.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX) + if (rFontSelData.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) != STRING_NOTFOUND) { rtl::OString aFeatName = rtl::OUStringToOString( rFontSelData.maTargetName, RTL_TEXTENCODING_UTF8 ); @@ -138,9 +138,9 @@ bool GlyphCache::IFSD_Equal::operator()( const FontSelectPattern& rA, const Font if (rA.meLanguage != rB.meLanguage) return false; // check for features - if ((rA.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX) + if ((rA.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) != STRING_NOTFOUND || - rB.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX) + rB.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) != STRING_NOTFOUND) && rA.maTargetName != rB.maTargetName) return false; #endif diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h index 20c1d36f4f14..0842a013d1ac 100644 --- a/vcl/inc/outdev.h +++ b/vcl/inc/outdev.h @@ -54,9 +54,9 @@ public: ImplDevFontListData( const String& rSearchName ); ~ImplDevFontListData(); - const String& GetFamilyName() const { return maName; } + const OUString& GetFamilyName() const { return maName; } const String& GetSearchName() const { return maSearchName; } - const String& GetAliasNames() const { return maMapNames; } + const OUString& GetAliasNames() const { return maMapNames; } bool IsScalable() const { return mpFirst->IsScalable(); } int GetMinQuality() const { return mnMinQuality; } @@ -73,9 +73,9 @@ public: private: friend class ImplDevFontList; // TODO: remove soon PhysicalFontFace* mpFirst; // linked list of physical font faces - String maName; // Fontname (original font family name) + OUString maName; // Fontname (original font family name) String maSearchName; // normalized font family name - String maMapNames; // fontname aliases + OUString maMapNames; // fontname aliases sal_uIntPtr mnTypeFaces; // Typeface Flags sal_uIntPtr mnMatchType; // MATCH - Type String maMatchFamilyName; // MATCH - FamilyName @@ -148,13 +148,13 @@ protected: struct ImplFontSubstEntry { - String maName; - String maReplaceName; - String maSearchName; - String maSearchReplaceName; - sal_uInt16 mnFlags; + String maName; + String maReplaceName; + OUString maSearchName; + OUString maSearchReplaceName; + sal_uInt16 mnFlags; - ImplFontSubstEntry( const String& rFontName, const String& rSubstFontName, sal_uInt16 nSubstFlags ); + ImplFontSubstEntry( const OUString& rFontName, const OUString& rSubstFontName, sal_uInt16 nSubstFlags ); }; class ImplDirectFontSubstitution diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx index 42d552b01ede..e3a516f2062d 100644 --- a/vcl/inc/outfont.hxx +++ b/vcl/inc/outfont.hxx @@ -54,17 +54,17 @@ namespace com { namespace sun { namespace star { namespace lang { struct Locale; class ImplFontAttributes { public: // TODO: create matching interface class - const String& GetFamilyName() const { return maName; } - const String& GetStyleName() const { return maStyleName; } + const OUString& GetFamilyName() const { return maName; } + const OUString& GetStyleName() const { return maStyleName; } FontWeight GetWeight() const { return meWeight; } FontItalic GetSlant() const { return meItalic; } FontFamily GetFamilyType() const { return meFamily; } FontPitch GetPitch() const { return mePitch; } FontWidth GetWidthType() const { return meWidthType; } bool IsSymbolFont() const { return mbSymbolFlag; } - void SetFamilyName(const String sFamilyName) { maName = sFamilyName; } - void SetStyleName( const String sStyleName) { maStyleName = sStyleName; } - void SetFamilyType(const FontFamily eFontFamily) { meFamily = eFontFamily; } + void SetFamilyName(const OUString sFamilyName) { maName = sFamilyName; } + void SetStyleName( const OUString sStyleName) { maStyleName = sStyleName; } + void SetFamilyType(const FontFamily eFontFamily) { meFamily = eFontFamily; } void SetPitch(const FontPitch ePitch ) { mePitch = ePitch; } void SetItalic(const FontItalic eItalic ) { meItalic = eItalic; } void SetWeight(const FontWeight eWeight ) { meWeight = eWeight; } @@ -77,8 +77,8 @@ public: // TODO: create matching interface class } private: - String maName; // Font Family Name - String maStyleName; // Font Style Name + OUString maName; // Font Family Name + OUString maStyleName; // Font Style Name FontWeight meWeight; // Weight Type FontItalic meItalic; // Slant Type FontFamily meFamily; // Family Type @@ -138,8 +138,8 @@ public: PhysicalFontFace* CreateAlias() const { return Clone(); } bool IsBetterMatch( const FontSelectPattern&, FontMatchStatus& ) const; - StringCompare CompareWithSize( const PhysicalFontFace& ) const; - StringCompare CompareIgnoreSize( const PhysicalFontFace& ) const; + sal_Int32 CompareWithSize( const PhysicalFontFace& ) const; + sal_Int32 CompareIgnoreSize( const PhysicalFontFace& ) const; virtual ~PhysicalFontFace() {} virtual PhysicalFontFace* Clone() const = 0; @@ -172,8 +172,8 @@ public: } public: - String maTargetName; // name of the font name token that is chosen - String maSearchName; // name of the font that matches best + OUString maTargetName; // name of the font name token that is chosen + OUString maSearchName; // name of the font that matches best int mnWidth; // width of font in pixel units int mnHeight; // height of font in pixel units float mfExactHeight; // requested height (in pixels with subpixel details) @@ -234,7 +234,7 @@ public: // find the device font ImplDevFontListData* FindFontFamily( const String& rFontName ) const; ImplDevFontListData* ImplFindByFont( FontSelectPattern&, bool bPrinter, ImplDirectFontSubstitution* ) const; - ImplDevFontListData* ImplFindBySearchName( const String& ) const; + ImplDevFontListData* ImplFindBySearchName( const OUString& ) const; // suggest fonts for glyph fallback ImplDevFontListData* GetGlyphFallbackFont( FontSelectPattern&, @@ -362,7 +362,7 @@ public: // TODO: make data members private bool mbInit; // true if maMetric member is valid void AddFallbackForUnicode( sal_UCS4, FontWeight eWeight, const String& rFontName ); - bool GetFallbackForUnicode( sal_UCS4, FontWeight eWeight, String* pFontName ) const; + bool GetFallbackForUnicode( sal_UCS4, FontWeight eWeight, OUString* pFontName ) const; void IgnoreFallbackForUnicode( sal_UCS4, FontWeight eWeight, const String& rFontName ); private: diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx index b80e8e00b3ca..1ce1a0dd68a4 100644 --- a/vcl/source/gdi/font.cxx +++ b/vcl/source/gdi/font.cxx @@ -168,7 +168,7 @@ void Impl_Font::AskConfig() sal_uLong nType = 0; FontWeight eWeight = WEIGHT_DONTKNOW; FontWidth eWidthType = WIDTH_DONTKNOW; - String aMapName = maFamilyName; + OUString aMapName = maFamilyName; GetEnglishSearchFontName( aMapName ); utl::FontSubstConfiguration::getMapName( aMapName, aShortName, aFamilyName, eWeight, eWidthType, nType ); diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index da6d40ec29b8..59e6d0cd8c0f 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -359,8 +359,8 @@ void ImplDirectFontSubstitution::AddFontSubstitute( const String& rFontName, // ----------------------------------------------------------------------- -ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName, - const String& rSubstFontName, sal_uInt16 nSubstFlags ) +ImplFontSubstEntry::ImplFontSubstEntry( const OUString& rFontName, + const OUString& rSubstFontName, sal_uInt16 nSubstFlags ) : maName( rFontName ) , maReplaceName( rSubstFontName ) , mnFlags( nSubstFlags ) @@ -434,11 +434,11 @@ bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName, // ----------------------------------------------------------------------- -static void ImplFontSubstitute( String& rFontName, +static void ImplFontSubstitute( OUString& rFontName, sal_uInt16 nFlags, ImplDirectFontSubstitution* pDevSpecific ) { #ifdef DBG_UTIL - String aTempName = rFontName; + OUString aTempName = rFontName; GetEnglishSearchFontName( aTempName ); DBG_ASSERT( aTempName == rFontName, "ImplFontSubstitute() called without a searchname" ); #endif @@ -553,9 +553,9 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang, pOutDev->ImplInitFontList(); // Search Font in the FontList - String aName; - String aSearchName; - xub_StrLen nIndex = 0; + OUString aName; + OUString aSearchName; + sal_Int32 nIndex = 0; do { aSearchName = GetNextFontToken( aSearch, nIndex ); @@ -568,7 +568,7 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang, break; } } - while ( nIndex != STRING_NOTFOUND ); + while ( nIndex != -1 ); aFont.SetName( aName ); } @@ -582,7 +582,7 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang, pOutDev = (const OutputDevice *)ImplGetSVData()->mpDefaultWin; if( !pOutDev ) { - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; aFont.SetName( aSearch.GetToken( 0, ';', nIndex ) ); } else @@ -744,14 +744,14 @@ PhysicalFontFace::PhysicalFontFace( const ImplDevFontAttributes& rDFA, int nMagi { // StarSymbol is a unicode font, but it still deserves the symbol flag if( !IsSymbolFont() ) - if( 0 == GetFamilyName().CompareIgnoreCaseToAscii( "starsymbol", 10) - || 0 == GetFamilyName().CompareIgnoreCaseToAscii( "opensymbol", 10) ) + if( 0 == GetFamilyName().compareTo( "starsymbol", 10) + || 0 == GetFamilyName().compareTo( "opensymbol", 10) ) SetSymbolFlag( true ); } // ----------------------------------------------------------------------- -StringCompare PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther ) const +sal_Int32 PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther ) const { // compare their width, weight, italic and style name if( GetWidthType() < rOther.GetWidthType() ) @@ -769,15 +769,15 @@ StringCompare PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOthe else if( GetSlant() > rOther.GetSlant() ) return COMPARE_GREATER; - StringCompare eCompare = GetFamilyName().CompareTo( rOther.GetFamilyName() ); + sal_Int32 eCompare = GetFamilyName().compareTo( rOther.GetFamilyName() ); return eCompare; } // ----------------------------------------------------------------------- -StringCompare PhysicalFontFace::CompareWithSize( const PhysicalFontFace& rOther ) const +sal_Int32 PhysicalFontFace::CompareWithSize( const PhysicalFontFace& rOther ) const { - StringCompare eCompare = CompareIgnoreSize( rOther ); + sal_Int32 eCompare = CompareIgnoreSize( rOther ); if( eCompare != COMPARE_EQUAL ) return eCompare; @@ -809,12 +809,12 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt { int nMatch = 0; - const String& rFontName = rFSD.maTargetName; - if( (rFontName == GetFamilyName()) || rFontName.EqualsIgnoreCaseAscii( GetFamilyName() ) ) + const OUString& rFontName = rFSD.maTargetName; + if( (rFontName == GetFamilyName()) || rFontName.compareTo( GetFamilyName() ) ) nMatch += 240000; if( rStatus.mpTargetStyleName - && GetStyleName().EqualsIgnoreCaseAscii( rStatus.mpTargetStyleName ) ) + && GetStyleName().compareTo( rStatus.mpTargetStyleName ) ) nMatch += 120000; if( (rFSD.GetPitch() != PITCH_DONTKNOW) && (rFSD.GetPitch() == GetPitch()) ) @@ -988,7 +988,7 @@ inline void ImplFontEntry::AddFallbackForUnicode( sal_UCS4 cChar, FontWeight eWe // ----------------------------------------------------------------------- -inline bool ImplFontEntry::GetFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, String* pFontName ) const +inline bool ImplFontEntry::GetFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, OUString* pFontName ) const { if( !mpUnicodeFallbackList ) return false; @@ -1113,7 +1113,7 @@ bool ImplDevFontListData::AddFontFace( PhysicalFontFace* pNewData ) PhysicalFontFace** ppHere = &mpFirst; for(; (pData=*ppHere) != NULL; ppHere=&pData->mpNext ) { - StringCompare eComp = pNewData->CompareWithSize( *pData ); + sal_Int32 eComp = pNewData->CompareWithSize( *pData ); if( eComp == COMPARE_GREATER ) continue; if( eComp == COMPARE_LESS ) @@ -1396,7 +1396,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r cChar = rMissingCodes.iterateCodePoints( &nStrIndex ); bCached = rFontSelData.mpFontEntry->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &rFontSelData.maSearchName ); // ignore entries which don't have a fallback - if( !bCached || (rFontSelData.maSearchName.Len() != 0) ) + if( !bCached || (rFontSelData.maSearchName.getLength() != 0) ) break; } @@ -1406,7 +1406,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r // so update rMissingCodes with codepoints not yet resolved by this fallback int nRemainingLength = 0; sal_UCS4* pRemainingCodes = (sal_UCS4*)alloca( rMissingCodes.getLength() * sizeof(sal_UCS4) ); - String aFontName; + OUString aFontName; while( nStrIndex < rMissingCodes.getLength() ) { cChar = rMissingCodes.iterateCodePoints( &nStrIndex ); @@ -1424,7 +1424,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r // apply outdev3.cxx specific fontname normalization GetEnglishSearchFontName( rFontSelData.maSearchName ); else - rFontSelData.maSearchName = String(); + rFontSelData.maSearchName = OUString(); //See fdo#32665 for an example. FreeSerif that has glyphs in normal //font, but not in the italic or bold version @@ -1443,7 +1443,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r break; cChar = aOldMissingCodes.iterateCodePoints( &nStrIndex ); } - if( rFontSelData.maSearchName.Len() != 0 ) + if( rFontSelData.maSearchName.getLength() != 0 ) { // remove cache entries that were still not resolved for( nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); ) @@ -1456,7 +1456,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r } // find the matching device font - if( rFontSelData.maSearchName.Len() != 0 ) + if( rFontSelData.maSearchName.getLength() != 0 ) pFallbackData = FindFontFamily( rFontSelData.maSearchName ); } @@ -1478,7 +1478,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r void ImplDevFontList::Add( PhysicalFontFace* pNewData ) { - String aSearchName = pNewData->GetFamilyName(); + OUString aSearchName = pNewData->GetFamilyName(); GetEnglishSearchFontName( aSearchName ); DevFontList::const_iterator it = maDevFontList.find( aSearchName ); @@ -1501,7 +1501,7 @@ void ImplDevFontList::Add( PhysicalFontFace* pNewData ) // ----------------------------------------------------------------------- // find the font from the normalized font family name -ImplDevFontListData* ImplDevFontList::ImplFindBySearchName( const String& rSearchName ) const +ImplDevFontListData* ImplDevFontList::ImplFindBySearchName( const OUString& rSearchName ) const { #ifdef DEBUG String aTempName = rSearchName; @@ -1536,12 +1536,12 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAliasName(const rtl::OUString& r while( it != maDevFontList.end() ) { ImplDevFontListData* pData = (*it).second; - if( !pData->maMapNames.Len() ) + if( !pData->maMapNames.getLength() ) continue; // if one alias name matches we found a matching font rtl::OUString aTempName; - xub_StrLen nIndex = 0; + sal_Int32 nIndex = 0; do { aTempName = GetNextFontToken( pData->maMapNames, nIndex ); @@ -1549,7 +1549,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAliasName(const rtl::OUString& r if ( (aTempName == rSearchName) || (aTempName == rShortName) ) return pData; } - while ( nIndex != STRING_NOTFOUND ); + while ( nIndex != -1 ); } return NULL; @@ -1560,7 +1560,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAliasName(const rtl::OUString& r ImplDevFontListData* ImplDevFontList::FindFontFamily( const String& rFontName ) const { // normalize the font fomily name and - String aName = rFontName; + OUString aName = rFontName; GetEnglishSearchFontName( aName ); ImplDevFontListData* pFound = ImplFindBySearchName( aName ); return pFound; @@ -1573,10 +1573,10 @@ ImplDevFontListData* ImplDevFontList::ImplFindByTokenNames(const rtl::OUString& ImplDevFontListData* pFoundData = NULL; // use normalized font name tokens to find the font - for( xub_StrLen nTokenPos = 0; nTokenPos != STRING_NOTFOUND; ) + for( sal_Int32 nTokenPos = 0; nTokenPos != -1; ) { - String aSearchName = GetNextFontToken( rTokenStr, nTokenPos ); - if( !aSearchName.Len() ) + OUString aSearchName = GetNextFontToken( rTokenStr, nTokenPos ); + if( !aSearchName.getLength() ) continue; GetEnglishSearchFontName( aSearchName ); pFoundData = ImplFindBySearchName( aSearchName ); @@ -1597,7 +1597,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNa ::std::vector< String >::const_iterator it = rFontAttr.Substitutions.begin(); for(; it != rFontAttr.Substitutions.end(); ++it ) { - String aSearchName( *it ); + OUString aSearchName( *it ); GetEnglishSearchFontName( aSearchName ); pFoundData = ImplFindBySearchName( aSearchName ); @@ -2201,8 +2201,8 @@ size_t FontSelectPatternAttributes::hashCode() const size_t nHash = aFontNameHash( maSearchName ); #ifdef ENABLE_GRAPHITE // check for features and generate a unique hash if necessary - if (maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX) - != STRING_NOTFOUND) + if (maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) + != -1) { nHash = aFontNameHash( maTargetName ); } @@ -2301,9 +2301,9 @@ bool ImplFontCache::IFSD_Equal::operator()(const FontSelectPattern& rA, const Fo #ifdef ENABLE_GRAPHITE // check for features - if ((rA.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX) + if ((rA.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) != STRING_NOTFOUND || - rB.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX) + rB.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) != STRING_NOTFOUND) && rA.maTargetName != rB.maTargetName) return false; #endif @@ -2500,8 +2500,8 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, nSubstFlags |= FONT_SUBSTITUTE_SCREENONLY; bool bMultiToken = false; - xub_StrLen nTokenPos = 0; - String& aSearchName = rFSD.maSearchName; // TODO: get rid of reference + sal_Int32 nTokenPos = 0; + OUString& aSearchName = rFSD.maSearchName; // TODO: get rid of reference for(;;) { rFSD.maTargetName = GetNextFontToken( rFSD.GetFamilyName(), nTokenPos ); @@ -2510,11 +2510,11 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, #ifdef ENABLE_GRAPHITE // Until features are properly supported, they are appended to the // font name, so we need to strip them off so the font is found. - xub_StrLen nFeat = aSearchName.Search(grutils::GrFeatureParser::FEAT_PREFIX); + xub_StrLen nFeat = aSearchName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX); String aOrigName = rFSD.maTargetName; - String aBaseFontName(aSearchName, 0, (nFeat != STRING_NOTFOUND)?nFeat:aSearchName.Len()); + String aBaseFontName(aSearchName, 0, (nFeat != STRING_NOTFOUND)?nFeat:aSearchName.getLength()); if (nFeat != STRING_NOTFOUND && STRING_NOTFOUND != - aSearchName.Search(grutils::GrFeatureParser::FEAT_ID_VALUE_SEPARATOR, nFeat)) + aSearchName.indexOf(grutils::GrFeatureParser::FEAT_ID_VALUE_SEPARATOR, nFeat)) { aSearchName = aBaseFontName; rFSD.maTargetName = aBaseFontName; @@ -2527,23 +2527,23 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, // #114999# special emboldening for Ricoh fonts // TODO: smarter check for special cases by using PreMatch infrastructure? if( (rFSD.GetWeight() > WEIGHT_MEDIUM) - && aSearchName.EqualsAscii( "hg", 0, 2) ) - { - String aBoldName; - if( aSearchName.EqualsAscii( "hggothicb", 0, 9) ) - aBoldName = String("hggothice"); - else if( aSearchName.EqualsAscii( "hgpgothicb", 0, 10) ) - aBoldName = String("hgpgothice"); - else if( aSearchName.EqualsAscii( "hgminchol", 0, 9) ) - aBoldName = String("hgminchob"); - else if( aSearchName.EqualsAscii( "hgpminchol", 0, 10) ) - aBoldName = String("hgpminchob"); - else if( aSearchName.EqualsAscii( "hgminchob" ) ) - aBoldName = String("hgminchoe"); - else if( aSearchName.EqualsAscii( "hgpminchob" ) ) - aBoldName = String("hgpminchoe"); - - if( aBoldName.Len() && ImplFindBySearchName( aBoldName ) ) + && aSearchName.equalsIgnoreAsciiCase( "hg" ) ) + { + OUString aBoldName; + if( aSearchName.equalsIgnoreAsciiCase( "hggothicb" ) ) + aBoldName = OUString("hggothice"); + else if( aSearchName.equalsIgnoreAsciiCase( "hgpgothicb" ) ) + aBoldName = OUString("hgpgothice"); + else if( aSearchName.equalsIgnoreAsciiCase( "hgminchol" ) ) + aBoldName = OUString("hgminchob"); + else if( aSearchName.equalsIgnoreAsciiCase( "hgpminchol" ) ) + aBoldName = OUString("hgpminchob"); + else if( aSearchName.equalsIgnoreAsciiCase( "hgminchob" ) ) + aBoldName = OUString("hgminchoe"); + else if( aSearchName.equalsIgnoreAsciiCase( "hgpminchob" ) ) + aBoldName = OUString("hgpminchoe"); + + if( aBoldName.getLength() && ImplFindBySearchName( aBoldName ) ) { // the other font is available => use it aSearchName = aBoldName; @@ -2599,7 +2599,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, return pFoundData; // break after last font name token was checked unsuccessfully - if( nTokenPos == STRING_NOTFOUND) + if( nTokenPos == -1) break; bMultiToken = true; } @@ -2609,7 +2609,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, // available when there is a matching entry in the Tools->Options->Fonts // dialog witho neither ALWAYS nor SCREENONLY flags set and the substitution // font is available - for( nTokenPos = 0; nTokenPos != STRING_NOTFOUND; ) + for( nTokenPos = 0; nTokenPos != -1; ) { if( bMultiToken ) { @@ -2618,7 +2618,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, GetEnglishSearchFontName( aSearchName ); } else - nTokenPos = STRING_NOTFOUND; + nTokenPos = -1; if( mpPreMatchHook ) if( mpPreMatchHook->FindFontSubstitute( rFSD ) ) GetEnglishSearchFontName( aSearchName ); @@ -2642,7 +2642,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, String aSearchFamilyName; FontWeight eSearchWeight = rFSD.GetWeight(); FontWidth eSearchWidth = rFSD.GetWidthType(); - sal_uLong nSearchType = 0; + sal_uLong nSearchType = 0; FontSubstConfiguration::getMapName( aSearchName, aSearchShortName, aSearchFamilyName, eSearchWeight, eSearchWidth, nSearchType ); @@ -2672,7 +2672,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, // use font fallback const FontNameAttr* pFontAttr = NULL; - if( aSearchName.Len() ) + if( aSearchName.getLength() ) { // get fallback info using FontSubstConfiguration and // the target name, it's shortened name and family name in that order @@ -2703,10 +2703,10 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, } // now try the other font name tokens - while( nTokenPos != STRING_NOTFOUND ) + while( nTokenPos != -1 ) { rFSD.maTargetName = GetNextFontToken( rFSD.GetFamilyName(), nTokenPos ); - if( !rFSD.maTargetName.Len() ) + if( !rFSD.maTargetName.getLength() ) continue; aSearchName = rFSD.maTargetName; @@ -2714,7 +2714,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, String aTempShortName; String aTempFamilyName; - sal_uLong nTempType = 0; + sal_uLong nTempType = 0; FontWeight eTempWeight = rFSD.GetWeight(); FontWidth eTempWidth = WIDTH_DONTKNOW; FontSubstConfiguration::getMapName( aSearchName, aTempShortName, aTempFamilyName, @@ -3406,7 +3406,7 @@ ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData ) } else { - xub_StrLen nTokenPos = 0; + sal_Int32 nTokenPos = 0; SetFamilyName( GetNextFontToken( rFontSelData.GetFamilyName(), nTokenPos ) ); SetStyleName( rFontSelData.GetStyleName() ); mbDevice = false; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 38960afc044b..dc3ca9ab6f1a 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -319,8 +319,8 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl { ImplInitFontList(); String aConfigFont = utl::DefaultFontConfiguration::get().getUserInterfaceFont( rSettings.GetUILanguageTag().getLocale() ); - xub_StrLen nIndex = 0; - while( nIndex != STRING_NOTFOUND ) + sal_Int32 nIndex = 0; + while( nIndex != -1 ) { String aName( aConfigFont.GetToken( 0, ';', nIndex ) ); if ( aName.Len() && mpWindowImpl->mpFrameData->mpFontList->FindFontFamily( aName ) ) |