summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/edit.cxx7
-rw-r--r--vcl/source/gdi/font.cxx3
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx3
-rw-r--r--vcl/source/window/window.cxx5
5 files changed, 12 insertions, 10 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 92d97fb762e1..7ef7e49f0be0 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -73,6 +73,7 @@
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
#include <rtl/memory.h>
+#include <sal/macros.h>
#include <vcl/unohelp.hxx>
#include <vcl/unohelp2.hxx>
@@ -508,7 +509,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
if( aText.Len() )
{
- if( 2*aText.Len() > xub_StrLen(sizeof(nDXBuffer)/sizeof(nDXBuffer[0])) )
+ if( 2*aText.Len() > xub_StrLen(SAL_N_ELEMENTS(nDXBuffer)) )
{
pDXBuffer = new sal_Int32[2*(aText.Len()+1)];
pDX = pDXBuffer;
@@ -1172,7 +1173,7 @@ void Edit::ImplShowCursor( BOOL bOnlyIfVisible )
if( aText.Len() )
{
- if( 2*aText.Len() > xub_StrLen(sizeof(nDXBuffer)/sizeof(nDXBuffer[0])) )
+ if( 2*aText.Len() > xub_StrLen(SAL_N_ELEMENTS(nDXBuffer)) )
{
pDXBuffer = new sal_Int32[2*(aText.Len()+1)];
pDX = pDXBuffer;
@@ -1296,7 +1297,7 @@ xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const
sal_Int32 nDXBuffer[256];
sal_Int32* pDXBuffer = NULL;
sal_Int32* pDX = nDXBuffer;
- if( 2*aText.Len() > xub_StrLen(sizeof(nDXBuffer)/sizeof(nDXBuffer[0])) )
+ if( 2*aText.Len() > xub_StrLen(SAL_N_ELEMENTS(nDXBuffer)) )
{
pDXBuffer = new sal_Int32[2*(aText.Len()+1)];
pDX = pDXBuffer;
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index db471b74a1be..61db9f110a9e 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -38,6 +38,7 @@
#include "vcl/impfont.hxx"
#include "vcl/outfont.hxx"
#include "unotools/fontcfg.hxx"
+#include <sal/macros.h>
#include <algorithm>
@@ -1034,7 +1035,7 @@ namespace
aEnt.string = pOpen+1;
aEnt.string_len = (pClose-pOpen)-1;
aEnt.weight = WEIGHT_NORMAL;
- const int nEnt = sizeof( weight_table ) / sizeof( weight_table[0] );
+ const int nEnt = SAL_N_ELEMENTS( weight_table );
WeightSearchEntry* pFound = std::lower_bound( weight_table, weight_table+nEnt, aEnt );
if( pFound != (weight_table+nEnt) )
o_rResult.SetWeight( pFound->weight );
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 1bd453b6136d..78c84d579698 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2210,7 +2210,7 @@ ImplDevFontList* PDFWriterImpl::filterDevFontList( ImplDevFontList* pFontList )
// append the PDF builtin fonts
if( !m_bIsPDF_A1 && !m_bEmbedStandardFonts)
- for( unsigned int i = 0; i < sizeof(m_aBuiltinFonts)/sizeof(m_aBuiltinFonts[0]); i++ )
+ for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aBuiltinFonts); i++ )
{
ImplFontData* pNewData = new ImplPdfBuiltinFontData( m_aBuiltinFonts[i] );
pFiltered->Add( pNewData );
@@ -3610,7 +3610,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
if( nFontDescriptor )
{
if( pEncoding )
- nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, sizeof(nEncoding)/sizeof(nEncoding[0]) );
+ nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, SAL_N_ELEMENTS(nEncoding) );
// write font object
sal_Int32 nObject = createObject();
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 702fa1d7db4f..95b8419a8131 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -44,6 +44,7 @@
#include "rtl/digest.h"
#include "com/sun/star/util/XURLTransformer.hpp"
#include "com/sun/star/lang/Locale.hpp"
+#include <sal/macros.h>
#include <vcl/sallayout.hxx>
#include "pdffontcache.hxx"
@@ -292,7 +293,7 @@ public:
GlyphEmit() : m_nUnicodes(0), m_nSubsetGlyphID(0)
{
rtl_zeroMemory( m_aBufferedUnicodes, sizeof( m_aBufferedUnicodes ) );
- m_nMaxUnicodes = sizeof(m_aBufferedUnicodes)/sizeof(m_aBufferedUnicodes[0]);
+ m_nMaxUnicodes = SAL_N_ELEMENTS(m_aBufferedUnicodes);
}
~GlyphEmit()
{
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 52a876d82563..ffc447b09172 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -90,7 +90,7 @@
#include "vcl/impbmpconv.hxx"
#include "unotools/confignode.hxx"
#include "vcl/gdimtf.hxx"
-
+#include <sal/macros.h>
#include "vcl/pdfextoutdevdata.hxx"
#include "vcl/lazydelete.hxx"
@@ -393,8 +393,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
};
static std::set< LanguageType > aBrokenSystemFontSizeLanguagesSet(
eBrokenSystemFontSizeLanguages,
- eBrokenSystemFontSizeLanguages +
- (sizeof(eBrokenSystemFontSizeLanguages)/sizeof(eBrokenSystemFontSizeLanguages[0]))
+ eBrokenSystemFontSizeLanguages + SAL_N_ELEMENTS(eBrokenSystemFontSizeLanguages)
);
LanguageType aLang = Application::GetSettings().GetUILanguage();
if( aBrokenSystemFontSizeLanguagesSet.find( aLang ) != aBrokenSystemFontSizeLanguagesSet.end() )