summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorKenneth Venken <kenneth.venken@gmail.com>2010-10-15 18:15:35 +0100
committerMichael Meeks <michael.meeks@novell.com>2010-10-15 18:15:35 +0100
commit394235bba1f7c474c9655f929f4fe27a550aba45 (patch)
tree266bd52b9f0b82dc5b21c4c7a9d829fb1ff87003 /extensions
parent7d4ffef8b74cd9ac2959006bac8d5c582b313e61 (diff)
SAL_N_ELEMENTS changes for components
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/abpilot/fieldmappingimpl.cxx5
-rw-r--r--extensions/source/activex/main/SOActionsApproval.cpp2
-rw-r--r--extensions/source/activex/main/SOComWindowPeer.cpp2
-rw-r--r--extensions/source/activex/main/SODispatchInterceptor.cpp2
-rw-r--r--extensions/source/logging/loggerconfig.cxx3
-rw-r--r--extensions/source/plugin/unx/npwrap.cxx2
-rw-r--r--extensions/source/propctrlr/defaultforminspection.cxx5
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx9
-rw-r--r--extensions/source/propctrlr/propcontroller.cxx3
-rw-r--r--extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx3
-rw-r--r--extensions/source/scanner/sanedlg.cxx7
-rw-r--r--extensions/workben/testpgp.cxx3
12 files changed, 25 insertions, 21 deletions
diff --git a/extensions/source/abpilot/fieldmappingimpl.cxx b/extensions/source/abpilot/fieldmappingimpl.cxx
index 101d210e2ad7..c7af76636362 100644
--- a/extensions/source/abpilot/fieldmappingimpl.cxx
+++ b/extensions/source/abpilot/fieldmappingimpl.cxx
@@ -42,6 +42,7 @@
#include "abpresid.hrc"
#include "componentmodule.hxx"
#include <unotools/confignode.hxx>
+#include "sal/macros.h"
//.........................................................................
namespace abp
@@ -207,10 +208,10 @@ namespace abp
_rxORB, sDriverAliasesNodeName, -1, OConfigurationTreeRoot::CM_READONLY);
// loop through all programmatic pairs
- DBG_ASSERT( 0 == ( sizeof( pMappingProgrammatics ) / sizeof( pMappingProgrammatics[ 0 ] ) ) % 2,
+ DBG_ASSERT( 0 == SAL_N_ELEMENTS( pMappingProgrammatics ) % 2,
"fieldmapping::defaultMapping: invalid programmatic map!" );
// number of pairs
- sal_Int32 nIntersectedProgrammatics = sizeof( pMappingProgrammatics ) / sizeof( pMappingProgrammatics[ 0 ] ) / 2;
+ sal_Int32 nIntersectedProgrammatics = SAL_N_ELEMENTS( pMappingProgrammatics ) / 2;
const sal_Char** pProgrammatic = pMappingProgrammatics;
::rtl::OUString sAddressProgrammatic;
diff --git a/extensions/source/activex/main/SOActionsApproval.cpp b/extensions/source/activex/main/SOActionsApproval.cpp
index b795b92fcf76..5eb2fb7cf93e 100644
--- a/extensions/source/activex/main/SOActionsApproval.cpp
+++ b/extensions/source/activex/main/SOActionsApproval.cpp
@@ -16,7 +16,7 @@ STDMETHODIMP SOActionsApproval::InterfaceSupportsErrorInfo(REFIID riid)
&IID_ISOActionsApproval,
};
- for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
+ for (int i=0;i<SAL_N_ELEMENTS(arr);i++)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
if (InlineIsEqualGUID(*arr[i],riid))
diff --git a/extensions/source/activex/main/SOComWindowPeer.cpp b/extensions/source/activex/main/SOComWindowPeer.cpp
index 6ae1c805fa39..9d6a18629c21 100644
--- a/extensions/source/activex/main/SOComWindowPeer.cpp
+++ b/extensions/source/activex/main/SOComWindowPeer.cpp
@@ -15,7 +15,7 @@ STDMETHODIMP SOComWindowPeer::InterfaceSupportsErrorInfo(REFIID riid)
&IID_ISOComWindowPeer,
};
- for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
+ for (int i=0;i<SAL_N_ELEMENTS(arr);i++)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
if (InlineIsEqualGUID(*arr[i],riid))
diff --git a/extensions/source/activex/main/SODispatchInterceptor.cpp b/extensions/source/activex/main/SODispatchInterceptor.cpp
index 5a4455265b97..447afe321c0b 100644
--- a/extensions/source/activex/main/SODispatchInterceptor.cpp
+++ b/extensions/source/activex/main/SODispatchInterceptor.cpp
@@ -18,7 +18,7 @@ STDMETHODIMP SODispatchInterceptor::InterfaceSupportsErrorInfo(REFIID riid)
&IID_ISODispatchInterceptor,
};
- for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
+ for (int i=0;i<SAL_N_ELEMENTS(arr);i++)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
if (InlineIsEqualGUID(*arr[i],riid))
diff --git a/extensions/source/logging/loggerconfig.cxx b/extensions/source/logging/loggerconfig.cxx
index 904f18789d80..048ede71a41e 100644
--- a/extensions/source/logging/loggerconfig.cxx
+++ b/extensions/source/logging/loggerconfig.cxx
@@ -51,6 +51,7 @@
#include <cppuhelper/component_context.hxx>
#include <vector>
+#include <sal/macros.h>
//........................................................................
namespace logging
@@ -114,7 +115,7 @@ namespace logging
Variable( RTL_CONSTASCII_USTRINGPARAM( "$(loggername)" ), sLoggerName )
};
- for ( size_t i = 0; i < sizeof( aVariables ) / sizeof( aVariables[0] ); ++i )
+ for ( size_t i = 0; i < SAL_N_ELEMENTS( aVariables ); ++i )
{
::rtl::OUString sPattern( aVariables[i].pVariablePattern, aVariables[i].nPatternLength, aVariables[i].eEncoding );
sal_Int32 nVariableIndex = _inout_rFileURL.indexOf( sPattern );
diff --git a/extensions/source/plugin/unx/npwrap.cxx b/extensions/source/plugin/unx/npwrap.cxx
index 38fb5654d153..7124972d8578 100644
--- a/extensions/source/plugin/unx/npwrap.cxx
+++ b/extensions/source/plugin/unx/npwrap.cxx
@@ -215,7 +215,7 @@ static void signal_handler( int nSig )
fprintf( stderr, "caught signal %d, exiting\n", nSig );
#ifdef LINUX
void* pStack[64];
- int nStackLevels = backtrace( pStack, sizeof(pStack)/sizeof(pStack[0]) );
+ int nStackLevels = backtrace( pStack, SAL_N_ELEMENTS(pStack) );
backtrace_symbols_fd( pStack, nStackLevels, STDERR_FILENO );
#endif
#endif
diff --git a/extensions/source/propctrlr/defaultforminspection.cxx b/extensions/source/propctrlr/defaultforminspection.cxx
index 72b1cdb89330..3fd14196537a 100644
--- a/extensions/source/propctrlr/defaultforminspection.cxx
+++ b/extensions/source/propctrlr/defaultforminspection.cxx
@@ -42,6 +42,7 @@
/** === end UNO includes === **/
#include <cppuhelper/implbase1.hxx>
#include <osl/diagnose.h>
+#include <sal/macros.h>
//------------------------------------------------------------------------
extern "C" void SAL_CALL createRegistryInfo_DefaultFormComponentInspectorModel()
@@ -159,7 +160,7 @@ namespace pcr
{ "com.sun.star.form.inspection.FormGeometryHandler", true }
};
- sal_Int32 nFactories = sizeof( aFactories ) / sizeof( aFactories[ 0 ] );
+ sal_Int32 nFactories = SAL_N_ELEMENTS( aFactories );
Sequence< Any > aReturn( nFactories );
Any* pReturn = aReturn.getArray();
for ( sal_Int32 i = 0; i < nFactories; ++i )
@@ -189,7 +190,7 @@ namespace pcr
{ "Events", RID_STR_EVENTS, HID_FM_PROPDLG_TAB_EVT }
};
- sal_Int32 nCategories = sizeof( aCategories ) / sizeof( aCategories[0] );
+ sal_Int32 nCategories = SAL_N_ELEMENTS( aCategories );
Sequence< PropertyCategoryDescriptor > aReturn( nCategories );
PropertyCategoryDescriptor* pReturn = aReturn.getArray();
for ( sal_Int32 i=0; i<nCategories; ++i, ++pReturn )
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 83c7027887b2..c5eb86be632c 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -106,6 +106,7 @@
#include <vcl/stdtext.hxx>
#include <vcl/wrkwin.hxx>
#include <tools/StringListResource.hxx>
+#include <sal/macros.h>
#include <limits>
@@ -1724,7 +1725,7 @@ namespace pcr
// propagate the changes to the min/max/default fields
Any aCurrentProp;
::rtl::OUString aAffectedProps[] = { PROPERTY_VALUE, PROPERTY_DEFAULT_VALUE, PROPERTY_VALUEMIN, PROPERTY_VALUEMAX };
- for (sal_uInt16 i=0; i<sizeof(aAffectedProps)/sizeof(aAffectedProps[0]); ++i)
+ for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(aAffectedProps); ++i)
{
Reference< XPropertyControl > xControl;
try
@@ -1771,7 +1772,7 @@ namespace pcr
::rtl::OUString aFormattedPropertyControls[] = {
PROPERTY_EFFECTIVE_MIN, PROPERTY_EFFECTIVE_MAX, PROPERTY_EFFECTIVE_DEFAULT, PROPERTY_EFFECTIVE_VALUE
};
- for ( sal_uInt16 i=0; i<sizeof(aFormattedPropertyControls)/sizeof(aFormattedPropertyControls[0]); ++i )
+ for ( sal_uInt16 i=0; i<SAL_N_ELEMENTS(aFormattedPropertyControls); ++i )
{
Reference< XPropertyControl > xControl;
try
@@ -2164,8 +2165,8 @@ namespace pcr
ControlType::PROGRESSBAR
};
- sal_Int32 nKnownControlTypes = sizeof( aControlModelServiceNames ) / sizeof( aControlModelServiceNames[ 0 ] );
- OSL_ENSURE( nKnownControlTypes == sizeof( nClassIDs ) / sizeof( nClassIDs[ 0 ] ),
+ sal_Int32 nKnownControlTypes = SAL_N_ELEMENTS( aControlModelServiceNames );
+ OSL_ENSURE( nKnownControlTypes == SAL_N_ELEMENTS( nClassIDs ),
"FormComponentPropertyHandler::impl_classifyControlModel_throw: inconsistence" );
for ( sal_Int32 i = 0; i < nKnownControlTypes; ++i )
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx
index 72d89e5e0f06..f4791a316137 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -62,6 +62,7 @@
#include <algorithm>
#include <functional>
+#include <sal/macros.h>
//------------------------------------------------------------------------
// !!! outside the namespace !!!
@@ -1505,7 +1506,7 @@ namespace pcr
::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) ), makeAny( VCLUnoHelper::GetInterface( m_pView ) ) )
};
xHandlerContext = ::cppu::createComponentContext(
- aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ),
+ aHandlerContextInfo, SAL_N_ELEMENTS( aHandlerContextInfo ),
m_aContext.getUNOContext() );
}
diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
index c90033d00b12..c254800af14c 100644
--- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
+++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
@@ -53,6 +53,7 @@
#include <vcl/msgbox.hxx>
#include <tools/debug.hxx>
#include <svtools/localresaccess.hxx>
+#include <sal/macros.h>
#include <algorithm>
#include <functional>
@@ -629,7 +630,7 @@ namespace pcr
size_t i=0;
const ::rtl::OUString* pLoop = NULL;
for ( i = 0, pLoop = aFacets;
- i < sizeof( aFacets ) / sizeof( aFacets[0] );
+ i < SAL_N_ELEMENTS( aFacets );
++i, ++pLoop
)
{
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index db40ead2739a..a58ce6173a59 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -38,6 +38,7 @@
#include <sanedlg.hrc>
#include <grid.hxx>
#include <math.h>
+#include <sal/macros.h>
#define USE_SAVE_STATE
#undef SAVE_ALL_STATES
@@ -395,7 +396,7 @@ void SaneDlg::InitFields()
{
BOOL bIsSpecial = FALSE;
for( size_t n = 0; !bIsSpecial &&
- n < sizeof(ppSpecialOptions)/sizeof(ppSpecialOptions[0]); n++ )
+ n < SAL_N_ELEMENTS(ppSpecialOptions); n++ )
{
if( aOption.EqualsAscii( ppSpecialOptions[n] ) )
bIsSpecial=TRUE;
@@ -1314,9 +1315,7 @@ void SaneDlg::SaveState()
"br-x",
"br-y"
};
- for( size_t i = 0;
- i < (sizeof(pSaveOptions)/sizeof(pSaveOptions[0]));
- i++ )
+ for( size_t i = 0; i < SAL_N_ELEMENTS(pSaveOptions); i++ )
{
ByteString aOption = pSaveOptions[i];
int nOption = mrSane.GetOptionByName( pSaveOptions[i] );
diff --git a/extensions/workben/testpgp.cxx b/extensions/workben/testpgp.cxx
index 288ca8825507..84318ad6301c 100644
--- a/extensions/workben/testpgp.cxx
+++ b/extensions/workben/testpgp.cxx
@@ -756,8 +756,7 @@ int SAL_CALL main (int argc, char **argv)
S2U("mhu@rabbit")
};
- sal_Int32 nRecipients =
- sizeof(aRecipients) / sizeof(aRecipients[0]);
+ sal_Int32 nRecipients = SAL_N_ELEMENTS(aRecipients);
if (nOptions & OPTION_SIGN)
{