summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorKenneth Venken <kenneth.venken@gmail.com>2010-10-17 00:19:29 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2010-10-17 00:19:29 -0500
commitbc01ec73e9fd55afbfa34f20f80182582be9c1b8 (patch)
tree2d9dd42b7fd850c0b0507f560167c8407206daa0 /sw
parentaf0a13ea3d54de6cd12a5d464692555a5fda093e (diff)
use SAL_N_ELEMENTS macro
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/lingu/olmenu.cxx3
-rw-r--r--sw/source/ui/misc/pgfnote.cxx3
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx7
-rw-r--r--sw/source/ui/vba/vbaborders.cxx3
-rw-r--r--sw/source/ui/vba/vbafont.cxx3
-rw-r--r--sw/source/ui/vba/vbaglobals.cxx4
-rw-r--r--sw/source/ui/vba/vbapalette.cxx2
7 files changed, 15 insertions, 10 deletions
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 1a0c5419c6a7..719ac2fb65b4 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -91,6 +91,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
+#include <sal/macros.h>
#include <map>
@@ -179,7 +180,7 @@ LanguageType lcl_CheckLanguage(
lang::Locale a3( SvxCreateLocale( aLangList[3] ) );
#endif
- INT32 nCount = sizeof(aLangList) / sizeof(aLangList[0]);
+ INT32 nCount = SAL_N_ELEMENTS(aLangList);
for (INT32 i = 0; i < nCount; i++)
{
INT16 nTmpLang = aLangList[i];
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 9820b6ed4997..83029d360fc6 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -39,6 +39,7 @@
#include <hintids.hxx>
#include <tools/ref.hxx>
#include <svx/dialogs.hrc>
+#include <sal/macros.h>
#include <vcl/field.hxx>
#include <vcl/svapp.hxx>
#include <unotools/localedatawrapper.hxx>
@@ -70,7 +71,7 @@ static const USHORT __FAR_DATA nLines[] = {
500
};
-static const USHORT nLineCount = sizeof(nLines) / sizeof(nLines[0]);
+static const USHORT nLineCount = SAL_N_ELEMENTS(nLines);
static USHORT __FAR_DATA aPageRg[] = {
FN_PARAM_FTN_INFO, FN_PARAM_FTN_INFO,
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index c0101a47cd49..ebe469527a9f 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -43,6 +43,7 @@
#include <svl/itempool.hxx>
#include <svl/eitem.hxx>
#include <svl/srchitem.hxx>
+#include <sal/macros.h>
#include <sfx2/request.hxx>
#include <svx/srchdlg.hxx>
#include <vcl/msgbox.hxx>
@@ -380,16 +381,16 @@ void SwView::ExecSearch(SfxRequest& rReq, BOOL bNoMessage)
SvUShorts aArr( 0, 16 );
aArr.Insert( aNormalAttr,
- sizeof( aNormalAttr ) / sizeof( aNormalAttr[0] ),
+ SAL_N_ELEMENTS( aNormalAttr ),
0 );
if( SW_MOD()->GetCTLOptions().IsCTLFontEnabled() )
aArr.Insert( aCTLAttr,
- sizeof( aCTLAttr ) / sizeof( aCTLAttr[0] ),
+ SAL_N_ELEMENTS( aCTLAttr ),
14 );
SvtCJKOptions aCJKOpt;
if( aCJKOpt.IsAnyEnabled() )
aArr.Insert( aCJKAttr,
- sizeof( aCJKAttr ) / sizeof( aCJKAttr[0] ),
+ SAL_N_ELEMENTS( aCJKAttr ),
14 );
SfxItemSet aSet( pWrtShell->GetAttrPool(), aArr.GetData() );
diff --git a/sw/source/ui/vba/vbaborders.cxx b/sw/source/ui/vba/vbaborders.cxx
index 43a28b2fa3a1..0170eb88c20e 100644
--- a/sw/source/ui/vba/vbaborders.cxx
+++ b/sw/source/ui/vba/vbaborders.cxx
@@ -29,6 +29,7 @@
#include <ooo/vba/word/XBorder.hpp>
#include <ooo/vba/word/WdBorderType.hpp>
#include <ooo/vba/word/WdLineStyle.hpp>
+#include <sal/macros.h>
#include <cppuhelper/implbase3.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/table/TableBorder.hpp>
@@ -269,7 +270,7 @@ public:
// XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
{
- return sizeof( supportedIndexTable ) / sizeof( supportedIndexTable[0] );
+ return SAL_N_ELEMENTS( supportedIndexTable );
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
{
diff --git a/sw/source/ui/vba/vbafont.cxx b/sw/source/ui/vba/vbafont.cxx
index 8060e7b7510c..76803fa216e2 100644
--- a/sw/source/ui/vba/vbafont.cxx
+++ b/sw/source/ui/vba/vbafont.cxx
@@ -3,6 +3,7 @@
#include <com/sun/star/awt/FontUnderline.hpp>
#include <ooo/vba/word/WdUnderline.hpp>
#include <hash_map>
+#include <sal/macros.h>
#include <ooo/vba/word/WdColorIndex.hpp>
using namespace ::ooo::vba;
@@ -46,7 +47,7 @@ class UnderLineMapper
private:
UnderLineMapper()
{
- sal_Int32 nLen = sizeof( UnderLineTable )/ sizeof( UnderLineTable[0] );
+ sal_Int32 nLen = SAL_N_ELEMENTS( UnderLineTable );
for ( sal_Int32 index=0; index<nLen; ++index )
{
diff --git a/sw/source/ui/vba/vbaglobals.cxx b/sw/source/ui/vba/vbaglobals.cxx
index 98fd499da059..9664dd0a33dd 100644
--- a/sw/source/ui/vba/vbaglobals.cxx
+++ b/sw/source/ui/vba/vbaglobals.cxx
@@ -27,7 +27,7 @@
************************************************************************/
#include <vbahelper/helperdecl.hxx>
#include "vbaglobals.hxx"
-
+#include <sal/macros.h>
#include <comphelper/unwrapargs.hxx>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
@@ -178,7 +178,7 @@ SwVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException)
// #FIXME #TODO make Application a proper service
// ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.word.Application" ) ),
};
- sal_Int32 nWordServices = ( sizeof( names )/ sizeof( names[0] ) );
+ sal_Int32 nWordServices = SAL_N_ELEMENTS( names );
sal_Int32 startIndex = serviceNames.getLength();
serviceNames.realloc( serviceNames.getLength() + nWordServices );
for ( sal_Int32 index = 0; index < nWordServices; ++index )
diff --git a/sw/source/ui/vba/vbapalette.cxx b/sw/source/ui/vba/vbapalette.cxx
index 61e69d4ea9f1..da2b33908a0a 100644
--- a/sw/source/ui/vba/vbapalette.cxx
+++ b/sw/source/ui/vba/vbapalette.cxx
@@ -40,7 +40,7 @@ public:
// Methods XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException)
{
- return sizeof(ColorTable) / sizeof(ColorTable[0]);
+ return SAL_N_ELEMENTS(ColorTable);
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)