diff options
author | Chr. Rossmanith <ChrRossmanith@gmx.de> | 2013-03-12 10:05:38 +0100 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-03-12 23:12:14 +0000 |
commit | f92a5927052f1e96ed864dd6bc6326531db4fd1f (patch) | |
tree | 613853e86c57e2f932b3f15a432318d98d938d30 /vcl | |
parent | 133fbbcbd3fa8fec3920b53f6b93f5d3c4779a35 (diff) |
Polishing 7d1f4cdec307bb1e761bb5dd3d8231bba5833e10
Change-Id: I73334fca8429dc0ad4250ce638027fa52245dec4
Reviewed-on: https://gerrit.libreoffice.org/2676
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx | 2 | ||||
-rw-r--r-- | vcl/generic/fontmanager/fontsubst.cxx | 6 | ||||
-rw-r--r-- | vcl/generic/glyphs/glyphcache.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 24 |
4 files changed, 19 insertions, 19 deletions
diff --git a/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx b/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx index 2ac160d23c12..502c33bbd502 100644 --- a/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx +++ b/vcl/aqua/source/gdi/atsui/salatsuifontutils.cxx @@ -305,7 +305,7 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF aUtf16Name = OUString( &aNameBuffer[0], nNameLength, eEncoding ); // ignore empty strings - if( aUtf16Name.getLength() <= 0 ) + if( aUtf16Name.isEmpty() ) continue; // handle the name depending on its namecode diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx index fac314cd6fcd..a339ca9ff037 100644 --- a/vcl/generic/fontmanager/fontsubst.cxx +++ b/vcl/generic/fontmanager/fontsubst.cxx @@ -184,10 +184,10 @@ bool FcPreMatchSubstititution::FindFontSubstitute( FontSelectPattern &rFontSelDa return true; } - rtl::OUString aDummy; + OUString aDummy; const FontSelectPattern aOut = GetFcSubstitute( rFontSelData, aDummy ); - if( !aOut.maSearchName.getLength() ) + if( aOut.maSearchName.isEmpty() ) return false; const bool bHaveSubstitute = !uselessmatch( rFontSelData, aOut ); @@ -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.getLength() ) + if( aOut.maSearchName.isEmpty() ) return false; const bool bHaveSubstitute = !uselessmatch( rFontSelData, aOut ); diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx index 1d1322c7a702..bc9fb09410a2 100644 --- a/vcl/generic/glyphs/glyphcache.cxx +++ b/vcl/generic/glyphs/glyphcache.cxx @@ -87,7 +87,7 @@ size_t GlyphCache::IFSD_Hash::operator()( const FontSelectPattern& rFontSelData sal_IntPtr nFontId = reinterpret_cast<sal_IntPtr>( rFontSelData.mpFontData ); #ifdef ENABLE_GRAPHITE if (rFontSelData.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) - != STRING_NOTFOUND) + != -1) { rtl::OString aFeatName = rtl::OUStringToOString( rFontSelData.maTargetName, RTL_TEXTENCODING_UTF8 ); nFontId ^= aFeatName.hashCode(); @@ -139,9 +139,9 @@ bool GlyphCache::IFSD_Equal::operator()( const FontSelectPattern& rA, const Font return false; // check for features if ((rA.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) - != STRING_NOTFOUND || + != -1 || rB.maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) - != STRING_NOTFOUND) && rA.maTargetName != rB.maTargetName) + != -1) && rA.maTargetName != rB.maTargetName) return false; #endif diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index db1db91f5cfe..aeb20c4e6a0c 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -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.getLength() != 0) ) + if( !bCached || !rFontSelData.maSearchName.isEmpty() ) break; } @@ -1443,7 +1443,7 @@ ImplDevFontListData* ImplDevFontList::GetGlyphFallbackFont( FontSelectPattern& r break; cChar = aOldMissingCodes.iterateCodePoints( &nStrIndex ); } - if( rFontSelData.maSearchName.getLength() != 0 ) + if( !rFontSelData.maSearchName.isEmpty() ) { // 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.getLength() != 0 ) + if( !rFontSelData.maSearchName.isEmpty() ) pFallbackData = FindFontFamily( rFontSelData.maSearchName ); } @@ -1536,11 +1536,11 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAliasName(const rtl::OUString& r while( it != maDevFontList.end() ) { ImplDevFontListData* pData = (*it).second; - if( !pData->maMapNames.getLength() ) + if( pData->maMapNames.isEmpty() ) continue; // if one alias name matches we found a matching font - rtl::OUString aTempName; + OUString aTempName; sal_Int32 nIndex = 0; do { @@ -1576,7 +1576,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByTokenNames(const rtl::OUString& for( sal_Int32 nTokenPos = 0; nTokenPos != -1; ) { OUString aSearchName = GetNextFontToken( rTokenStr, nTokenPos ); - if( !aSearchName.getLength() ) + if( aSearchName.isEmpty() ) continue; GetEnglishSearchFontName( aSearchName ); pFoundData = ImplFindBySearchName( aSearchName ); @@ -2510,10 +2510,10 @@ 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.indexOf(grutils::GrFeatureParser::FEAT_PREFIX); + sal_Int32 nFeat = aSearchName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX); String aOrigName = rFSD.maTargetName; - String aBaseFontName(aSearchName, 0, (nFeat != STRING_NOTFOUND)?nFeat:aSearchName.getLength()); - if (nFeat != STRING_NOTFOUND && STRING_NOTFOUND != + String aBaseFontName(aSearchName, 0, (nFeat != -1)?nFeat:aSearchName.getLength()); + if (nFeat != -1 && -1 != aSearchName.indexOf(grutils::GrFeatureParser::FEAT_ID_VALUE_SEPARATOR, nFeat)) { aSearchName = aBaseFontName; @@ -2543,7 +2543,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, else if( aSearchName.equalsIgnoreAsciiCase( "hgpminchob" ) ) aBoldName = OUString("hgpminchoe"); - if( aBoldName.getLength() && ImplFindBySearchName( aBoldName ) ) + if( !aBoldName.isEmpty() && ImplFindBySearchName( aBoldName ) ) { // the other font is available => use it aSearchName = aBoldName; @@ -2672,7 +2672,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, // use font fallback const FontNameAttr* pFontAttr = NULL; - if( aSearchName.getLength() ) + if( !aSearchName.isEmpty() ) { // get fallback info using FontSubstConfiguration and // the target name, it's shortened name and family name in that order @@ -2706,7 +2706,7 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD, while( nTokenPos != -1 ) { rFSD.maTargetName = GetNextFontToken( rFSD.GetFamilyName(), nTokenPos ); - if( !rFSD.maTargetName.getLength() ) + if( rFSD.maTargetName.isEmpty() ) continue; aSearchName = rFSD.maTargetName; |