summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/config/apearcfg.cxx3
-rw-r--r--svtools/source/config/htmlcfg.cxx3
-rw-r--r--svtools/source/config/printoptions.cxx4
-rw-r--r--svtools/source/control/ctrlbox.cxx5
-rw-r--r--svtools/source/control/ctrltool.cxx5
-rw-r--r--svtools/source/dialogs/insdlg.cxx3
-rw-r--r--svtools/source/dialogs/printdlg.cxx3
-rw-r--r--svtools/workben/toolpanel/toolpaneltest.cxx9
8 files changed, 21 insertions, 14 deletions
diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx
index c8ba52d0f41e..eb550d461ecb 100644
--- a/svtools/source/config/apearcfg.cxx
+++ b/svtools/source/config/apearcfg.cxx
@@ -36,6 +36,7 @@
#include "vcl/settings.hxx"
#include "vcl/svapp.hxx"
#include <rtl/logfile.hxx>
+#include <sal/macros.h>
#define DEFAULT_LOOKNFEEL 0
#define DEFAULT_DRAGMODE 2
@@ -129,7 +130,7 @@ const Sequence<OUString>& SvtTabAppearanceCfg::GetPropertyNames()
,"FontAntiAliasing/MinPixelHeight" // 9
#endif
};
- const int nCount = sizeof( aPropNames ) / sizeof( aPropNames[0] );
+ const int nCount = SAL_N_ELEMENTS( aPropNames );
aNames.realloc(nCount);
const sal_Char** pAsciiNames = aPropNames;
diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx
index 065746d55a0a..77b9083c2481 100644
--- a/svtools/source/config/htmlcfg.cxx
+++ b/svtools/source/config/htmlcfg.cxx
@@ -35,6 +35,7 @@
#include <tools/debug.hxx>
#include <tools/list.hxx>
#include <tools/link.hxx>
+#include <sal/macros.h>
// -----------------------------------------------------------------------
#define HTMLCFG_UNKNOWN_TAGS 0x01
@@ -111,7 +112,7 @@ const Sequence<OUString>& SvxHtmlOptions::GetPropertyNames()
"Export/Encoding", // 14
"Import/NumbersEnglishUS" // 15
};
- const int nCount = sizeof(aPropNames) / sizeof(aPropNames[0]);
+ const int nCount = SAL_N_ELEMENTS(aPropNames);
aNames.realloc(nCount);
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx
index a134549528df..f76104c132c8 100644
--- a/svtools/source/config/printoptions.cxx
+++ b/svtools/source/config/printoptions.cxx
@@ -57,14 +57,14 @@
#include <itemholder2.hxx>
-
+#include <sal/macros.h>
// -----------
// - statics -
// -----------
static USHORT aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
-#define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ]))
+#define DPI_COUNT (SAL_N_ELEMENTS(aDPIArray))
// -----------
// - Defines -
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 7672a593cc3f..0dce36d4a5d8 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -33,6 +33,7 @@
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
#include <vcl/field.hxx>
+#include <sal/macros.h>
#include <comphelper/processfactory.hxx>
#include <unotools/charclass.hxx>
@@ -873,8 +874,8 @@ void FontNameBox::ImplCalcUserItemSize()
aSz.Width() /= 10;
if ( bSymbolFont )
{
- int nLength = sizeof(aImplSymbolFontText)/sizeof(aImplSymbolFontText[0]) - 1;
- int nLength2 = sizeof(aImplStarSymbolText)/sizeof(aImplStarSymbolText[0]) - 1;
+ int nLength = SAL_N_ELEMENTS(aImplSymbolFontText) - 1;
+ int nLength2 = SAL_N_ELEMENTS(aImplStarSymbolText) - 1;
if( bStarSymbol && (nLength < nLength2) )
nLength = nLength2;
aSz.Width() += aOneCharSz.Width() * nLength;
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index f0a37a141003..3775ef27e594 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -38,6 +38,7 @@
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
+#include <sal/macros.h>
#include <svtools/svtools.hrc>
#include <svtools/svtdata.hxx>
@@ -930,7 +931,7 @@ FontSizeNames::FontSizeNames( LanguageType eLanguage )
case LANGUAGE_CHINESE:
case LANGUAGE_CHINESE_SIMPLIFIED:
mpArray = aImplSimplifiedChinese;
- mnElem = sizeof(aImplSimplifiedChinese) / sizeof(aImplSimplifiedChinese[0]);
+ mnElem = SAL_N_ELEMENTS(aImplSimplifiedChinese);
break;
#if 0 // #i89077# disabled by popular request
@@ -939,7 +940,7 @@ FontSizeNames::FontSizeNames( LanguageType eLanguage )
case LANGUAGE_CHINESE_MACAU:
case LANGUAGE_CHINESE_TRADITIONAL:
mpArray = aImplTraditionalChinese;
- mnElem = sizeof(aImplTraditionalChinese) / sizeof(aImplTraditionalChinese[0]);
+ mnElem = SAL_N_ELEMENTS(aImplTraditionalChinese);
break;
#endif
diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index d1fdba871e7a..fba9d66cdf73 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -41,6 +41,7 @@
#include <unotools/configmgr.hxx>
#include <sot/clsids.hxx>
#include <sot/stg.hxx>
+#include <sal/macros.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -315,7 +316,7 @@ String SvPasteObjectHelper::GetSotFormatUIName( SotFormatStringId nId )
String aUIName;
USHORT nResId = 0;
- for( sal_uInt32 i = 0, nCount = sizeof( aSotResourcePairs ) / sizeof( aSotResourcePairs[ 0 ] ); ( i < nCount ) && !nResId; i++ )
+ for( sal_uInt32 i = 0, nCount = SAL_N_ELEMENTS( aSotResourcePairs ); ( i < nCount ) && !nResId; i++ )
{
if( aSotResourcePairs[ i ].mnSotId == nId )
nResId = aSotResourcePairs[ i ].mnResId;
diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx
index aa454dfaa2c8..66105d262559 100644
--- a/svtools/source/dialogs/printdlg.cxx
+++ b/svtools/source/dialogs/printdlg.cxx
@@ -33,6 +33,7 @@
#include <vcl/print.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/jobset.hxx>
+#include <sal/macros.h>
#include <tools/urlobj.hxx>
#include "printdlg.hrc"
@@ -338,7 +339,7 @@ void PrintDialog::ImplInitControls()
&maFlSepButtonLine, &maBtnOptions, &maBtnOK,
&maBtnCancel, &maBtnHelp };
Window** pCtrl = pControls;
- const sal_Int32 nCount = sizeof( pControls ) / sizeof( pControls[0] );
+ const sal_Int32 nCount = SAL_N_ELEMENTS( pControls );
for ( sal_Int32 i = 0; i < nCount; ++i, ++pCtrl )
{
if ( NULL == *pCtrl )
diff --git a/svtools/workben/toolpanel/toolpaneltest.cxx b/svtools/workben/toolpanel/toolpaneltest.cxx
index 319686070d52..fe3c1d11d045 100644
--- a/svtools/workben/toolpanel/toolpaneltest.cxx
+++ b/svtools/workben/toolpanel/toolpaneltest.cxx
@@ -48,6 +48,7 @@
#include <vcl/tabctrl.hxx>
#include <vcl/taskpanelist.hxx>
#include <vcl/wrkwin.hxx>
+#include <sal/macros.h>
namespace svt { namespace toolpanel
{
@@ -93,7 +94,7 @@ public:
{
"This", "is a", "Tab", "Control", "intended", "for", "comparison"
};
- for ( size_t i=0; i < sizeof( pTabTitles ) / sizeof( pTabTitles[0] ); ++i )
+ for ( size_t i=0; i < SAL_N_ELEMENTS( pTabTitles ); ++i )
{
String sText( String::CreateFromAscii( pTabTitles[i] ) );
m_aTabControl.InsertPage( i + 1, sText );
@@ -415,7 +416,7 @@ OptionsWindow::OptionsWindow( PanelDemoMainWindow& i_rParent )
"Tab Bar Alignment", "Left", "Right", "Top", "Bottom", "Tab Items", "Images and Text", "Images only",
"Text only", "Automatic", "Panels", "", "Remove Panel", "", "", "Insert Panel"
};
- for ( size_t i=0; i < sizeof( pControls ) / sizeof( pControls[0] ); ++i )
+ for ( size_t i=0; i < SAL_N_ELEMENTS( pControls ); ++i )
{
const WindowType eWindowType = pControls[i]->GetType();
@@ -505,7 +506,7 @@ void OptionsWindow::GetFocus()
{
&m_aAlignLeft, &m_aAlignRight, &m_aAlignTop, &m_aAlignBottom
};
- for ( size_t i=0; i < sizeof( pRadios ) / sizeof( pRadios[0] ); ++i )
+ for ( size_t i=0; i < SAL_N_ELEMENTS( pRadios ); ++i )
{
if ( pRadios[i]->IsChecked() )
{
@@ -569,7 +570,7 @@ void OptionsWindow::Resize()
ControlRow( m_aInsertPanel, true )
};
bool bPreviousWasSubordinate = false;
- for ( size_t i=0; i < sizeof( aControlRows ) / sizeof( aControlRows[0] ); ++i )
+ for ( size_t i=0; i < SAL_N_ELEMENTS( aControlRows ); ++i )
{
aItemPos.X() = ( aControlRows[i].bSubordinate ) ? nSubordinateX : nSuperordinateX;