diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx | 12 | ||||
-rw-r--r-- | vcl/generic/fontmanager/fontsubst.cxx | 12 | ||||
-rw-r--r-- | vcl/generic/glyphs/gcach_ftyp.cxx | 4 | ||||
-rw-r--r-- | vcl/generic/glyphs/glyphcache.cxx | 6 | ||||
-rw-r--r-- | vcl/inc/outdev.h | 20 | ||||
-rw-r--r-- | vcl/inc/outfont.hxx | 26 | ||||
-rw-r--r-- | vcl/source/gdi/font.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 140 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 4 |
9 files changed, 113 insertions, 113 deletions
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 ) ) |