Guest User

git diff

a guest
Feb 27th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 57.26 KB | None | 0 0
  1. elixir@ubuntu:~/lo$ git diff --color
  2. diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
  3. index c734642..1a31330 100644
  4. --- a/basctl/source/basicide/bastype3.cxx
  5. +++ b/basctl/source/basicide/bastype3.cxx
  6. @@ -221,7 +221,7 @@ SbxVariable* TreeListBox::FindVariable( SvTreeListEntry* pEntry )
  7. // extract the module name from the string like "Sheet1 (Example1)"
  8. if( bDocumentObjects )
  9. {
  10. - sal_uInt16 nIndex = 0;
  11. + sal_Int32 nIndex = 0;
  12. aName = aName.GetToken( 0, ' ', nIndex );
  13. }
  14. pVar = static_cast<StarBASIC*>(pVar)->FindModule( aName );
  15. diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
  16. index cb843d6..f172160 100644
  17. --- a/basctl/source/basicide/macrodlg.cxx
  18. +++ b/basctl/source/basicide/macrodlg.cxx
  19. @@ -355,7 +355,7 @@ SbMethod* MacroChooser::CreateMacro()
  20. // extract the module name from the string like "Sheet1 (Example1)"
  21. if( aDesc.GetLibSubName() == IDE_RESSTR(RID_STR_DOCUMENT_OBJECTS) )
  22. {
  23. - sal_uInt16 nIndex = 0;
  24. + sal_Int32 nIndex = 0;
  25. aModName = aModName.GetToken( 0, ' ', nIndex );
  26. }
  27. pModule = pBasic->FindModule( aModName );
  28. @@ -663,7 +663,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
  29. // extract the module name from the string like "Sheet1 (Example1)"
  30. if( aDesc.GetLibSubName() == IDE_RESSTR(RID_STR_DOCUMENT_OBJECTS) )
  31. {
  32. - sal_uInt16 nIndex = 0;
  33. + sal_Int32 nIndex = 0;
  34. aMod = aMod.GetToken( 0, ' ', nIndex );
  35. }
  36. String aSub( aDesc.GetMethodName() );
  37. diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
  38. index 7bfbbf5..cc3bcc0 100644
  39. --- a/cui/source/dialogs/scriptdlg.cxx
  40. +++ b/cui/source/dialogs/scriptdlg.cxx
  41. @@ -1232,8 +1232,8 @@ void SvxScriptOrgDialog::RestorePreviousSelection()
  42. if( aStoredEntry.Len() <= 0 )
  43. return;
  44. SvTreeListEntry* pEntry = 0;
  45. - sal_uInt16 nIndex = 0;
  46. - while ( nIndex != STRING_NOTFOUND )
  47. + sal_Int32 nIndex = 0;
  48. + while ( nIndex != -1 )
  49. {
  50. String aTmp( aStoredEntry.GetToken( 0, ';', nIndex ) );
  51. SvTreeListEntry* pTmpEntry = m_pScriptsBox->FirstChild( pEntry );
  52. diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
  53. index db8aa6c..d3144fc 100644
  54. --- a/filter/source/msfilter/util.cxx
  55. +++ b/filter/source/msfilter/util.cxx
  56. @@ -163,7 +163,7 @@ sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cChar,
  57. let words own font substitution kick in
  58. */
  59. rChrSet = RTL_TEXTENCODING_UNICODE;
  60. - xub_StrLen nIndex = 0;
  61. + sal_Int32 nIndex = 0;
  62. rFontName = ::GetNextFontToken(rFontName, nIndex);
  63. }
  64. else
  65. diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
  66. index 74bf784..592005c 100644
  67. --- a/fpicker/source/office/iodlg.cxx
  68. +++ b/fpicker/source/office/iodlg.cxx
  69. @@ -1467,8 +1467,8 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl
  70.  
  71. if ( _bMultiExt )
  72. {
  73. - sal_uInt16 nIdx = 0;
  74. - while ( !pFoundFilter && nIdx != STRING_NOTFOUND )
  75. + sal_Int32 nIdx = 0;
  76. + while ( !pFoundFilter && nIdx != -1 )
  77. {
  78. aSingleType = rType.GetToken( 0, FILEDIALOG_DEF_EXTSEP, nIdx );
  79. #ifdef UNX
  80. @@ -3305,7 +3305,8 @@ void SvtFileDialog::appendDefaultExtension(String& _rFileName,
  81. if ( ! aType.EqualsAscii(FILEDIALOG_FILTER_ALL) )
  82. {
  83. sal_uInt16 nWildCard = comphelper::string::getTokenCount(aType, FILEDIALOG_DEF_EXTSEP);
  84. - sal_uInt16 nIndex, nPos = 0;
  85. + sal_uInt16 nIndex;
  86. + sal_Int32 nPos = 0;
  87.  
  88. for ( nIndex = 0; nIndex < nWildCard; nIndex++ )
  89. {
  90. diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
  91. index 6d3869b..7ad8114 100644
  92. --- a/sfx2/source/appl/childwin.cxx
  93. +++ b/sfx2/source/appl/childwin.cxx
  94. @@ -104,7 +104,7 @@ sal_Bool GetPosSizeFromString( const String& rStr, Point& rPos, Size& rSize )
  95. if ( comphelper::string::getTokenCount(rStr, '/') != 4 )
  96. return sal_False;
  97.  
  98. - xub_StrLen nIdx = 0;
  99. + sal_Int32 nIdx = 0;
  100. rPos.X() = rStr.GetToken(0, '/', nIdx).ToInt32();
  101. rPos.Y() = rStr.GetToken(0, '/', nIdx).ToInt32();
  102. rSize.Width() = rStr.GetToken(0, '/', nIdx).ToInt32();
  103. diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
  104. index 91cf2e7..32d3919 100644
  105. --- a/sfx2/source/appl/linkmgr2.cxx
  106. +++ b/sfx2/source/appl/linkmgr2.cxx
  107. @@ -238,7 +238,7 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * pLink,
  108. case OBJECT_CLIENT_GRF:
  109. case OBJECT_CLIENT_OLE:
  110. {
  111. - sal_uInt16 nPos = 0;
  112. + sal_Int32 nPos = 0;
  113. String sFile( sLNm.GetToken( 0, ::sfx2::cTokenSeperator, nPos ) );
  114. String sRange( sLNm.GetToken( 0, ::sfx2::cTokenSeperator, nPos ) );
  115.  
  116. @@ -262,7 +262,7 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * pLink,
  117. break;
  118. case OBJECT_CLIENT_DDE:
  119. {
  120. - sal_uInt16 nTmp = 0;
  121. + sal_Int32 nTmp = 0;
  122. String sCmd( sLNm );
  123. String sServer( sCmd.GetToken( 0, cTokenSeperator, nTmp ) );
  124. String sTopic( sCmd.GetToken( 0, cTokenSeperator, nTmp ) );
  125. diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
  126. index 9cbd3b2..f649c60 100644
  127. --- a/sfx2/source/appl/lnkbase2.cxx
  128. +++ b/sfx2/source/appl/lnkbase2.cxx
  129. @@ -602,7 +602,7 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* pItemStt )
  130. return 0;
  131.  
  132. String sNm( rLinkName );
  133. - sal_uInt16 nTokenPos = 0;
  134. + sal_Int32 nTokenPos = 0;
  135. rtl::OUString sService( sNm.GetToken( 0, cTokenSeperator, nTokenPos ) );
  136.  
  137. DdeServices& rSvc = DdeService::GetServices();
  138. diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
  139. index 066de34..8fca1a3 100644
  140. --- a/sfx2/source/appl/newhelp.cxx
  141. +++ b/sfx2/source/appl/newhelp.cxx
  142. @@ -320,7 +320,7 @@ void ContentListBox_Impl::InitRoot()
  143. {
  144. String aRow( pEntries[i] );
  145. String aTitle, aURL;
  146. - xub_StrLen nIdx = 0;
  147. + sal_Int32 nIdx = 0;
  148. aTitle = aRow.GetToken( 0, '\t', nIdx );
  149. aURL = aRow.GetToken( 0, '\t', nIdx );
  150. sal_Unicode cFolder = aRow.GetToken( 0, '\t', nIdx ).GetChar(0);
  151. @@ -364,7 +364,7 @@ void ContentListBox_Impl::RequestingChildren( SvTreeListEntry* pParent )
  152. {
  153. String aRow( pEntries[i] );
  154. String aTitle, aURL;
  155. - xub_StrLen nIdx = 0;
  156. + sal_Int32 nIdx = 0;
  157. aTitle = aRow.GetToken( 0, '\t', nIdx );
  158. aURL = aRow.GetToken( 0, '\t', nIdx );
  159. sal_Unicode cFolder = aRow.GetToken( 0, '\t', nIdx ).GetChar(0);
  160. @@ -1082,7 +1082,7 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, SearchHdl)
  161. {
  162. String aRow( pFacs[i] );
  163. String aTitle, aType;
  164. - xub_StrLen nIdx = 0;
  165. + sal_Int32 nIdx = 0;
  166. aTitle = aRow.GetToken( 0, '\t', nIdx );
  167. aType = aRow.GetToken( 0, '\t', nIdx );
  168. String* pURL = new String( aRow.GetToken( 0, '\t', nIdx ) );
  169. @@ -1601,7 +1601,7 @@ void SfxHelpIndexWindow_Impl::Initialize()
  170. {
  171. String aRow( pFacs[i] );
  172. String aTitle, aType, aURL;
  173. - xub_StrLen nIdx = 0;
  174. + sal_Int32 nIdx = 0;
  175. aTitle = aRow.GetToken( 0, '\t', nIdx );
  176. aType = aRow.GetToken( 0, '\t', nIdx );
  177. aURL = aRow.GetToken( 0, '\t', nIdx );
  178. @@ -2952,7 +2952,7 @@ void SfxHelpWindow_Impl::LoadConfig()
  179. {
  180. aUserData = String( aTemp );
  181. DBG_ASSERT( comphelper::string::getTokenCount(aUserData, ';') == 6, "invalid user data" );
  182. - sal_uInt16 nIdx = 0;
  183. + sal_Int32 nIdx = 0;
  184. nIndexSize = aUserData.GetToken( 0, ';', nIdx ).ToInt32();
  185. nTextSize = aUserData.GetToken( 0, ';', nIdx ).ToInt32();
  186. sal_Int32 nWidth = aUserData.GetToken( 0, ';', nIdx ).ToInt32();
  187. diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx
  188. index 7d7c45a..c5745f0 100644
  189. --- a/sfx2/source/dialog/srchdlg.cxx
  190. +++ b/sfx2/source/dialog/srchdlg.cxx
  191. @@ -89,7 +89,7 @@ void SearchDialog::LoadConfig()
  192. {
  193. String sUserData( aTemp );
  194. DBG_ASSERT( comphelper::string::getTokenCount(sUserData, ';') == 5, "invalid config data" );
  195. - xub_StrLen nIdx = 0;
  196. + sal_Int32 nIdx = 0;
  197. String sSearchText = sUserData.GetToken( 0, ';', nIdx );
  198. m_aWholeWordsBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 );
  199. m_aMatchCaseBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 );
  200. @@ -97,7 +97,7 @@ void SearchDialog::LoadConfig()
  201. m_aBackwardsBox.Check( sUserData.GetToken( 0, ';', nIdx ).ToInt32() == 1 );
  202.  
  203. nIdx = 0;
  204. - while ( nIdx != STRING_NOTFOUND )
  205. + while ( nIdx != -1 )
  206. m_aSearchEdit.InsertEntry( sSearchText.GetToken( 0, '\t', nIdx ) );
  207. m_aSearchEdit.SelectEntryPos(0);
  208. }
  209. diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
  210. index dfb0a10..5b021fb 100644
  211. --- a/svtools/source/contnr/fileview.cxx
  212. +++ b/svtools/source/contnr/fileview.cxx
  213. @@ -1599,7 +1599,7 @@ void SvtFileView::SetConfigString( const String& rCfgStr )
  214. HeaderBar* pBar = mpImp->mpView->GetHeaderBar();
  215. DBG_ASSERT( pBar, "invalid headerbar" );
  216.  
  217. - sal_uInt16 nIdx = 0;
  218. + sal_Int32 nIdx = 0;
  219. mpImp->mnSortColumn = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
  220. sal_Bool bUp = (sal_Bool)(sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
  221. HeaderBarItemBits nBits = pBar->GetItemBits( mpImp->mnSortColumn );
  222. @@ -1616,7 +1616,7 @@ void SvtFileView::SetConfigString( const String& rCfgStr )
  223. }
  224. pBar->SetItemBits( mpImp->mnSortColumn, nBits );
  225.  
  226. - while ( nIdx != STRING_NOTFOUND )
  227. + while ( nIdx != -1 )
  228. {
  229. sal_uInt16 nItemId = (sal_uInt16)rCfgStr.GetToken( 0, ';', nIdx ).ToInt32();
  230. pBar->SetItemSize( nItemId, rCfgStr.GetToken( 0, ';', nIdx ).ToInt32() );
  231. diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx
  232. index 185e024..263404c 100644
  233. --- a/svtools/source/urlobj/inetimg.cxx
  234. +++ b/svtools/source/urlobj/inetimg.cxx
  235. @@ -64,7 +64,7 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uLong nFormat )
  236. case SOT_FORMATSTR_ID_INET_IMAGE:
  237. {
  238. String sINetImg = read_zeroTerminated_uInt8s_ToOUString(rIStm, RTL_TEXTENCODING_UTF8);
  239. - xub_StrLen nStart = 0;
  240. + sal_Int32 nStart = 0;
  241. aImageURL = sINetImg.GetToken( 0, TOKEN_SEPARATOR, nStart );
  242. aTargetURL = sINetImg.GetToken( 0, TOKEN_SEPARATOR, nStart );
  243. aTargetFrame = sINetImg.GetToken( 0, TOKEN_SEPARATOR, nStart );
  244. diff --git a/unotools/inc/unotools/fontdefs.hxx b/unotools/inc/unotools/fontdefs.hxx
  245. index df79a0f..7ed00a8 100644
  246. --- a/unotools/inc/unotools/fontdefs.hxx
  247. +++ b/unotools/inc/unotools/fontdefs.hxx
  248. @@ -86,7 +86,7 @@ public:
  249.  
  250. UNOTOOLS_DLLPUBLIC String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex );
  251.  
  252. -UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( String& rName );
  253. +UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( OUString& rName );
  254.  
  255. #endif
  256.  
  257. diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
  258. index a111488..06eeafc 100644
  259. --- a/unotools/source/misc/fontcvt.cxx
  260. +++ b/unotools/source/misc/fontcvt.cxx
  261. @@ -1432,40 +1432,40 @@ static ConvertChar aImplStarSymbolCvt = { NULL, "StarBats", ImplStarSymbolToStar
  262. const ConvertChar* ConvertChar::GetRecodeData( const String& rOrgFontName, const String& rMapFontName )
  263. {
  264. const ConvertChar* pCvt = NULL;
  265. - String aOrgName( rOrgFontName );
  266. + OUString aOrgName( rOrgFontName );
  267. GetEnglishSearchFontName( aOrgName );
  268. - String aMapName( rMapFontName );
  269. + OUString aMapName( rMapFontName );
  270. GetEnglishSearchFontName( aMapName );
  271.  
  272. - if( aMapName.EqualsAscii( "starsymbol" )
  273. - || aMapName.EqualsAscii( "opensymbol" ) )
  274. + if( aMapName == "starsymbol"
  275. + || aMapName == "opensymbol" )
  276. {
  277. int nEntries = SAL_N_ELEMENTS(aStarSymbolRecodeTable);
  278. for( int i = 0; i < nEntries; ++i)
  279. {
  280. RecodeTable& r = aStarSymbolRecodeTable[i];
  281. - if( aOrgName.EqualsAscii( r.pOrgName ) )
  282. + if( aOrgName.equalsAscii( r.pOrgName ) )
  283. { pCvt = &r.aCvt; break; }
  284. }
  285. }
  286. //It's plausible that it's better to implement this
  287. //as an additional encoding alongside the existing
  288. //adobe-symbol to unicode conversion in rtl instead
  289. - else if( aMapName.EqualsAscii("applesymbol") )
  290. + else if( aMapName == "applesymbol" )
  291. {
  292. int nEntries = SAL_N_ELEMENTS(aAppleSymbolRecodeTable);
  293. for( int i = 0; i < nEntries; ++i)
  294. {
  295. RecodeTable& r = aAppleSymbolRecodeTable[i];
  296. - if( aOrgName.EqualsAscii( r.pOrgName ) )
  297. + if( aOrgName.equalsAscii( r.pOrgName ) )
  298. { pCvt = &r.aCvt; break; }
  299. }
  300. }
  301. - else if( aMapName.EqualsAscii( "starbats" ) )
  302. + else if( aMapName == "starbats" )
  303. {
  304. - if( aOrgName.EqualsAscii( "starsymbol" ) )
  305. + if( aOrgName == "starsymbol" )
  306. pCvt = &aImplStarSymbolCvt;
  307. - else if( aOrgName.EqualsAscii( "opensymbol" ) )
  308. + else if( aOrgName == "opensymbol" )
  309. pCvt = &aImplStarSymbolCvt;
  310. }
  311.  
  312. @@ -1479,7 +1479,7 @@ FontToSubsFontConverter CreateFontToSubsFontConverter(
  313. {
  314. const ConvertChar* pCvt = NULL;
  315.  
  316. - String aName = rOrgName;
  317. + OUString aName = rOrgName;
  318. GetEnglishSearchFontName( aName );
  319.  
  320. if ( nFlags & FONTTOSUBSFONT_IMPORT )
  321. @@ -1490,15 +1490,15 @@ FontToSubsFontConverter CreateFontToSubsFontConverter(
  322. for( int i = 0; i < nEntries; ++i )
  323. {
  324. RecodeTable& r = aStarSymbolRecodeTable[i];
  325. - if( aName.EqualsAscii( r.pOrgName ) )
  326. + if( aName.equalsAscii( r.pOrgName ) )
  327. { pCvt = &r.aCvt; break; }
  328. }
  329. }
  330. else
  331. {
  332. // TODO: FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS
  333. - if( aName.EqualsAscii( "starsymbol" ) ) pCvt = &aImplStarSymbolCvt;
  334. - else if( aName.EqualsAscii( "opensymbol" ) ) pCvt = &aImplStarSymbolCvt;
  335. + if( aName == "starsymbol" ) pCvt = &aImplStarSymbolCvt;
  336. + else if( aName == "opensymbol" ) pCvt = &aImplStarSymbolCvt;
  337. }
  338.  
  339. return (FontToSubsFontConverter)pCvt;
  340. diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
  341. index 7785e807..1fa8841 100644
  342. --- a/unotools/source/misc/fontdefs.cxx
  343. +++ b/unotools/source/misc/fontdefs.cxx
  344. @@ -20,6 +20,7 @@
  345. #include <unotools/fontdefs.hxx>
  346. #include <unotools/fontcfg.hxx>
  347. #include <boost/unordered_map.hpp>
  348. +#include <rtl/ustrbuf.hxx>
  349.  
  350. struct ImplLocalizedFontName
  351. {
  352. @@ -321,42 +322,42 @@ static ImplLocalizedFontName aImplLocalizedNamesList[] =
  353.  
  354. // -----------------------------------------------------------------------
  355.  
  356. -void GetEnglishSearchFontName( String& rName )
  357. +void GetEnglishSearchFontName( OUString& rName )
  358. {
  359. bool bNeedTranslation = false;
  360. - xub_StrLen nLen = rName.Len();
  361. + sal_Int32 nLen = rName.getLength();
  362.  
  363. // Remove trailing whitespaces
  364. - xub_StrLen i = nLen;
  365. - while ( i && (rName.GetChar( i-1 ) < 32) )
  366. + sal_Int32 i = nLen;
  367. + while ( i && (rName[ i-1 ] < 32) )
  368. i--;
  369. if ( i != nLen )
  370. - rName.Erase( i );
  371. + rName.copy( 0, i );
  372.  
  373. // Remove Script at the end
  374. // Scriptname must be the last part of the fontname and
  375. // looks like "fontname (scriptname)". So there can only be a
  376. // script name at the and of the fontname, when the last char is ')'
  377. - if ( (nLen >= 3) && rName.GetChar( nLen-1 ) == ')' )
  378. + if ( (nLen >= 3) && rName[ nLen-1 ] == ')' )
  379. {
  380. int nOpen = 1;
  381. - xub_StrLen nTempLen = nLen-2;
  382. + sal_Int32 nTempLen = nLen-2;
  383. while ( nTempLen )
  384. {
  385. - if ( rName.GetChar( nTempLen ) == '(' )
  386. + if ( rName[ nTempLen ] == '(' )
  387. {
  388. nOpen--;
  389. if ( !nOpen )
  390. {
  391. // Remove Space at the end
  392. - if ( nTempLen && (rName.GetChar( nTempLen-1 ) == ' ') )
  393. + if ( nTempLen && (rName[ nTempLen-1 ] == ' ') )
  394. nTempLen--;
  395. - rName.Erase( nTempLen );
  396. + rName.copy( 0, nTempLen );
  397. nLen = nTempLen;
  398. break;
  399. }
  400. }
  401. - if ( rName.GetChar( nTempLen ) == ')' )
  402. + if ( rName[ nTempLen ] == ')' )
  403. nOpen++;
  404. nTempLen--;
  405. }
  406. @@ -367,7 +368,7 @@ void GetEnglishSearchFontName( String& rName )
  407. i = 0;
  408. while ( i < nLen )
  409. {
  410. - sal_Unicode c = rName.GetChar( i );
  411. + sal_Unicode c = rName[ i ];
  412. if ( c > 127 )
  413. {
  414. // Translate to Lowercase-ASCII
  415. @@ -378,8 +379,13 @@ void GetEnglishSearchFontName( String& rName )
  416. // Upper to Lower
  417. if ( (c >= 'A') && (c <= 'Z') )
  418. c += 'a' - 'A';
  419. - rName.SetChar( i, c );
  420. - }
  421. + //rName[ i ] = c ;
  422. +
  423. + OUStringBuffer aTmpStr( rName.getStr() ) ;
  424. + aTmpStr[ i ] = c ;
  425. + rName = aTmpStr.makeStringAndClear() ;
  426. +
  427. + }
  428. else
  429. {
  430. // Only Fontnames with None-Ascii-Characters must be translated
  431. @@ -393,12 +399,21 @@ void GetEnglishSearchFontName( String& rName )
  432. if ( (c >= 'A') && (c <= 'Z') )
  433. {
  434. c += 'a' - 'A';
  435. - rName.SetChar( i, c );
  436. + //rName[ i ] = c ;
  437. +
  438. + OUStringBuffer aTmpStr( rName.getStr() ) ;
  439. + aTmpStr[ i ] = c ;
  440. + rName = aTmpStr.makeStringAndClear() ;
  441. +
  442. }
  443. else if( ((c < '0') || (c > '9')) && (c != ';') ) // not 0-9 or semicolon
  444. {
  445. // Remove white spaces and special characters
  446. - rName.Erase( i, 1 );
  447. +
  448. + OUStringBuffer aTmpStr( rName.getStr() ) ;
  449. + aTmpStr.remove(i,1);
  450. + rName = aTmpStr.makeStringAndClear() ;
  451. +
  452. nLen--;
  453. continue;
  454. }
  455. @@ -423,41 +438,41 @@ void GetEnglishSearchFontName( String& rName )
  456.  
  457. FontNameDictionary::const_iterator it = aDictionary.find( rName );
  458. if( it != aDictionary.end() )
  459. - rName.AssignAscii( it->second );
  460. + rName = OUString::createFromAscii ( it->second ) ;
  461. }
  462. }
  463.  
  464. // -----------------------------------------------------------------------
  465.  
  466. -String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex )
  467. +OUString GetNextFontToken( const OUString& rTokenStr, sal_Int32& rIndex )
  468. {
  469. // check for valid start index
  470. - int nStringLen = rTokenStr.Len();
  471. + int nStringLen = rTokenStr.getLength();
  472. if( rIndex >= nStringLen )
  473. {
  474. - rIndex = STRING_NOTFOUND;
  475. - return String();
  476. + rIndex = -1;
  477. + return OUString();
  478. }
  479.  
  480. // find the next token delimiter and return the token substring
  481. - const sal_Unicode* pStr = rTokenStr.GetBuffer() + rIndex;
  482. - const sal_Unicode* pEnd = rTokenStr.GetBuffer() + nStringLen;
  483. + const sal_Unicode* pStr = rTokenStr.getStr() + rIndex;
  484. + const sal_Unicode* pEnd = rTokenStr.getStr() + nStringLen;
  485. for(; pStr < pEnd; ++pStr )
  486. if( (*pStr == ';') || (*pStr == ',') )
  487. break;
  488.  
  489. - xub_StrLen nTokenStart = rIndex;
  490. - xub_StrLen nTokenLen;
  491. + sal_Int32 nTokenStart = rIndex;
  492. + sal_Int32 nTokenLen;
  493. if( pStr < pEnd )
  494. {
  495. - rIndex = sal::static_int_cast<xub_StrLen>(pStr - rTokenStr.GetBuffer());
  496. + rIndex = sal::static_int_cast<sal_Int32>(pStr - rTokenStr.getStr());
  497. nTokenLen = rIndex - nTokenStart;
  498. ++rIndex; // skip over token separator
  499. }
  500. else
  501. {
  502. // no token delimiter found => handle last token
  503. - rIndex = STRING_NOTFOUND;
  504. + rIndex = -1;
  505. nTokenLen = STRING_LEN;
  506.  
  507. // optimize if the token string consists of just one token
  508. @@ -470,17 +485,17 @@ String GetNextFontToken( const String& rTokenStr, xub_StrLen& rIndex )
  509.  
  510. // =======================================================================
  511.  
  512. -static bool ImplIsFontToken( const String& rName, const String& rToken )
  513. +static bool ImplIsFontToken( const OUString& rName, const String& rToken )
  514. {
  515. - String aTempName;
  516. - xub_StrLen nIndex = 0;
  517. + OUString aTempName;
  518. + sal_Int32 nIndex = 0;
  519. do
  520. {
  521. aTempName = GetNextFontToken( rName, nIndex );
  522. if ( rToken == aTempName )
  523. return true;
  524. }
  525. - while ( nIndex != STRING_NOTFOUND );
  526. + while ( nIndex != -1 );
  527.  
  528. return false;
  529. }
  530. @@ -506,18 +521,18 @@ void AddTokenFontName( String& rName, const String& rNewToken )
  531.  
  532. // =======================================================================
  533.  
  534. -String GetSubsFontName( const String& rName, sal_uLong nFlags )
  535. +String GetSubsFontName( const OUString& rName, sal_uLong nFlags )
  536. {
  537. String aName;
  538.  
  539. - xub_StrLen nIndex = 0;
  540. - String aOrgName = GetNextFontToken( rName, nIndex );
  541. + sal_Int32 nIndex = 0;
  542. + OUString aOrgName = GetNextFontToken( rName, nIndex );
  543. GetEnglishSearchFontName( aOrgName );
  544.  
  545. // #93662# do not try to replace StarSymbol with MS only font
  546. if( nFlags == (SUBSFONT_MS|SUBSFONT_ONLYONE)
  547. - && ( aOrgName.EqualsAscii( "starsymbol" )
  548. - || aOrgName.EqualsAscii( "opensymbol" ) ) )
  549. + && ( aOrgName == "starsymbol"
  550. + || aOrgName == "opensymbol" ) )
  551. return aName;
  552.  
  553. const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get().getSubstInfo( aOrgName );
  554. diff --git a/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx b/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx
  555. index 8e2a4bb..93c487e 100644
  556. --- a/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx
  557. +++ b/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx
  558. @@ -296,16 +296,16 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF
  559. continue;
  560.  
  561. // convert to unicode name
  562. - UniString aUtf16Name;
  563. + OUString aUtf16Name;
  564. if( eEncoding == RTL_TEXTENCODING_UNICODE ) // we are just interested in UTF16 encoded names
  565. - aUtf16Name = rtl::OUString( (const sal_Unicode*)&aNameBuffer[0], nNameLength/2 );
  566. + aUtf16Name = OUString( (const sal_Unicode*)&aNameBuffer[0], nNameLength/2 );
  567. else if( eEncoding == RTL_TEXTENCODING_UCS4 )
  568. - aUtf16Name = UniString(); // TODO
  569. + aUtf16Name = OUString(); // TODO
  570. else // assume the non-unicode encoded names are byte encoded
  571. - aUtf16Name = UniString( &aNameBuffer[0], nNameLength, eEncoding );
  572. + aUtf16Name = OUString( &aNameBuffer[0], nNameLength, eEncoding );
  573.  
  574. // ignore empty strings
  575. - if( aUtf16Name.Len() <= 0 )
  576. + if( aUtf16Name.getLength() <= 0 )
  577. continue;
  578.  
  579. // handle the name depending on its namecode
  580. @@ -313,7 +313,7 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF
  581. {
  582. case kFontFamilyName:
  583. // ignore font names starting with '.'
  584. - if( aUtf16Name.GetChar(0) == '.' )
  585. + if( aUtf16Name[0] == '.' )
  586. nNameValue = 0;
  587. else if( rDFA.GetFamilyName().Len() )
  588. {
  589. diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx
  590. index 73d1d3a..53767ba 100644
  591. --- a/vcl/generic/fontmanager/fontsubst.cxx
  592. +++ b/vcl/generic/fontmanager/fontsubst.cxx
  593. @@ -161,8 +161,8 @@ bool FcPreMatchSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelDa
  594. if( rFontSelData.IsSymbolFont() )
  595. return false;
  596. // StarSymbol is a unicode font, but it still deserves the symbol flag
  597. - if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "starsymbol", 10)
  598. - || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) )
  599. + if( 0 == rFontSelData.maSearchName.compareTo( "starsymbol", 10)
  600. + || 0 == rFontSelData.maSearchName.compareTo( "opensymbol", 10) )
  601. return false;
  602.  
  603. //see fdo#41556 and fdo#47636
  604. @@ -188,7 +188,7 @@ bool FcPreMatchSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelDa
  605. rtl::OUString aDummy;
  606. const FontSelectPattern aOut = GetFcSubstitute( rFontSelData, aDummy );
  607.  
  608. - if( !aOut.maSearchName.Len() )
  609. + if( !aOut.maSearchName.getLength() )
  610. return false;
  611.  
  612. const bool bHaveSubstitute = !uselessmatch( rFontSelData, aOut );
  613. @@ -230,8 +230,8 @@ bool FcGlyphFallbackSubstititution::FindFontSubstitute( FontSelectPattern& rFont
  614. if( rFontSelData.IsSymbolFont() )
  615. return false;
  616. // StarSymbol is a unicode font, but it still deserves the symbol flag
  617. - if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "starsymbol", 10)
  618. - || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) )
  619. + if( 0 == rFontSelData.maSearchName.compareTo( "starsymbol", 10)
  620. + || 0 == rFontSelData.maSearchName.compareTo( "opensymbol", 10) )
  621. return false;
  622.  
  623. const FontSelectPattern aOut = GetFcSubstitute( rFontSelData, rMissingCodes );
  624. @@ -239,7 +239,7 @@ bool FcGlyphFallbackSubstititution::FindFontSubstitute( FontSelectPattern& rFont
  625. // FC doing it would be preferable because it knows the invariables
  626. // e.g. FC knows the FC rule that all Arial gets replaced by LiberationSans
  627. // whereas we would have to check for every size or attribute
  628. - if( !aOut.maSearchName.Len() )
  629. + if( !aOut.maSearchName.getLength() )
  630. return false;
  631.  
  632. const bool bHaveSubstitute = !uselessmatch( rFontSelData, aOut );
  633. diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
  634. index df24b76..aac8088 100644
  635. --- a/vcl/generic/glyphs/gcach_ftyp.cxx
  636. +++ b/vcl/generic/glyphs/gcach_ftyp.cxx
  637. @@ -945,8 +945,8 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
  638.  
  639. //Always consider [star]symbol as symbol fonts
  640. if (
  641. - (rTo.GetFamilyName().EqualsAscii("OpenSymbol")) ||
  642. - (rTo.GetFamilyName().EqualsAscii("StarSymbol"))
  643. + (rTo.GetFamilyName() == "OpenSymbol" ) ||
  644. + (rTo.GetFamilyName() == "StarSymbol" )
  645. )
  646. {
  647. rTo.SetSymbolFlag( true );
  648. diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx
  649. index 79a2d7a..1d1322c 100644
  650. --- a/vcl/generic/glyphs/glyphcache.cxx
  651. +++ b/vcl/generic/glyphs/glyphcache.cxx
  652. @@ -86,7 +86,7 @@ size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData
  653. // TODO: is it worth to improve this hash function?
  654. sal_IntPtr nFontId = reinterpret_cast<sal_IntPtr>( rFontSelData.mpFontData );
  655. #ifdef ENABLE_GRAPHITE
  656. - if (rFontSelData.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
  657. + if (rFontSelData.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX)
  658. != STRING_NOTFOUND)
  659. {
  660. rtl::OString aFeatName = rtl::OUStringToOString( rFontSelData.maTargetName, RTL_TEXTENCODING_UTF8 );
  661. @@ -138,9 +138,9 @@ bool GlyphCache::IFSD_Equal::operator()( const FontSelectPattern& rA, const Font
  662. if (rA.meLanguage != rB.meLanguage)
  663. return false;
  664. // check for features
  665. - if ((rA.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
  666. + if ((rA.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX)
  667. != STRING_NOTFOUND ||
  668. - rB.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
  669. + rB.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX)
  670. != STRING_NOTFOUND) && rA.maTargetName != rB.maTargetName)
  671. return false;
  672. #endif
  673. diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h
  674. index 20c1d36..0842a01 100644
  675. --- a/vcl/inc/outdev.h
  676. +++ b/vcl/inc/outdev.h
  677. @@ -54,9 +54,9 @@ public:
  678. ImplDevFontListData( const String& rSearchName );
  679. ~ImplDevFontListData();
  680.  
  681. - const String& GetFamilyName() const { return maName; }
  682. + const OUString& GetFamilyName() const { return maName; }
  683. const String& GetSearchName() const { return maSearchName; }
  684. - const String& GetAliasNames() const { return maMapNames; }
  685. + const OUString& GetAliasNames() const { return maMapNames; }
  686. bool IsScalable() const { return mpFirst->IsScalable(); }
  687. int GetMinQuality() const { return mnMinQuality; }
  688.  
  689. @@ -73,9 +73,9 @@ public:
  690. private:
  691. friend class ImplDevFontList; // TODO: remove soon
  692. PhysicalFontFace* mpFirst; // linked list of physical font faces
  693. - String maName; // Fontname (original font family name)
  694. + OUString maName; // Fontname (original font family name)
  695. String maSearchName; // normalized font family name
  696. - String maMapNames; // fontname aliases
  697. + OUString maMapNames; // fontname aliases
  698. sal_uIntPtr mnTypeFaces; // Typeface Flags
  699. sal_uIntPtr mnMatchType; // MATCH - Type
  700. String maMatchFamilyName; // MATCH - FamilyName
  701. @@ -148,13 +148,13 @@ protected:
  702.  
  703. struct ImplFontSubstEntry
  704. {
  705. - String maName;
  706. - String maReplaceName;
  707. - String maSearchName;
  708. - String maSearchReplaceName;
  709. - sal_uInt16 mnFlags;
  710. + String maName;
  711. + String maReplaceName;
  712. + OUString maSearchName;
  713. + OUString maSearchReplaceName;
  714. + sal_uInt16 mnFlags;
  715.  
  716. - ImplFontSubstEntry( const String& rFontName, const String& rSubstFontName, sal_uInt16 nSubstFlags );
  717. + ImplFontSubstEntry( const OUString& rFontName, const OUString& rSubstFontName, sal_uInt16 nSubstFlags );
  718. };
  719.  
  720. class ImplDirectFontSubstitution
  721. diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx
  722. index 53ec909..8e355d5 100644
  723. --- a/vcl/inc/outfont.hxx
  724. +++ b/vcl/inc/outfont.hxx
  725. @@ -54,16 +54,16 @@ namespace com { namespace sun { namespace star { namespace lang { struct Locale;
  726. class ImplFontAttributes
  727. {
  728. public: // TODO: create matching interface class
  729. - const String& GetFamilyName() const { return maName; }
  730. - const String& GetStyleName() const { return maStyleName; }
  731. + const OUString& GetFamilyName() const { return maName; }
  732. + const OUString& GetStyleName() const { return maStyleName; }
  733. FontWeight GetWeight() const { return meWeight; }
  734. FontItalic GetSlant() const { return meItalic; }
  735. FontFamily GetFamilyType() const { return meFamily; }
  736. FontPitch GetPitch() const { return mePitch; }
  737. FontWidth GetWidthType() const { return meWidthType; }
  738. bool IsSymbolFont() const { return mbSymbolFlag; }
  739. - void SetFamilyName(const String sFamilyName) { maName = sFamilyName; }
  740. - void SetStyleName( const String sStyleName) { maStyleName = sStyleName; }
  741. + void SetFamilyName(const OUString sFamilyName) { maName = sFamilyName; }
  742. + void SetStyleName( const OUString sStyleName) { maStyleName = sStyleName; }
  743. void SetFamilyType(const FontFamily eFontFamily) { meFamily = eFontFamily; }
  744. void SetPitch(const FontPitch ePitch ) { mePitch = ePitch; }
  745. void SetItalic(const FontItalic eItalic ) { meItalic = eItalic; }
  746. @@ -77,8 +77,8 @@ public: // TODO: create matching interface class
  747. }
  748.  
  749. private:
  750. - String maName; // Font Family Name
  751. - String maStyleName; // Font Style Name
  752. + OUString maName; // Font Family Name
  753. + OUString maStyleName; // Font Style Name
  754. FontWeight meWeight; // Weight Type
  755. FontItalic meItalic; // Slant Type
  756. FontFamily meFamily; // Family Type
  757. @@ -138,8 +138,8 @@ public:
  758. PhysicalFontFace* CreateAlias() const { return Clone(); }
  759.  
  760. bool IsBetterMatch( const FontSelectPattern&, FontMatchStatus& ) const;
  761. - StringCompare CompareWithSize( const PhysicalFontFace& ) const;
  762. - StringCompare CompareIgnoreSize( const PhysicalFontFace& ) const;
  763. + sal_Int32 CompareWithSize( const PhysicalFontFace& ) const;
  764. + sal_Int32 CompareIgnoreSize( const PhysicalFontFace& ) const;
  765. virtual ~PhysicalFontFace() {}
  766. virtual PhysicalFontFace* Clone() const = 0;
  767.  
  768. @@ -172,8 +172,8 @@ public:
  769. }
  770.  
  771. public:
  772. - String maTargetName; // name of the font name token that is chosen
  773. - String maSearchName; // name of the font that matches best
  774. + OUString maTargetName; // name of the font name token that is chosen
  775. + OUString maSearchName; // name of the font that matches best
  776. int mnWidth; // width of font in pixel units
  777. int mnHeight; // height of font in pixel units
  778. float mfExactHeight; // requested height (in pixels with subpixel details)
  779. @@ -231,7 +231,7 @@ public:
  780. // find the device font
  781. ImplDevFontListData* FindFontFamily( const String& rFontName ) const;
  782. ImplDevFontListData* ImplFindByFont( FontSelectPattern&, bool bPrinter, ImplDirectFontSubstitution* ) const;
  783. - ImplDevFontListData* ImplFindBySearchName( const String& ) const;
  784. + ImplDevFontListData* ImplFindBySearchName( const OUString& ) const;
  785.  
  786. // suggest fonts for glyph fallback
  787. ImplDevFontListData* GetGlyphFallbackFont( FontSelectPattern&,
  788. @@ -359,7 +359,7 @@ public: // TODO: make data members private
  789. bool mbInit; // true if maMetric member is valid
  790.  
  791. void AddFallbackForUnicode( sal_UCS4, FontWeight eWeight, const String& rFontName );
  792. - bool GetFallbackForUnicode( sal_UCS4, FontWeight eWeight, String* pFontName ) const;
  793. + bool GetFallbackForUnicode( sal_UCS4, FontWeight eWeight, OUString* pFontName ) const;
  794. void IgnoreFallbackForUnicode( sal_UCS4, FontWeight eWeight, const String& rFontName );
  795.  
  796. private:
  797. diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
  798. index 8356a52..27ae468 100644
  799. --- a/vcl/source/control/combobox.cxx
  800. +++ b/vcl/source/control/combobox.cxx
  801. @@ -382,10 +382,10 @@ IMPL_LINK_NOARG(ComboBox, ImplSelectHdl)
  802. aText = mpSubEdit->GetText();
  803.  
  804. // Alle Eintraege entfernen, zu denen es einen Entry gibt, der aber nicht selektiert ist.
  805. - xub_StrLen nIndex = 0;
  806. - while ( nIndex != STRING_NOTFOUND )
  807. + sal_Int32 nIndex = 0;
  808. + while ( nIndex != -1 )
  809. {
  810. - xub_StrLen nPrevIndex = nIndex;
  811. + sal_Int32 nPrevIndex = nIndex;
  812. XubString aToken = aText.GetToken( 0, mcMultiSep, nIndex );
  813. xub_StrLen nTokenLen = aToken.Len();
  814. aToken = comphelper::string::strip(aToken, ' ');
  815. diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
  816. index b80e8e0..2f16fac 100644
  817. --- a/vcl/source/gdi/font.cxx
  818. +++ b/vcl/source/gdi/font.cxx
  819. @@ -168,7 +168,7 @@ void Impl_Font::AskConfig()
  820. sal_uLong nType = 0;
  821. FontWeight eWeight = WEIGHT_DONTKNOW;
  822. FontWidth eWidthType = WIDTH_DONTKNOW;
  823. - String aMapName = maFamilyName;
  824. + OUString aMapName = maFamilyName;
  825. GetEnglishSearchFontName( aMapName );
  826. utl::FontSubstConfiguration::getMapName( aMapName,
  827. aShortName, aFamilyName, eWeight, eWidthType, nType );
  828. diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
  829. index 1364fcf..50e22a7 100644
  830. --- a/vcl/source/gdi/outdev3.cxx
  831. +++ b/vcl/source/gdi/outdev3.cxx
  832. @@ -60,7 +60,7 @@
  833.  
  834. #include "unotools/fontcvt.hxx"
  835. #include "unotools/fontcfg.hxx"
  836. -
  837. +//#include "unotools/fontdefs.hxx"
  838. #include "osl/file.h"
  839.  
  840. #include <config_graphite.h>
  841. @@ -359,8 +359,8 @@ void ImplDirectFontSubstitution::AddFontSubstitute( const String& rFontName,
  842.  
  843. // -----------------------------------------------------------------------
  844.  
  845. -ImplFontSubstEntry::ImplFontSubstEntry( const String& rFontName,
  846. - const String& rSubstFontName, sal_uInt16 nSubstFlags )
  847. +ImplFontSubstEntry::ImplFontSubstEntry( const OUString& rFontName,
  848. + const OUString& rSubstFontName, sal_uInt16 nSubstFlags )
  849. : maName( rFontName )
  850. , maReplaceName( rSubstFontName )
  851. , mnFlags( nSubstFlags )
  852. @@ -434,11 +434,11 @@ bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName,
  853.  
  854. // -----------------------------------------------------------------------
  855.  
  856. -static void ImplFontSubstitute( String& rFontName,
  857. +static void ImplFontSubstitute( OUString& rFontName,
  858. sal_uInt16 nFlags, ImplDirectFontSubstitution* pDevSpecific )
  859. {
  860. #ifdef DBG_UTIL
  861. - String aTempName = rFontName;
  862. + OUString aTempName = rFontName;
  863. GetEnglishSearchFontName( aTempName );
  864. DBG_ASSERT( aTempName == rFontName, "ImplFontSubstitute() called without a searchname" );
  865. #endif
  866. @@ -553,9 +553,9 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
  867. pOutDev->ImplInitFontList();
  868.  
  869. // Search Font in the FontList
  870. - String aName;
  871. - String aSearchName;
  872. - xub_StrLen nIndex = 0;
  873. + OUString aName;
  874. + OUString aSearchName;
  875. + sal_Int32 nIndex = 0;
  876. do
  877. {
  878. aSearchName = GetNextFontToken( aSearch, nIndex );
  879. @@ -568,7 +568,7 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
  880. break;
  881. }
  882. }
  883. - while ( nIndex != STRING_NOTFOUND );
  884. + while ( nIndex != -1 );
  885. aFont.SetName( aName );
  886. }
  887.  
  888. @@ -582,7 +582,7 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
  889. pOutDev = (const OutputDevice *)ImplGetSVData()->mpDefaultWin;
  890. if( !pOutDev )
  891. {
  892. - xub_StrLen nIndex = 0;
  893. + sal_Int32 nIndex = 0;
  894. aFont.SetName( aSearch.GetToken( 0, ';', nIndex ) );
  895. }
  896. else
  897. @@ -744,14 +744,14 @@ PhysicalFontFace::PhysicalFontFace( const ImplDevFontAttributes& rDFA, int nMagi
  898. {
  899. // StarSymbol is a unicode font, but it still deserves the symbol flag
  900. if( !IsSymbolFont() )
  901. - if( 0 == GetFamilyName().CompareIgnoreCaseToAscii( "starsymbol", 10)
  902. - || 0 == GetFamilyName().CompareIgnoreCaseToAscii( "opensymbol", 10) )
  903. + if( 0 == GetFamilyName().compareTo( "starsymbol", 10)
  904. + || 0 == GetFamilyName().compareTo( "opensymbol", 10) )
  905. SetSymbolFlag( true );
  906. }
  907.  
  908. // -----------------------------------------------------------------------
  909.  
  910. -StringCompare PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther ) const
  911. +sal_Int32 PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther ) const
  912. {
  913. // compare their width, weight, italic and style name
  914. if( GetWidthType() < rOther.GetWidthType() )
  915. @@ -769,15 +769,15 @@ StringCompare PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOthe
  916. else if( GetSlant() > rOther.GetSlant() )
  917. return COMPARE_GREATER;
  918.  
  919. - StringCompare eCompare = GetFamilyName().CompareTo( rOther.GetFamilyName() );
  920. + sal_Int32 eCompare = GetFamilyName().compareTo( rOther.GetFamilyName() );
  921. return eCompare;
  922. }
  923.  
  924. // -----------------------------------------------------------------------
  925.  
  926. -StringCompare PhysicalFontFace::CompareWithSize( const PhysicalFontFace& rOther ) const
  927. +sal_Int32 PhysicalFontFace::CompareWithSize( const PhysicalFontFace& rOther ) const
  928. {
  929. - StringCompare eCompare = CompareIgnoreSize( rOther );
  930. + sal_Int32 eCompare = CompareIgnoreSize( rOther );
  931. if( eCompare != COMPARE_EQUAL )
  932. return eCompare;
  933.  
  934. @@ -809,12 +809,12 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt
  935. {
  936. int nMatch = 0;
  937.  
  938. - const String& rFontName = rFSD.maTargetName;
  939. - if( (rFontName == GetFamilyName()) || rFontName.EqualsIgnoreCaseAscii( GetFamilyName() ) )
  940. + const OUString& rFontName = rFSD.maTargetName;
  941. + if( (rFontName == GetFamilyName()) || rFontName.compareTo( GetFamilyName() ) )
  942. nMatch += 240000;
  943.  
  944. if( rStatus.mpTargetStyleName
  945. - && GetStyleName().EqualsIgnoreCaseAscii( rStatus.mpTargetStyleName ) )
  946. + && GetStyleName().compareTo( rStatus.mpTargetStyleName ) )
  947. nMatch += 120000;
  948.  
  949. if( (rFSD.GetPitch() != PITCH_DONTKNOW) && (rFSD.GetPitch() == GetPitch()) )
  950. @@ -988,7 +988,7 @@ inline void ImplFontEntry::AddFallbackForUnicode( sal_UCS4 cChar, FontWeight eWe
  951.  
  952. // -----------------------------------------------------------------------
  953.  
  954. -inline bool ImplFontEntry::GetFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, String* pFontName ) const
  955. +inline bool ImplFontEntry::GetFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, OUString* pFontName ) const
  956. {
  957. if( !mpUnicodeFallbackList )
  958. return false;
  959. @@ -1113,7 +1113,7 @@ bool ImplDevFontListData::AddFontFace( PhysicalFontFace* pNewData )
  960. PhysicalFontFace** ppHere = &mpFirst;
  961. for(; (pData=*ppHere) != NULL; ppHere=&pData->mpNext )
  962. {
  963. - StringCompare eComp = pNewData->CompareWithSize( *pData );
  964. + sal_Int32 eComp = pNewData->CompareWithSize( *pData );
  965. if( eComp == COMPARE_GREATER )
  966. continue;
  967. if( eComp == COMPARE_LESS )
  968. @@ -1396,7 +1396,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r
  969. cChar = rMissingCodes.iterateCodePoints( &nStrIndex );
  970. bCached = rFontSelData.mpFontEntry->GetFallbackForUnicode( cChar, rFontSelData.GetWeight(), &rFontSelData.maSearchName );
  971. // ignore entries which don't have a fallback
  972. - if( !bCached || (rFontSelData.maSearchName.Len() != 0) )
  973. + if( !bCached || (rFontSelData.maSearchName.getLength() != 0) )
  974. break;
  975. }
  976.  
  977. @@ -1406,7 +1406,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r
  978. // so update rMissingCodes with codepoints not yet resolved by this fallback
  979. int nRemainingLength = 0;
  980. sal_UCS4* pRemainingCodes = (sal_UCS4*)alloca( rMissingCodes.getLength() * sizeof(sal_UCS4) );
  981. - String aFontName;
  982. + OUString aFontName;
  983. while( nStrIndex < rMissingCodes.getLength() )
  984. {
  985. cChar = rMissingCodes.iterateCodePoints( &nStrIndex );
  986. @@ -1424,7 +1424,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r
  987. // apply outdev3.cxx specific fontname normalization
  988. GetEnglishSearchFontName( rFontSelData.maSearchName );
  989. else
  990. - rFontSelData.maSearchName = String();
  991. + rFontSelData.maSearchName = OUString();
  992.  
  993. //See fdo#32665 for an example. FreeSerif that has glyphs in normal
  994. //font, but not in the italic or bold version
  995. @@ -1443,7 +1443,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r
  996. break;
  997. cChar = aOldMissingCodes.iterateCodePoints( &nStrIndex );
  998. }
  999. - if( rFontSelData.maSearchName.Len() != 0 )
  1000. + if( rFontSelData.maSearchName.getLength() != 0 )
  1001. {
  1002. // remove cache entries that were still not resolved
  1003. for( nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); )
  1004. @@ -1456,7 +1456,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r
  1005. }
  1006.  
  1007. // find the matching device font
  1008. - if( rFontSelData.maSearchName.Len() != 0 )
  1009. + if( rFontSelData.maSearchName.getLength() != 0 )
  1010. pFallbackData = FindFontFamily( rFontSelData.maSearchName );
  1011. }
  1012.  
  1013. @@ -1478,7 +1478,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r
  1014.  
  1015. void ImplDevFontList::Add( PhysicalFontFace* pNewData )
  1016. {
  1017. - String aSearchName = pNewData->GetFamilyName();
  1018. + OUString aSearchName = pNewData->GetFamilyName();
  1019. GetEnglishSearchFontName( aSearchName );
  1020.  
  1021. DevFontList::const_iterator it = maDevFontList.find( aSearchName );
  1022. @@ -1501,7 +1501,7 @@ void ImplDevFontList::Add( PhysicalFontFace* pNewData )
  1023. // -----------------------------------------------------------------------
  1024.  
  1025. // find the font from the normalized font family name
  1026. -ImplDevFontListData* ImplDevFontList::ImplFindBySearchName( const String& rSearchName ) const
  1027. +ImplDevFontListData* ImplDevFontList::ImplFindBySearchName( const OUString& rSearchName ) const
  1028. {
  1029. #ifdef DEBUG
  1030. String aTempName = rSearchName;
  1031. @@ -1536,12 +1536,12 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAliasName(const rtl::OUString& r
  1032. while( it != maDevFontList.end() )
  1033. {
  1034. ImplDevFontListData* pData = (*it).second;
  1035. - if( !pData->maMapNames.Len() )
  1036. + if( !pData->maMapNames.getLength() )
  1037. continue;
  1038.  
  1039. // if one alias name matches we found a matching font
  1040. rtl::OUString aTempName;
  1041. - xub_StrLen nIndex = 0;
  1042. + sal_Int32 nIndex = 0;
  1043. do
  1044. {
  1045. aTempName = GetNextFontToken( pData->maMapNames, nIndex );
  1046. @@ -1549,7 +1549,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAliasName(const rtl::OUString& r
  1047. if ( (aTempName == rSearchName) || (aTempName == rShortName) )
  1048. return pData;
  1049. }
  1050. - while ( nIndex != STRING_NOTFOUND );
  1051. + while ( nIndex != -1 );
  1052. }
  1053.  
  1054. return NULL;
  1055. @@ -1560,7 +1560,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAliasName(const rtl::OUString& r
  1056. ImplDevFontListData* ImplDevFontList::FindFontFamily( const String& rFontName ) const
  1057. {
  1058. // normalize the font fomily name and
  1059. - String aName = rFontName;
  1060. + OUString aName = rFontName;
  1061. GetEnglishSearchFontName( aName );
  1062. ImplDevFontListData* pFound = ImplFindBySearchName( aName );
  1063. return pFound;
  1064. @@ -1573,10 +1573,10 @@ ImplDevFontListData* ImplDevFontList::ImplFindByTokenNames(const rtl::OUString&
  1065. ImplDevFontListData* pFoundData = NULL;
  1066.  
  1067. // use normalized font name tokens to find the font
  1068. - for( xub_StrLen nTokenPos = 0; nTokenPos != STRING_NOTFOUND; )
  1069. + for( sal_Int32 nTokenPos = 0; nTokenPos != -1; )
  1070. {
  1071. - String aSearchName = GetNextFontToken( rTokenStr, nTokenPos );
  1072. - if( !aSearchName.Len() )
  1073. + OUString aSearchName = GetNextFontToken( rTokenStr, nTokenPos );
  1074. + if( !aSearchName.getLength() )
  1075. continue;
  1076. GetEnglishSearchFontName( aSearchName );
  1077. pFoundData = ImplFindBySearchName( aSearchName );
  1078. @@ -1597,7 +1597,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNa
  1079. ::std::vector< String >::const_iterator it = rFontAttr.Substitutions.begin();
  1080. for(; it != rFontAttr.Substitutions.end(); ++it )
  1081. {
  1082. - String aSearchName( *it );
  1083. + OUString aSearchName( *it );
  1084. GetEnglishSearchFontName( aSearchName );
  1085.  
  1086. pFoundData = ImplFindBySearchName( aSearchName );
  1087. @@ -2199,8 +2199,8 @@ size_t FontSelectPatternAttributes::hashCode() const
  1088. size_t nHash = aFontNameHash( maSearchName );
  1089. #ifdef ENABLE_GRAPHITE
  1090. // check for features and generate a unique hash if necessary
  1091. - if (maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
  1092. - != STRING_NOTFOUND)
  1093. + if (maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX)
  1094. + != -1)
  1095. {
  1096. nHash = aFontNameHash( maTargetName );
  1097. }
  1098. @@ -2299,9 +2299,9 @@ bool ImplFontCache::IFSD_Equal::operator()(const FontSelectPattern& rA, const Fo
  1099.  
  1100. #ifdef ENABLE_GRAPHITE
  1101. // check for features
  1102. - if ((rA.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
  1103. + if ((rA.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX)
  1104. != STRING_NOTFOUND ||
  1105. - rB.maTargetName.Search(grutils::GrFeatureParser::FEAT_PREFIX)
  1106. + rB.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX)
  1107. != STRING_NOTFOUND) && rA.maTargetName != rB.maTargetName)
  1108. return false;
  1109. #endif
  1110. @@ -2498,8 +2498,8 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
  1111. nSubstFlags |= FONT_SUBSTITUTE_SCREENONLY;
  1112.  
  1113. bool bMultiToken = false;
  1114. - xub_StrLen nTokenPos = 0;
  1115. - String& aSearchName = rFSD.maSearchName; // TODO: get rid of reference
  1116. + sal_Int32 nTokenPos = 0;
  1117. + OUString& aSearchName = rFSD.maSearchName; // TODO: get rid of reference
  1118. for(;;)
  1119. {
  1120. rFSD.maTargetName = GetNextFontToken( rFSD.GetFamilyName(), nTokenPos );
  1121. @@ -2508,11 +2508,11 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
  1122. #ifdef ENABLE_GRAPHITE
  1123. // Until features are properly supported, they are appended to the
  1124. // font name, so we need to strip them off so the font is found.
  1125. - xub_StrLen nFeat = aSearchName.Search(grutils::GrFeatureParser::FEAT_PREFIX);
  1126. + xub_StrLen nFeat = aSearchName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX);
  1127. String aOrigName = rFSD.maTargetName;
  1128. - String aBaseFontName(aSearchName, 0, (nFeat != STRING_NOTFOUND)?nFeat:aSearchName.Len());
  1129. + String aBaseFontName(aSearchName, 0, (nFeat != STRING_NOTFOUND)?nFeat:aSearchName.getLength());
  1130. if (nFeat != STRING_NOTFOUND && STRING_NOTFOUND !=
  1131. - aSearchName.Search(grutils::GrFeatureParser::FEAT_ID_VALUE_SEPARATOR, nFeat))
  1132. + aSearchName.indexOf(grutils::GrFeatureParser::FEAT_ID_VALUE_SEPARATOR, nFeat))
  1133. {
  1134. aSearchName = aBaseFontName;
  1135. rFSD.maTargetName = aBaseFontName;
  1136. @@ -2525,23 +2525,23 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
  1137. // #114999# special emboldening for Ricoh fonts
  1138. // TODO: smarter check for special cases by using PreMatch infrastructure?
  1139. if( (rFSD.GetWeight() > WEIGHT_MEDIUM)
  1140. - && aSearchName.EqualsAscii( "hg", 0, 2) )
  1141. - {
  1142. - String aBoldName;
  1143. - if( aSearchName.EqualsAscii( "hggothicb", 0, 9) )
  1144. - aBoldName = String("hggothice");
  1145. - else if( aSearchName.EqualsAscii( "hgpgothicb", 0, 10) )
  1146. - aBoldName = String("hgpgothice");
  1147. - else if( aSearchName.EqualsAscii( "hgminchol", 0, 9) )
  1148. - aBoldName = String("hgminchob");
  1149. - else if( aSearchName.EqualsAscii( "hgpminchol", 0, 10) )
  1150. - aBoldName = String("hgpminchob");
  1151. - else if( aSearchName.EqualsAscii( "hgminchob" ) )
  1152. - aBoldName = String("hgminchoe");
  1153. - else if( aSearchName.EqualsAscii( "hgpminchob" ) )
  1154. - aBoldName = String("hgpminchoe");
  1155. -
  1156. - if( aBoldName.Len() && ImplFindBySearchName( aBoldName ) )
  1157. + && aSearchName.equalsIgnoreAsciiCase( "hg" ) )
  1158. + {
  1159. + OUString aBoldName;
  1160. + if( aSearchName.equalsIgnoreAsciiCase( "hggothicb" ) )
  1161. + aBoldName = OUString("hggothice");
  1162. + else if( aSearchName.equalsIgnoreAsciiCase( "hgpgothicb" ) )
  1163. + aBoldName = OUString("hgpgothice");
  1164. + else if( aSearchName.equalsIgnoreAsciiCase( "hgminchol" ) )
  1165. + aBoldName = OUString("hgminchob");
  1166. + else if( aSearchName.equalsIgnoreAsciiCase( "hgpminchol" ) )
  1167. + aBoldName = OUString("hgpminchob");
  1168. + else if( aSearchName.equalsIgnoreAsciiCase( "hgminchob" ) )
  1169. + aBoldName = OUString("hgminchoe");
  1170. + else if( aSearchName.equalsIgnoreAsciiCase( "hgpminchob" ) )
  1171. + aBoldName = OUString("hgpminchoe");
  1172. +
  1173. + if( aBoldName.getLength() && ImplFindBySearchName( aBoldName ) )
  1174. {
  1175. // the other font is available => use it
  1176. aSearchName = aBoldName;
  1177. @@ -2597,7 +2597,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
  1178. return pFoundData;
  1179.  
  1180. // break after last font name token was checked unsuccessfully
  1181. - if( nTokenPos == STRING_NOTFOUND)
  1182. + if( nTokenPos == -1 )
  1183. break;
  1184. bMultiToken = true;
  1185. }
  1186. @@ -2607,7 +2607,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
  1187. // available when there is a matching entry in the Tools->Options->Fonts
  1188. // dialog witho neither ALWAYS nor SCREENONLY flags set and the substitution
  1189. // font is available
  1190. - for( nTokenPos = 0; nTokenPos != STRING_NOTFOUND; )
  1191. + for( nTokenPos = 0; nTokenPos != -1; )
  1192. {
  1193. if( bMultiToken )
  1194. {
  1195. @@ -2616,7 +2616,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
  1196. GetEnglishSearchFontName( aSearchName );
  1197. }
  1198. else
  1199. - nTokenPos = STRING_NOTFOUND;
  1200. + nTokenPos = -1;
  1201. if( mpPreMatchHook )
  1202. if( mpPreMatchHook->FindFontSubstitute( rFSD ) )
  1203. GetEnglishSearchFontName( aSearchName );
  1204. @@ -2640,7 +2640,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
  1205. String aSearchFamilyName;
  1206. FontWeight eSearchWeight = rFSD.GetWeight();
  1207. FontWidth eSearchWidth = rFSD.GetWidthType();
  1208. - sal_uLong nSearchType = 0;
  1209. + sal_uLong nSearchType = 0;
  1210. FontSubstConfiguration::getMapName( aSearchName, aSearchShortName, aSearchFamilyName,
  1211. eSearchWeight, eSearchWidth, nSearchType );
  1212.  
  1213. @@ -2670,7 +2670,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
  1214.  
  1215. // use font fallback
  1216. const FontNameAttr* pFontAttr = NULL;
  1217. - if( aSearchName.Len() )
  1218. + if( aSearchName.getLength() )
  1219. {
  1220. // get fallback info using FontSubstConfiguration and
  1221. // the target name, it's shortened name and family name in that order
  1222. @@ -2701,10 +2701,10 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
  1223. }
  1224.  
  1225. // now try the other font name tokens
  1226. - while( nTokenPos != STRING_NOTFOUND )
  1227. + while( nTokenPos != -1 )
  1228. {
  1229. rFSD.maTargetName = GetNextFontToken( rFSD.GetFamilyName(), nTokenPos );
  1230. - if( !rFSD.maTargetName.Len() )
  1231. + if( !rFSD.maTargetName.getLength() )
  1232. continue;
  1233.  
  1234. aSearchName = rFSD.maTargetName;
  1235. @@ -2712,7 +2712,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
  1236.  
  1237. String aTempShortName;
  1238. String aTempFamilyName;
  1239. - sal_uLong nTempType = 0;
  1240. + sal_uLong nTempType = 0;
  1241. FontWeight eTempWeight = rFSD.GetWeight();
  1242. FontWidth eTempWidth = WIDTH_DONTKNOW;
  1243. FontSubstConfiguration::getMapName( aSearchName, aTempShortName, aTempFamilyName,
  1244. @@ -3404,7 +3404,7 @@ ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData )
  1245. }
  1246. else
  1247. {
  1248. - xub_StrLen nTokenPos = 0;
  1249. + sal_Int32 nTokenPos = 0;
  1250. SetFamilyName( GetNextFontToken( rFontSelData.GetFamilyName(), nTokenPos ) );
  1251. SetStyleName( rFontSelData.GetStyleName() );
  1252. mbDevice = false;
  1253. diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
  1254. index 8c6ac82..163b3e8 100644
  1255. --- a/vcl/source/window/window.cxx
  1256. +++ b/vcl/source/window/window.cxx
  1257. @@ -319,7 +319,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
  1258. {
  1259. ImplInitFontList();
  1260. String aConfigFont = utl::DefaultFontConfiguration::get().getUserInterfaceFont( rSettings.GetUILanguageTag().getLocale() );
  1261. - xub_StrLen nIndex = 0;
  1262. + sal_Int32 nIndex = 0;
  1263. while( nIndex != STRING_NOTFOUND )
  1264. {
  1265. String aName( aConfigFont.GetToken( 0, ';', nIndex ) );
  1266. (END)
Advertisement
Add Comment
Please, Sign In to add comment