summaryrefslogtreecommitdiff
path: root/vcl/generic
diff options
context:
space:
mode:
authorChristina Rossmanith <ChrRossmanith@web.de>2012-01-13 16:28:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-13 16:46:33 +0000
commite5ac3524f2d72bf3113c571de105f8aa52a558d2 (patch)
tree0413efcbc856b945fc416adfa217d0fe90ec46b4 /vcl/generic
parent8ca94d31d1d6317e182ecdf360f744f70640cbfc (diff)
Replace getLength() with isEmpty() in vcl/generic/fontmanager
Diffstat (limited to 'vcl/generic')
-rw-r--r--vcl/generic/fontmanager/fontcache.cxx4
-rw-r--r--vcl/generic/fontmanager/fontconfig.cxx16
-rw-r--r--vcl/generic/fontmanager/fontmanager.cxx12
-rw-r--r--vcl/generic/fontmanager/helper.cxx12
4 files changed, 22 insertions, 22 deletions
diff --git a/vcl/generic/fontmanager/fontcache.cxx b/vcl/generic/fontmanager/fontcache.cxx
index 616799a5939e..2e9ab9bbed1a 100644
--- a/vcl/generic/fontmanager/fontcache.cxx
+++ b/vcl/generic/fontmanager/fontcache.cxx
@@ -176,7 +176,7 @@ void FontCache::flush()
for( ::std::list< int >::const_iterator name_it = (*it)->m_aAliases.begin(); name_it != (*it)->m_aAliases.end(); ++name_it )
{
const OUString& rAdd( pAtoms->getString( ATOM_FAMILYNAME, *name_it ) );
- if( rAdd.getLength() )
+ if( !rAdd.isEmpty() )
{
aLine.append(';');
aLine.append(OUStringToOString(rAdd, RTL_TEXTENCODING_UTF8));
@@ -233,7 +233,7 @@ void FontCache::flush()
break;
default: break;
}
- if( (*it)->m_aStyleName.getLength() )
+ if( !(*it)->m_aStyleName.isEmpty() )
{
aLine.append(';');
aLine.append(OUStringToOString((*it)->m_aStyleName, RTL_TEXTENCODING_UTF8));
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index eb0e9b669b83..a5d1c15a49e4 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -773,7 +773,7 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, rtl::OUString& r
FcPatternAddString(pPattern, FC_FAMILY, pTargetNameUtf8);
const rtl::OString aLangAttrib = MsLangId::convertLanguageToIsoByteString(rPattern.meLanguage);
- if( aLangAttrib.getLength() )
+ if( !aLangAttrib.isEmpty() )
{
const FcChar8* pLangAttribUtf8;
if (aLangAttrib.equalsIgnoreAsciiCase(OString(RTL_CONSTASCII_STRINGPARAM("pa-in"))))
@@ -784,7 +784,7 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, rtl::OUString& r
}
// Add required Unicode characters, if any
- if ( rMissingCodes.getLength() )
+ if ( !rMissingCodes.isEmpty() )
{
FcCharSet *unicodes = FcCharSetCreate();
for( sal_Int32 nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); )
@@ -889,7 +889,7 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, rtl::OUString& r
}
// update rMissingCodes by removing resolved unicodes
- if( rMissingCodes.getLength() > 0 )
+ if( !rMissingCodes.isEmpty() )
{
sal_uInt32* pRemainingCodes = (sal_uInt32*)alloca( rMissingCodes.getLength() * sizeof(sal_uInt32) );
int nRemainingLen = 0;
@@ -954,7 +954,7 @@ ImplFontOptions* PrintFontManager::getFontOptions(
boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash >::const_iterator aI = rWrapper.m_aLocalizedToCanonical.find(sFamily);
if (aI != rWrapper.m_aLocalizedToCanonical.end())
sFamily = aI->second;
- if( sFamily.getLength() )
+ if( !sFamily.isEmpty() )
FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)sFamily.getStr());
addtopattern(pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch);
@@ -1021,22 +1021,22 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star
OString aLangAttrib;
// populate pattern with font characteristics
- if( rLocale.Language.getLength() )
+ if( !rLocale.Language.isEmpty() )
{
OUStringBuffer aLang(6);
aLang.append( rLocale.Language );
- if( rLocale.Country.getLength() )
+ if( !rLocale.Country.isEmpty() )
{
aLang.append( sal_Unicode('-') );
aLang.append( rLocale.Country );
}
aLangAttrib = OUStringToOString( aLang.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
}
- if( aLangAttrib.getLength() )
+ if( !aLangAttrib.isEmpty() )
FcPatternAddString(pPattern, FC_LANG, (FcChar8*)aLangAttrib.getStr());
OString aFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 );
- if( aFamily.getLength() )
+ if( !aFamily.isEmpty() )
FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)aFamily.getStr());
addtopattern(pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch);
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 5e20b9100ccb..578cc23357c5 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -613,7 +613,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
if( ! m_nFamilyName )
{
aFamily = OStringToOUString( pInfo->gfi->familyName, RTL_TEXTENCODING_ISO_8859_1 );
- if( ! aFamily.getLength() )
+ if( aFamily.isEmpty() )
{
aFamily = OStringToOUString( pInfo->gfi->fontName, RTL_TEXTENCODING_ISO_8859_1 );
sal_Int32 nIndex = 0;
@@ -627,7 +627,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
// style name: if fullname begins with family name
// interpret the rest of fullname as style
- if( ! m_aStyleName.getLength() && pInfo->gfi->fullName && *pInfo->gfi->fullName )
+ if( m_aStyleName.isEmpty() && pInfo->gfi->fullName && *pInfo->gfi->fullName )
{
OUString aFullName( OStringToOUString( pInfo->gfi->fullName, RTL_TEXTENCODING_ISO_8859_1 ) );
if( aFullName.indexOf( aFamily ) == 0 )
@@ -1494,7 +1494,7 @@ void PrintFontManager::analyzeTrueTypeFamilyName( void* pTTFont, ::std::list< OU
}
DisposeNameRecords( pNameRecords, nNameRecords );
}
- if( aFamily.getLength() )
+ if( !aFamily.isEmpty() )
{
rNames.push_front( aFamily );
for( ::std::set< OUString >::const_iterator it = aSet.begin(); it != aSet.end(); ++it )
@@ -1545,7 +1545,7 @@ bool PrintFontManager::analyzeTrueTypeFile( PrintFont* pFont ) const
}
for( ::std::list< OUString >::iterator it = aNames.begin(); it != aNames.end(); ++it )
{
- if( it->getLength() )
+ if( !it->isEmpty() )
{
int nAlias = m_pAtoms->getAtom( ATOM_FAMILYNAME, *it, sal_True );
if( nAlias != pFont->m_nFamilyName )
@@ -1720,7 +1720,7 @@ void PrintFontManager::initialize()
// search for the fonts in SAL_PRIVATE_FONTPATH first; those are
// the fonts installed with the office
- if( rSalPrivatePath.getLength() )
+ if( !rSalPrivatePath.isEmpty() )
{
OString aPath = rtl::OUStringToOString( rSalPrivatePath, aEncoding );
const bool bAreFCSubstitutionsEnabled = AreFCSubstitutionsEnabled();
@@ -1729,7 +1729,7 @@ void PrintFontManager::initialize()
{
OString aToken = aPath.getToken( 0, ';', nIndex );
normPath( aToken );
- if (!aToken.getLength())
+ if ( aToken.isEmpty() )
{
continue;
}
diff --git a/vcl/generic/fontmanager/helper.cxx b/vcl/generic/fontmanager/helper.cxx
index b35ab2418fd1..85a3490bece3 100644
--- a/vcl/generic/fontmanager/helper.cxx
+++ b/vcl/generic/fontmanager/helper.cxx
@@ -157,7 +157,7 @@ void psp::getPrinterPathList( std::list< OUString >& rPathList, const char* pSub
do
{
OString aDir( aPath.getToken( 0, ':', nIndex ) );
- if( ! aDir.getLength() )
+ if( aDir.isEmpty() )
continue;
if( pSubDir )
@@ -201,14 +201,14 @@ OUString psp::getFontPath()
{
static OUString aPath;
- if( ! aPath.getLength() )
+ if (aPath.isEmpty())
{
OUStringBuffer aPathBuffer( 512 );
OUString aConfigPath( getOfficePath( psp::ConfigPath ) );
OUString aInstallationRootPath( getOfficePath( psp::InstallationRootPath ) );
OUString aUserPath( getOfficePath( psp::UserPath ) );
- if( aConfigPath.getLength() )
+ if( !aConfigPath.isEmpty() )
{
// #i53530# Path from CustomDataUrl will completely
// replace net and user paths if the path exists
@@ -225,16 +225,16 @@ OUString psp::getFontPath()
aPathBuffer.appendAscii("/share/fonts");
}
}
- if( aConfigPath.getLength() == 0 )
+ if( aConfigPath.isEmpty() )
{
- if( aInstallationRootPath.getLength() )
+ if( !aInstallationRootPath.isEmpty() )
{
aPathBuffer.append( aInstallationRootPath );
aPathBuffer.appendAscii( "/share/fonts/truetype;");
aPathBuffer.append( aInstallationRootPath );
aPathBuffer.appendAscii( "/share/fonts/type1;" );
}
- if( aUserPath.getLength() )
+ if( !aUserPath.isEmpty() )
{
aPathBuffer.append( aUserPath );
aPathBuffer.appendAscii( "/user/fonts" );