summaryrefslogtreecommitdiff
path: root/vcl/unx/source/fontmanager/fontmanager.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/source/fontmanager/fontmanager.cxx')
-rw-r--r--vcl/unx/source/fontmanager/fontmanager.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx
index 7e12ad2ad8f9..e64740e367ed 100644
--- a/vcl/unx/source/fontmanager/fontmanager.cxx
+++ b/vcl/unx/source/fontmanager/fontmanager.cxx
@@ -59,6 +59,8 @@
#include "rtl/ustrbuf.hxx"
#include "rtl/strbuf.hxx"
+#include <sal/macros.h>
+
#include "i18npool/mslangid.hxx"
@@ -854,7 +856,7 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult
RTL_TEXTENCODING_JIS_X_0208
};
- for( unsigned int enc = 0; enc < sizeof( aEncs )/sizeof(aEncs[0]) && m_aEncoding == RTL_TEXTENCODING_DONTKNOW; enc++ )
+ for( unsigned int enc = 0; enc < SAL_N_ELEMENTS( aEncs ) && m_aEncoding == RTL_TEXTENCODING_DONTKNOW; enc++ )
{
sal_Int32 nIndex = 0, nOffset = 1;
do
@@ -1187,7 +1189,7 @@ PrintFontManager::PrintFontManager() :
m_pFontCache( NULL ),
m_bFontconfigSuccess( false )
{
- for( unsigned int i = 0; i < sizeof( aAdobeCodes )/sizeof( aAdobeCodes[0] ); i++ )
+ for( unsigned int i = 0; i < SAL_N_ELEMENTS( aAdobeCodes ); i++ )
{
m_aUnicodeToAdobename.insert( ::std::hash_multimap< sal_Unicode, ::rtl::OString >::value_type( aAdobeCodes[i].aUnicode, aAdobeCodes[i].pAdobename ) );
m_aAdobenameToUnicode.insert( ::std::hash_multimap< ::rtl::OString, sal_Unicode, ::rtl::OStringHash >::value_type( aAdobeCodes[i].pAdobename, aAdobeCodes[i].aUnicode ) );
@@ -1297,7 +1299,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co
// first look for an adjacent file
static const char* pSuffix[] = { ".afm", ".AFM" };
- for( unsigned int i = 0; i < sizeof(pSuffix)/sizeof(pSuffix[0]); i++ )
+ for( unsigned int i = 0; i < SAL_N_ELEMENTS(pSuffix); i++ )
{
ByteString aName( rFontFile );
aName.Erase( aName.Len()-4 );
@@ -2805,7 +2807,7 @@ family::type PrintFontManager::matchFamilyName( const ::rtl::OUString& rFamily )
rtl::OString aFamily = rtl::OUStringToOString( rFamily, RTL_TEXTENCODING_ASCII_US );
sal_uInt32 nLower = 0;
- sal_uInt32 nUpper = sizeof(pFamilyMatch) / sizeof(pFamilyMatch[0]);
+ sal_uInt32 nUpper = SAL_N_ELEMENTS(pFamilyMatch);
while( nLower < nUpper )
{