summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-05-31 12:36:21 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-05-31 13:09:03 +0100
commita0bbb2a1af40e42d02f0f7567580475b3c39e50b (patch)
tree8f57661f9012d1c7eed81531c2da4601b4773bf6 /reportdesign
parent5fc3273bdbf424d7b15504e05bc8b2460a2668ff (diff)
targetted SAL_N_ELEMENTS reversion.
Change-Id: I181c5b5dd24836ff0398aa5ed03915c2c7c55183
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/core/api/FixedLine.cxx2
-rw-r--r--reportdesign/source/core/api/FixedText.cxx2
-rw-r--r--reportdesign/source/core/api/FormattedField.cxx2
-rw-r--r--reportdesign/source/core/api/ImageControl.cxx2
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx4
-rw-r--r--reportdesign/source/core/api/Section.cxx6
-rw-r--r--reportdesign/source/core/api/Shape.cxx2
-rw-r--r--reportdesign/source/core/inc/Tools.hxx1
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx2
-rw-r--r--reportdesign/source/ui/dlg/CondFormat.cxx2
-rw-r--r--reportdesign/source/ui/dlg/DateTime.cxx2
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx25
-rw-r--r--reportdesign/source/ui/inc/metadata.hxx2
-rw-r--r--reportdesign/source/ui/inspection/DataProviderHandler.cxx2
-rw-r--r--reportdesign/source/ui/inspection/DefaultInspection.cxx4
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx2
-rw-r--r--reportdesign/source/ui/inspection/metadata.cxx4
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx7
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx24
-rw-r--r--reportdesign/source/ui/report/propbrw.cxx4
20 files changed, 48 insertions, 53 deletions
diff --git a/reportdesign/source/core/api/FixedLine.cxx b/reportdesign/source/core/api/FixedLine.cxx
index 4167db82802b..dee328a2c085 100644
--- a/reportdesign/source/core/api/FixedLine.cxx
+++ b/reportdesign/source/core/api/FixedLine.cxx
@@ -133,7 +133,7 @@ uno::Sequence< ::rtl::OUString > lcl_getLineOptionals()
};
- return uno::Sequence< ::rtl::OUString >(pProps,SAL_N_ELEMENTS(pProps));
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
}
DBG_NAME(rpt_OFixedLine)
// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/core/api/FixedText.cxx b/reportdesign/source/core/api/FixedText.cxx
index 4a3ed8a22a90..aff7ff79acc4 100644
--- a/reportdesign/source/core/api/FixedText.cxx
+++ b/reportdesign/source/core/api/FixedText.cxx
@@ -48,7 +48,7 @@ namespace reportdesign
uno::Sequence< ::rtl::OUString > lcl_getFixedTextOptionals()
{
::rtl::OUString pProps[] = { PROPERTY_DATAFIELD,PROPERTY_MASTERFIELDS,PROPERTY_DETAILFIELDS };
- return uno::Sequence< ::rtl::OUString >(pProps,SAL_N_ELEMENTS(pProps));
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
}
DBG_NAME( rpt_OFixedText )
// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/core/api/FormattedField.cxx b/reportdesign/source/core/api/FormattedField.cxx
index d138f55caf93..95a2243b6a59 100644
--- a/reportdesign/source/core/api/FormattedField.cxx
+++ b/reportdesign/source/core/api/FormattedField.cxx
@@ -55,7 +55,7 @@ uno::Reference< uno::XInterface > OFormattedField::create(uno::Reference< uno::X
uno::Sequence< ::rtl::OUString > lcl_getFormattedFieldOptionals()
{
::rtl::OUString pProps[] = { PROPERTY_MASTERFIELDS,PROPERTY_DETAILFIELDS };
- return uno::Sequence< ::rtl::OUString >(pProps,SAL_N_ELEMENTS(pProps));
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
}
DBG_NAME( rpt_OFormattedField )
// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/core/api/ImageControl.cxx b/reportdesign/source/core/api/ImageControl.cxx
index 6dea31f9472a..71d2a22f874c 100644
--- a/reportdesign/source/core/api/ImageControl.cxx
+++ b/reportdesign/source/core/api/ImageControl.cxx
@@ -118,7 +118,7 @@ uno::Sequence< ::rtl::OUString > lcl_getImageOptionals()
, PROPERTY_CHARLOCALECOMPLEX
};
- return uno::Sequence< ::rtl::OUString >(pProps,SAL_N_ELEMENTS(pProps));
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
}
DBG_NAME( rpt_OImageControl )
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 45e061192c19..202567b1f40f 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -1857,7 +1857,7 @@ void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue
aArguments.get_ensureType( "ReadOnly", bReadOnly );
nFirstOpenMode = bReadOnly ? 1 : 0;
}
- const size_t nLastOpenMode = SAL_N_ELEMENTS( nOpenModes ) - 1;
+ const size_t nLastOpenMode = sizeof( nOpenModes ) / sizeof( nOpenModes[0] ) - 1;
for ( size_t i=nFirstOpenMode; i <= nLastOpenMode; ++i )
{
uno::Sequence< uno::Any > aStorageCreationArgs(2);
@@ -2399,7 +2399,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OReportDefinition::getAvailableService
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.MarkerTable"))
};
- static const sal_uInt16 nSvxComponentServiceNameListCount = SAL_N_ELEMENTS(aSvxComponentServiceNameList);
+ static const sal_uInt16 nSvxComponentServiceNameListCount = sizeof(aSvxComponentServiceNameList) / sizeof ( aSvxComponentServiceNameList[0] );
uno::Sequence< ::rtl::OUString > aSeq( nSvxComponentServiceNameListCount );
::rtl::OUString* pStrings = aSeq.getArray();
diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx
index 6c6aba20a81b..dd054afbf8e4 100644
--- a/reportdesign/source/core/api/Section.cxx
+++ b/reportdesign/source/core/api/Section.cxx
@@ -60,7 +60,7 @@ uno::Sequence< ::rtl::OUString> lcl_getGroupAbsent()
,PROPERTY_CANSHRINK
};
- return uno::Sequence< ::rtl::OUString >(pProps,SAL_N_ELEMENTS(pProps));
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
}
// -----------------------------------------------------------------------------
@@ -101,7 +101,7 @@ uno::Sequence< ::rtl::OUString> lcl_getAbsent(bool _bPageSection)
,PROPERTY_CANSHRINK
,PROPERTY_REPEATSECTION
};
- return uno::Sequence< ::rtl::OUString >(pProps,SAL_N_ELEMENTS(pProps));
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
}
::rtl::OUString pProps[] = {
@@ -110,7 +110,7 @@ uno::Sequence< ::rtl::OUString> lcl_getAbsent(bool _bPageSection)
,PROPERTY_REPEATSECTION
};
- return uno::Sequence< ::rtl::OUString >(pProps,SAL_N_ELEMENTS(pProps));
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
}
// -----------------------------------------------------------------------------
OSection::OSection(const uno::Reference< report::XReportDefinition >& _xParent
diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx
index 8752284934b3..2685b12f2c8d 100644
--- a/reportdesign/source/core/api/Shape.cxx
+++ b/reportdesign/source/core/api/Shape.cxx
@@ -57,7 +57,7 @@ uno::Sequence< ::rtl::OUString > lcl_getShapeOptionals()
,PROPERTY_CONTROLBACKGROUND
,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
};
- return uno::Sequence< ::rtl::OUString >(pProps,SAL_N_ELEMENTS(pProps));
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
}
DBG_NAME( rpt_OShape )
diff --git a/reportdesign/source/core/inc/Tools.hxx b/reportdesign/source/core/inc/Tools.hxx
index f61bd095ff2a..1be4ad8a243b 100644
--- a/reportdesign/source/core/inc/Tools.hxx
+++ b/reportdesign/source/core/inc/Tools.hxx
@@ -38,7 +38,6 @@
#include <com/sun/star/report/XFixedText.hpp>
#include <com/sun/star/report/XFormattedField.hpp>
-#include <sal/macros.h>
#include "Section.hxx"
#include "corestrings.hrc"
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index ee2ebc124f35..91f122dc0ac6 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -1587,7 +1587,7 @@ void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xG
if ( !sFunction.isEmpty() )
{
sal_Unicode pReplaceChars[] = { '(',')',';',',','+','-','[',']','/','*'};
- for(sal_uInt32 j= 0; j < SAL_N_ELEMENTS(pReplaceChars);++j)
+ for(sal_uInt32 j= 0; j < sizeof(pReplaceChars)/sizeof(pReplaceChars[0]);++j)
sFunctionName = sFunctionName.replace(pReplaceChars[j],'_');
xFunction->setName(sFunctionName);
diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx
index 6078904eab5b..0a7c337feeba 100644
--- a/reportdesign/source/ui/dlg/CondFormat.cxx
+++ b/reportdesign/source/ui/dlg/CondFormat.cxx
@@ -365,7 +365,7 @@ namespace rptui
aPos += LogicToPixel( Point( 0 , UNRELATED_CONTROLS ), MAP_APPFONT );
Window* pWindows[] = { &m_aPB_OK, &m_aPB_CANCEL, &m_aPB_Help };
- for ( size_t i= 0; i < SAL_N_ELEMENTS(pWindows); ++i )
+ for ( size_t i= 0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i )
{
pWindows[i]->SetPosSizePixel( 0, aPos.Y(), 0, 0, WINDOW_POSSIZE_Y );
}
diff --git a/reportdesign/source/ui/dlg/DateTime.cxx b/reportdesign/source/ui/dlg/DateTime.cxx
index e197c661e4ac..3212681c325f 100644
--- a/reportdesign/source/ui/dlg/DateTime.cxx
+++ b/reportdesign/source/ui/dlg/DateTime.cxx
@@ -103,7 +103,7 @@ ODateTimeDialog::ODateTimeDialog( Window* _pParent
m_aTimeControlling.enableOnCheckMark( m_aTime, m_aFTTimeFormat, m_aTimeListBox);
CheckBox* pCheckBoxes[] = { &m_aDate,&m_aTime};
- for ( size_t i = 0 ; i < SAL_N_ELEMENTS(pCheckBoxes); ++i)
+ for ( size_t i = 0 ; i < sizeof(pCheckBoxes)/sizeof(pCheckBoxes[0]); ++i)
pCheckBoxes[i]->SetClickHdl(LINK(this,ODateTimeDialog,CBClickHdl));
FreeResource();
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index e83b0b921b5f..49c21d3803b2 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -35,7 +35,6 @@
#include <com/sun/star/report/GroupOn.hpp>
#include <com/sun/star/sdbc/DataType.hpp>
-#include <sal/macros.h>
#include <tools/debug.hxx>
#include "RptResId.hrc"
#include "rptui_slotid.hrc"
@@ -375,7 +374,7 @@ void OFieldExpressionControl::lateInit()
m_pComboCell->SetHelpId(HID_RPT_FIELDEXPRESSION);
Control* pControls[] = {m_pComboCell};
- for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
{
pControls[i]->SetGetFocusHdl(LINK(m_pParent, OGroupsSortingDialog, OnControlFocusGot));
pControls[i]->SetLoseFocusHdl(LINK(m_pParent, OGroupsSortingDialog, OnControlFocusLost));
@@ -974,24 +973,24 @@ OGroupsSortingDialog::OGroupsSortingDialog( Window* _pParent
DBG_CTOR( rpt_OGroupsSortingDialog,NULL);
Control* pControlsLst[] = { &m_aHeaderLst, &m_aFooterLst, &m_aGroupOnLst, &m_aKeepTogetherLst, &m_aOrderLst, &m_aGroupIntervalEd};
- for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst); ++i)
+ for (size_t i = 0; i < sizeof (pControlsLst) / sizeof (pControlsLst[0]); ++i)
{
pControlsLst[i]->SetGetFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusGot));
pControlsLst[i]->SetLoseFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusLost));
pControlsLst[i]->Show(sal_True);
}
- for (size_t i = 0; i < (SAL_N_ELEMENTS(pControlsLst))-1; ++i)
+ for (size_t i = 0; i < (sizeof (pControlsLst) / sizeof (pControlsLst[0])) - 1; ++i)
static_cast<ListBox*>(pControlsLst[i])->SetSelectHdl(LINK(this,OGroupsSortingDialog,LBChangeHdl));
Control* pControls[] = { &m_aHeader, &m_aFooter, &m_aGroupOn, &m_aGroupInterval, &m_aKeepTogether, &m_aOrder
, &m_aMove,&m_aFL2};
sal_Int32 nMaxTextWidth = 0;
MnemonicGenerator aMnemonicGenerator;
- for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
+ for (size_t i = 0; i < sizeof (pControlsLst) / sizeof (pControlsLst[0]); ++i)
aMnemonicGenerator.RegisterMnemonic( pControls[i]->GetText() );
- for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
+ for (size_t i = 0; i < sizeof (pControlsLst) / sizeof (pControlsLst[0]); ++i)
{
pControls[i]->Show(sal_True);
String sText = pControls[i]->GetText();
@@ -1121,7 +1120,7 @@ void OGroupsSortingDialog::SaveData( sal_Int32 _nRow)
xGroup->setSortAscending( m_aOrderLst.GetSelectEntryPos() == 0 );
ListBox* pControls[] = { &m_aHeaderLst,&m_aFooterLst,&m_aGroupOnLst,&m_aKeepTogetherLst,&m_aOrderLst};
- for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
pControls[i]->SaveValue();
}
@@ -1153,7 +1152,7 @@ IMPL_LINK(OGroupsSortingDialog, OnControlFocusGot, Control*, pControl )
if ( m_pFieldExpression && m_pFieldExpression->getExpressionControl() )
{
Control* pControls[] = { m_pFieldExpression->getExpressionControl(),&m_aHeaderLst,&m_aFooterLst,&m_aGroupOnLst,&m_aGroupIntervalEd,&m_aKeepTogetherLst,&m_aOrderLst};
- for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
{
if ( pControl == pControls[i] )
{
@@ -1305,7 +1304,7 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference<report::XGroup>& _x
case sdbc::DataType::TIMESTAMP:
{
sal_uInt16 nIds[] = { STR_RPT_YEAR, STR_RPT_QUARTER,STR_RPT_MONTH,STR_RPT_WEEK,STR_RPT_DAY,STR_RPT_HOUR,STR_RPT_MINUTE };
- for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(nIds); ++i)
+ for (sal_uInt16 i = 0; i < sizeof (nIds) / sizeof (nIds[0]); ++i)
{
m_aGroupOnLst.InsertEntry(String(ModuleRes(nIds[i])));
m_aGroupOnLst.SetEntryData(i+1,reinterpret_cast<void*>(i+2));
@@ -1361,12 +1360,12 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference<report::XGroup>& _x
m_aOrderLst.SelectEntryPos(_xGroup->getSortAscending() ? 0 : 1);
ListBox* pControls[] = { &m_aHeaderLst,&m_aFooterLst,&m_aGroupOnLst,&m_aKeepTogetherLst,&m_aOrderLst};
- for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
pControls[i]->SaveValue();
ListBox* pControlsLst2[] = { &m_aHeaderLst, &m_aFooterLst, &m_aGroupOnLst, &m_aKeepTogetherLst,&m_aOrderLst};
sal_Bool bReadOnly = !m_pController->isEditable();
- for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst2); ++i)
+ for (size_t i = 0; i < sizeof(pControlsLst2)/sizeof(pControlsLst2[0]); ++i)
pControlsLst2[i]->SetReadOnly(bReadOnly);
m_aGroupIntervalEd.SetReadOnly(bReadOnly);
}
@@ -1381,12 +1380,12 @@ void OGroupsSortingDialog::Resize()
Control* pControlsLst[] = { &m_aHeaderLst, &m_aFooterLst, &m_aGroupOnLst, &m_aGroupIntervalEd,&m_aKeepTogetherLst,&m_aOrderLst};
Control* pControls[] = { &m_aHeader, &m_aFooter, &m_aGroupOn, &m_aGroupInterval, &m_aKeepTogether, &m_aOrder};
sal_Int32 nMaxTextWidth = 0;
- for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
+ for (size_t i = 0; i < sizeof (pControlsLst) / sizeof (pControlsLst[0]); ++i)
{
nMaxTextWidth = ::std::max<sal_Int32>(static_cast<sal_Int32>(GetTextWidth(pControls[i]->GetText())),nMaxTextWidth);
}
- for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
+ for (size_t i = 0; i < sizeof (pControlsLst) / sizeof (pControlsLst[0]); ++i)
{
pControls[i]->SetSizePixel(Size(nMaxTextWidth,pControls[i]->GetSizePixel().Height()));
Point aPos = pControls[i]->GetPosPixel();
diff --git a/reportdesign/source/ui/inc/metadata.hxx b/reportdesign/source/ui/inc/metadata.hxx
index 2d0b49f74640..1af52682da94 100644
--- a/reportdesign/source/ui/inc/metadata.hxx
+++ b/reportdesign/source/ui/inc/metadata.hxx
@@ -30,8 +30,6 @@
#include "ModuleHelper.hxx"
-#include <sal/macros.h>
-
/** === begin UNO includes === **/
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/inspection/XPropertyHandler.hpp>
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index 008055888652..8866591f1d78 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -390,7 +390,7 @@ uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedPrope
,PROPERTY_PREVIEW_COUNT
};
- for (size_t nPos = 0; nPos < SAL_N_ELEMENTS(s_pProperties) ;++nPos )
+ for (size_t nPos = 0; nPos < sizeof(s_pProperties)/sizeof(s_pProperties[0]) ;++nPos )
{
aValue.Name = s_pProperties[nPos];
aNewProps.push_back(aValue);
diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx
index 3d00aac04d3b..382264828215 100644
--- a/reportdesign/source/ui/inspection/DefaultInspection.cxx
+++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx
@@ -142,7 +142,7 @@ namespace rptui
};
- const size_t nFactories = SAL_N_ELEMENTS( aFactories );
+ const size_t nFactories = sizeof( aFactories ) / sizeof( aFactories[ 0 ] );
Sequence< Any > aReturn( nFactories );
Any* pReturn = aReturn.getArray();
for ( size_t i = 0; i < nFactories; ++i )
@@ -240,7 +240,7 @@ namespace rptui
{ "Data", RID_STR_PROPPAGE_DATA, HID_RPT_PROPDLG_TAB_DATA },
};
- const size_t nCategories = SAL_N_ELEMENTS( aCategories );
+ const size_t nCategories = sizeof( aCategories ) / sizeof( aCategories[0] );
Sequence< PropertyCategoryDescriptor > aReturn( nCategories );
PropertyCategoryDescriptor* pReturn = aReturn.getArray();
for ( size_t i=0; i<nCategories; ++i, ++pReturn )
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 2286da7542e2..b20c62827f81 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -1313,7 +1313,7 @@ uno::Sequence< beans::Property > SAL_CALL GeometryHandler::getSupportedPropertie
};
const uno::Reference < beans::XPropertySetInfo > xInfo = m_xReportComponent->getPropertySetInfo();
const uno::Sequence< beans::Property> aSeq = xInfo->getProperties();
- for (size_t i = 0; i < SAL_N_ELEMENTS(pIncludeProperties) ;++i )
+ for (size_t i = 0; i < sizeof(pIncludeProperties)/sizeof(pIncludeProperties[0]) ;++i )
{
const beans::Property* pIter = aSeq.getConstArray();
const beans::Property* pEnd = pIter + aSeq.getLength();
diff --git a/reportdesign/source/ui/inspection/metadata.cxx b/reportdesign/source/ui/inspection/metadata.cxx
index 057d7dcf0616..7563a46e9e96 100644
--- a/reportdesign/source/ui/inspection/metadata.cxx
+++ b/reportdesign/source/ui/inspection/metadata.cxx
@@ -317,9 +317,9 @@ namespace rptui
for (; pPropsIter != pPropsEnd; ++pPropsIter)
{
size_t nPos = 0;
- for (; nPos < SAL_N_ELEMENTS(pExcludeProperties) && pExcludeProperties[nPos] != pPropsIter->Name;++nPos )
+ for (; nPos < sizeof(pExcludeProperties)/sizeof(pExcludeProperties[0]) && pExcludeProperties[nPos] != pPropsIter->Name;++nPos )
;
- if ( nPos == SAL_N_ELEMENTS(pExcludeProperties) )
+ if ( nPos == sizeof(pExcludeProperties)/sizeof(pExcludeProperties[0]) )
_rExcludeProperties.push_back(*pPropsIter);
}
}
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index cdddcf384918..3e6aa10f8c06 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -37,7 +37,6 @@
#include <tools/diagnose_ex.h>
#include <tools/string.hxx>
-#include <sal/macros.h>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
@@ -551,7 +550,7 @@ namespace
,{ITEMID_LANGUAGE_ASIAN,PROPERTY_CHARLOCALEASIAN}
,{ITEMID_LANGUAGE_COMPLEX,PROPERTY_CHARLOCALECOMPLEX}
};
- for(size_t k = 0; k < SAL_N_ELEMENTS(pItems);++k)
+ for(size_t k = 0; k < sizeof(pItems)/sizeof(pItems[0]);++k)
{
if ( SFX_ITEM_SET == _rItemSet.GetItemState( pItems[k].nWhich,sal_True,&pItem) && pItem->ISA(SvxLanguageItem))
{
@@ -707,7 +706,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
};
- OSL_ASSERT((SAL_N_ELEMENTS(pDefaults)) == (SAL_N_ELEMENTS(aItemInfos)));
+ OSL_ASSERT((sizeof(pDefaults)/sizeof(pDefaults[0])) == (sizeof(aItemInfos)/sizeof(aItemInfos[0])));
static sal_uInt16 pRanges[] =
{
@@ -746,7 +745,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
}
SfxItemPool::Free(pPool);
- for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(pDefaults); ++i)
+ for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
delete pDefaults[i];
return bSuccess;
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 54c64887fa1b..43a69100bac7 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2129,7 +2129,7 @@ void OReportController::onLoadedMenu(const Reference< frame::XLayoutManager >& _
,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/resizebar"))
,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/sectionshrinkbar"))
};
- for (size_t i = 0; i< SAL_N_ELEMENTS(s_sMenu); ++i)
+ for (size_t i = 0; i< sizeof(s_sMenu)/sizeof(s_sMenu[0]); ++i)
{
_xLayoutManager->createElement( s_sMenu[i] );
_xLayoutManager->requestElement( s_sMenu[i] );
@@ -2523,7 +2523,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
}
SfxItemPool::Free(pPool);
- for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(pDefaults); ++i)
+ for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
delete pDefaults[i];
}
@@ -2727,7 +2727,7 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept
};
::comphelper::NamedValueCollection aCommandProperties;
- for ( size_t i=0; i < SAL_N_ELEMENTS(nCommandIDs); ++i )
+ for ( size_t i=0; i < sizeof (nCommandIDs) / sizeof (nCommandIDs[0]); ++i )
{
const FeatureState aFeatureState = GetState( nCommandIDs[i] );
@@ -3201,7 +3201,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
,PROPERTY_FORMATSSUPPLIER
,PROPERTY_BACKGROUNDCOLOR
};
- for(size_t i = 0; i < SAL_N_ELEMENTS(sProps);++i)
+ for(size_t i = 0; i < sizeof (nProps) / sizeof (nProps[0]);++i)
{
if ( xInfo->hasPropertyByName(sProps[i]) && xShapeInfo->hasPropertyByName(sProps[i]) )
xUnoProp->setPropertyValue(sProps[i],xShapeProp->getPropertyValue(sProps[i]));
@@ -3486,7 +3486,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
::rtl::OUString sDefaultName;
size_t i = 0;
OUnoObject* pObjs[2];
- for(i = 0; i < SAL_N_ELEMENTS(pControl);++i)
+ for(i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i)
{
pObjs[i] = dynamic_cast<OUnoObject*>(pControl[i]);
uno::Reference<beans::XPropertySet> xUnoProp(pObjs[i]->GetUnoControlModel(),uno::UNO_QUERY_THROW);
@@ -3501,7 +3501,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
,PROPERTY_BORDER
,PROPERTY_BACKGROUNDCOLOR
};
- for(size_t k = 0; k < SAL_N_ELEMENTS(sProps);++k)
+ for(size_t k = 0; k < sizeof(sProps)/sizeof(sProps[0]);++k)
{
if ( xInfo->hasPropertyByName(sProps[k]) && xShapeInfo->hasPropertyByName(sProps[k]) )
xUnoProp->setPropertyValue(sProps[k],xShapeProp->getPropertyValue(sProps[k]));
@@ -3563,7 +3563,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
uno::Reference< report::XFixedText> xShapeProp(pObj->getUnoShape(),uno::UNO_QUERY_THROW);
xShapeProp->setName(xShapeProp->getName() + sDefaultName );
- for(i = 0; i < SAL_N_ELEMENTS(pControl);++i) // insert controls
+ for(i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i) // insert controls
{
correctOverlapping(pControl[i],pSectionWindow[1-i]->getReportSection());
}
@@ -3612,7 +3612,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
}
else
{
- for(size_t i = 0; i < SAL_N_ELEMENTS(pControl);++i)
+ for(size_t i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i)
delete pControl[i];
}
}
@@ -3673,7 +3673,7 @@ void OReportController::listen(const bool _bAdd)
void (SAL_CALL XPropertySet::*pPropertyListenerAction)( const ::rtl::OUString&, const uno::Reference< XPropertyChangeListener >& ) =
_bAdd ? &XPropertySet::addPropertyChangeListener : &XPropertySet::removePropertyChangeListener;
- for (size_t i = 0; i < SAL_N_ELEMENTS(aProps); ++i)
+ for (size_t i = 0; i < sizeof(aProps)/sizeof(aProps[0]); ++i)
(m_xReportDefinition.get()->*pPropertyListenerAction)( aProps[i], static_cast< XPropertyChangeListener* >( this ) );
OXUndoEnvironment& rUndoEnv = m_aReportModel->GetUndoEnv();
@@ -3682,7 +3682,7 @@ void OReportController::listen(const bool _bAdd)
const beans::Property* pIter = aSeq.getConstArray();
const beans::Property* pEnd = pIter + aSeq.getLength();
const ::rtl::OUString* pPropsBegin = &aProps[0];
- const ::rtl::OUString* pPropsEnd = pPropsBegin + (SAL_N_ELEMENTS(aProps)) - 3;
+ const ::rtl::OUString* pPropsEnd = pPropsBegin + (sizeof(aProps)/sizeof(aProps[0])) - 3;
for(;pIter != pEnd;++pIter)
{
if ( ::std::find(pPropsBegin,pPropsEnd,pIter->Name) == pPropsEnd )
@@ -4076,7 +4076,7 @@ void SAL_CALL OReportController::setMode( const ::rtl::OUString& aMode ) throw (
{
static ::rtl::OUString s_sModes[] = { ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("remote")),
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("normal")) };
- return uno::Sequence< ::rtl::OUString> (&s_sModes[0],SAL_N_ELEMENTS(s_sModes));
+ return uno::Sequence< ::rtl::OUString> (&s_sModes[0],sizeof(s_sModes)/sizeof(s_sModes[0]));
}
::sal_Bool SAL_CALL OReportController::supportsMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::uno::RuntimeException)
{
@@ -4267,7 +4267,7 @@ void OReportController::openZoomDialog()
}
SfxItemPool::Free(pPool);
- for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(pDefaults); ++i)
+ for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
delete pDefaults[i];
}
}
diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx
index 8a8509cc0d88..45b4f1a46fc8 100644
--- a/reportdesign/source/ui/report/propbrw.cxx
+++ b/reportdesign/source/ui/report/propbrw.cxx
@@ -147,7 +147,7 @@ PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParen
::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) ), makeAny( m_pDesignView->getController().getConnection() ) ),
};
m_xInspectorContext.set(
- ::cppu::createComponentContext( aHandlerContextInfo, SAL_N_ELEMENTS( aHandlerContextInfo ),
+ ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ),
xOwnContext ) );
// create a property browser controller
bool bEnableHelpSection = lcl_shouldEnableHelpSection( m_xORB );
@@ -218,7 +218,7 @@ PropBrw::~PropBrw()
const ::rtl::OUString pProps[] = { ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContextDocument" ) )
, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) )
, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) )};
- for (size_t i = 0; i < SAL_N_ELEMENTS(pProps); ++i)
+ for (size_t i = 0; i < sizeof(pProps)/sizeof(pProps[0]); ++i)
xName->removeByName(pProps[i]);
}
}