summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorKayo Hamid <revol.code@yahoo.com>2010-10-09 22:17:25 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2010-10-09 22:17:25 -0500
commitd7f4b5a0fc1033b314b59e8b20efc6a06b1f8049 (patch)
tree7e50a26a7c8197db131c99af0723445de61f0c2d /dbaccess/source/ui
parentfa482813b4fadcde61410e8981fa011985c8b4c1 (diff)
Use SAL_N_ELEMENTS macro
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx2
-rw-r--r--dbaccess/source/ui/app/AppIconControl.cxx2
-rw-r--r--dbaccess/source/ui/app/AppTitleWindow.cxx4
-rw-r--r--dbaccess/source/ui/browser/dbloader.cxx3
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx5
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx2
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx18
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPageSetup.cxx2
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx2
-rw-r--r--dbaccess/source/ui/dlg/TextConnectionHelper.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.cxx2
-rw-r--r--dbaccess/source/ui/dlg/detailpages.cxx10
-rw-r--r--dbaccess/source/ui/dlg/dsselect.cxx3
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx2
-rw-r--r--dbaccess/source/ui/inc/dbadmin.hxx1
-rw-r--r--dbaccess/source/ui/inc/moduledbu.hxx1
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx2
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx2
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx12
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx4
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx2
22 files changed, 46 insertions, 41 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index ac064a7611fe..b7a70151c269 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -1247,7 +1247,7 @@ IMPL_LINK(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, /*pToolBox*/)
, SID_DB_APP_VIEW_DOCINFO_PREVIEW
};
- for(size_t i=0; i < sizeof(pActions)/sizeof(pActions[0]);++i)
+ for(size_t i=0; i < SAL_N_ELEMENTS(pActions);++i)
{
aMenu->CheckItem(pActions[i],m_aMenu->IsItemChecked(pActions[i]));
}
diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx
index 15bbf54f1dc1..5902f1f8da65 100644
--- a/dbaccess/source/ui/app/AppIconControl.cxx
+++ b/dbaccess/source/ui/app/AppIconControl.cxx
@@ -62,7 +62,7 @@ OApplicationIconControl::OApplicationIconControl(Window* _pParent)
{ RID_STR_FORMS_CONTAINER, E_FORM, IMG_FORMFOLDER_TREE_L, IMG_FORMFOLDER_TREE_LHC },
{ RID_STR_REPORTS_CONTAINER, E_REPORT, IMG_REPORTFOLDER_TREE_L,IMG_REPORTFOLDER_TREE_LHC }
};
- for ( size_t i=0; i < sizeof(aCategories)/sizeof(aCategories[0]); ++i)
+ for ( size_t i=0; i < SAL_N_ELEMENTS(aCategories); ++i)
{
SvxIconChoiceCtrlEntry* pEntry = InsertEntry(
String( ModuleRes( aCategories[i].nLabelResId ) ),
diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx
index 2b4feb558016..2e2f07f7a1ed 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.cxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.cxx
@@ -52,7 +52,7 @@ OTitleWindow::OTitleWindow(Window* _pParent,USHORT _nTitleId,WinBits _nBits,BOOL
ImplInitSettings( sal_True, sal_True, sal_True );
Window* pWindows [] = { &m_aSpace1, &m_aSpace2, &m_aTitle };
- for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
+ for (size_t i=0; i < SAL_N_ELEMENTS(pWindows); ++i)
pWindows[i]->Show();
}
// -----------------------------------------------------------------------------
@@ -166,7 +166,7 @@ void OTitleWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_B
Window* pWindows [] = { &m_aSpace1, &m_aSpace2, &m_aTitle};
- for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
+ for (size_t i=0; i < SAL_N_ELEMENTS(pWindows); ++i)
{
Font aFont = pWindows[i]->GetFont();
aFont.SetWeight(WEIGHT_BOLD);
diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx
index 69130da08609..81d9f82b5f04 100644
--- a/dbaccess/source/ui/browser/dbloader.cxx
+++ b/dbaccess/source/ui/browser/dbloader.cxx
@@ -59,6 +59,7 @@
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <vcl/svapp.hxx>
+#include <sal/macros.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -216,7 +217,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const ::
Reference< XController2 > xController;
const ::rtl::OUString sComponentURL( aParser.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
- for ( size_t i=0; i < sizeof( aImplementations ) / sizeof( aImplementations[0] ); ++i )
+ for ( size_t i=0; i < SAL_N_ELEMENTS( aImplementations ); ++i )
{
if ( sComponentURL.equalsAscii( aImplementations[i].pAsciiServiceName ) )
{
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index 70efc10c2b36..0cd38e5609d7 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -51,6 +51,7 @@
#include "UITools.hxx"
#include "commontypes.hxx"
+#include <sal/macros.h>
#include <vcl/waitobj.hxx>
#include <tools/urlobj.hxx>
#include <svl/urihelper.hxx>
@@ -1248,11 +1249,11 @@ namespace
"com.sun.star.formula.FormularProperties", "smath",
"com.sun.star.chart.ChartDocument", "schart"
};
- OSL_ENSURE( ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) % 2 == 0,
+ OSL_ENSURE( ( SAL_N_ELEMENTS( pTransTable ) ) % 2 == 0,
"lcl_getModuleHelpModuleName: odd size of translation table!" );
// loop through the table
- sal_Int32 nTableEntries = ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) / 2;
+ sal_Int32 nTableEntries = ( SAL_N_ELEMENTS( pTransTable ) ) / 2;
const sal_Char** pDocumentService = pTransTable;
const sal_Char** pHelpModuleName = pTransTable + 1;
for ( sal_Int32 j=0; j<nTableEntries; ++j )
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index c65055c582fc..9c746e2edf6b 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1194,7 +1194,7 @@ void SbaTableQueryBrowser::connectExternalDispatches()
ID_BROWSER_INSERTCONTENT
};
- for ( size_t i=0; i < sizeof( pURLs ) / sizeof( pURLs[0] ); ++i )
+ for ( size_t i=0; i < SAL_N_ELEMENTS( pURLs ); ++i )
{
URL aURL;
aURL.Complete = ::rtl::OUString::createFromAscii( pURLs[i] );
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index ded53304db14..51145c36a097 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -366,7 +366,7 @@ void OFieldDescControl::CheckScrollBars()
// horizontal :
long lMaxXPosition = 0;
Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
- for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
+ for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(ppAggregates); ++i)
getMaxXPosition(ppAggregates[i],lMaxXPosition);
if (m_pHorzScroll)
@@ -484,9 +484,9 @@ void OFieldDescControl::ScrollAllAggregates()
, pTextLenText, pLengthText
, pScaleText, m_pColumnNameText
, m_pTypeText, m_pAutoIncrementValueText};
- OSL_ENSURE(sizeof(ppAggregates)/sizeof(ppAggregates[0]) == sizeof(ppAggregatesText)/sizeof(ppAggregatesText[0]),"Lists are not identical!");
+ OSL_ENSURE(SAL_N_ELEMENTS(ppAggregates) == SAL_N_ELEMENTS(ppAggregatesText),"Lists are not identical!");
- for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
+ for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(ppAggregates); ++i)
ScrollAggregate(ppAggregatesText[i],ppAggregates[i],NULL,nDeltaX, nDeltaY);
ScrollAggregate(pFormatText,pFormatSample,pFormat,nDeltaX, nDeltaY);
@@ -498,7 +498,7 @@ sal_uInt16 OFieldDescControl::CountActiveAggregates() const
{
Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
sal_uInt16 nVisibleAggregates = 0;
- for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
+ for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(ppAggregates); ++i)
if (ppAggregates[i])
++nVisibleAggregates;
return nVisibleAggregates;
@@ -508,7 +508,7 @@ sal_Int32 OFieldDescControl::GetMaxControlHeight() const
{
Size aHeight;
Control* ppAggregates[] = { pRequired, pNumType, pAutoIncrement, pDefault, pTextLen, pLength, pScale, pFormat, m_pColumnName, m_pType,m_pAutoIncrementValue};
- for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
+ for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(ppAggregates); ++i)
{
if ( ppAggregates[i] )
{
@@ -539,9 +539,9 @@ void OFieldDescControl::SetReadOnly( sal_Bool bReadOnly )
, m_pTypeText, m_pAutoIncrementValueText
, pFormatText};
- OSL_ENSURE(sizeof(ppAggregates)/sizeof(ppAggregates[0]) == sizeof(ppAggregatesText)/sizeof(ppAggregatesText[0]),"Lists are not identical!");
+ OSL_ENSURE(SAL_N_ELEMENTS(ppAggregates) == SAL_N_ELEMENTS(ppAggregatesText),"Lists are not identical!");
- for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
+ for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(ppAggregates); ++i)
{
if ( ppAggregatesText[i] )
ppAggregatesText[i]->Enable( !bReadOnly );
@@ -833,7 +833,7 @@ void OFieldDescControl::ArrangeAggregates()
};
long nMaxWidth = 0;
- for (size_t i=0; i<sizeof(adAggregates)/sizeof(adAggregates[0]); i++)
+ for (size_t i=0; i < SAL_N_ELEMENTS(adAggregates); i++)
{
if (adAggregates[i].pctrlTextControl)
{
@@ -846,7 +846,7 @@ void OFieldDescControl::ArrangeAggregates()
// und los ...
int nCurrentControlPos = 0;
Control* pZOrderPredecessor = NULL;
- for (size_t i=0; i<sizeof(adAggregates)/sizeof(adAggregates[0]); i++)
+ for (size_t i=0; i < SAL_N_ELEMENTS(adAggregates); i++)
{
if (adAggregates[i].pctrlInputControl)
{
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
index c5074d7f0c6c..6169b95d5523 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
@@ -202,7 +202,7 @@ namespace dbaui
//{
// String sDisplayName = m_pCollection->getTypeDisplayName(m_eType);
// FixedText* ppTextControls[] ={&m_aFT_Connection};
- // for (size_t i = 0; i < sizeof(ppTextControls)/sizeof(ppTextControls[0]); ++i)
+ // for (size_t i = 0; i < SAL_N_ELEMENTS(ppTextControls); ++i)
// {
// ppTextControls[i]->SetText(sDisplayName);
// }
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index f993c8ce0e32..52a20a787551 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -899,7 +899,7 @@ DBG_NAME(OFinalDBPageSetup)
Point aPos(m_aFTFinalHeader.GetPosPixel());
Size aStart(m_aFTFinalHeader.GetSizePixel());
aPos.Y() += aStart.Height() + nUnrelatedHeight;
- sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
+ sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
for (sal_Int32 i=0; i < nCount; ++i)
{
aPos.X() = pWindows[i].first->GetPosPixel().X();
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index 1c9ecf5bc948..0f8cf63aba08 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -152,7 +152,7 @@ DBG_NAME(OTextConnectionHelper)
{ 0, NULL }
};
- for ( size_t section=0; section < sizeof( aSections ) / sizeof( aSections[0] ) - 1; ++section )
+ for ( size_t section=0; section < SAL_N_ELEMENTS( aSections ) - 1; ++section )
{
if ( ( m_nAvailableSections & aSections[section].nFlag ) != 0 )
{
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index 1d5bb1cb167c..ec98bbf09176 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -475,7 +475,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp
{0,0}
};
- OSL_ENSURE(sizeof(aItemInfos)/sizeof(aItemInfos[0]) == DSID_LAST_ITEM_ID,"Invalid Ids!");
+ OSL_ENSURE(SAL_N_ELEMENTS(aItemInfos) == DSID_LAST_ITEM_ID,"Invalid Ids!");
_rpPool = new SfxItemPool(String::CreateFromAscii("DSAItemPool"), DSID_FIRST_ITEM_ID, DSID_LAST_ITEM_ID,
aItemInfos, _rppDefaults);
_rpPool->FreezeIdRanges();
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index a9c3471ac782..735a8f13c167 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -113,7 +113,7 @@ namespace dbaui
m_pAutoIncrementLabel, m_pAutoIncrement,
m_pAutoRetrievingLabel, m_pAutoRetrieving };
- sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
+ sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
for (sal_Int32 i=1; i < nCount; ++i)
{
if ( pWindows[i] )
@@ -366,7 +366,7 @@ namespace dbaui
,m_pOptionsLabel,m_pOptions,&m_aUseCatalog
};
- sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
+ sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
for (sal_Int32 i=1; i < nCount; ++i)
pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND);
}
@@ -547,7 +547,7 @@ namespace dbaui
&m_aFTDriverClass, &m_aEDDriverClass,&m_aTestJavaDriver,
m_pCharsetLabel, m_pCharset};
- sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
+ sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
for (sal_Int32 i=1; i < nCount; ++i)
pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND);
@@ -679,7 +679,7 @@ namespace dbaui
Window* pWindows[] = { &m_aMySQLSettings, &m_aSeparator2, &m_aUserNameLabel, &m_aUserName,
&m_aPasswordRequired, m_pCharsetLabel, m_pCharset};
- sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
+ sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
for (sal_Int32 i=1; i < nCount; ++i)
pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND);
@@ -819,7 +819,7 @@ namespace dbaui
,&m_CB_SHUTDB
,m_pCharsetLabel, m_pCharset,&m_PB_STAT};
- sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
+ sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
for (sal_Int32 i=1; i < nCount; ++i)
pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND);
}
diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx
index 71763f91556e..4acbf1fe7cfd 100644
--- a/dbaccess/source/ui/dlg/dsselect.cxx
+++ b/dbaccess/source/ui/dlg/dsselect.cxx
@@ -34,6 +34,7 @@
#include <vcl/msgbox.hxx>
#include "localresaccess.hxx"
#include <tools/rcid.h>
+#include <sal/macros.h>
#include <com/sun/star/sdbcx/XCreateCatalog.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -99,7 +100,7 @@ ODatasourceSelectDialog::ODatasourceSelectDialog(Window* _pParent, const StringB
// move the buttons
PushButton* pButtons[] = { &m_aOk, &m_aCancel, &m_aHelp ,&m_aCreateAdabasDB};
- for (size_t i=0; i<sizeof(pButtons)/sizeof(pButtons[0]); ++i)
+ for (size_t i=0; i < SAL_N_ELEMENTS(pButtons); ++i)
{
Point aOldPos = pButtons[i]->GetPosPixel();
pButtons[i]->SetPosPixel(Point(aOldPos.X() - nLostPixels, aOldPos.Y()));
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 50658fb7811d..b65619916742 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -126,7 +126,7 @@ namespace dbaui
&m_aTypePostLabel
};
const long nOffset = m_aRB_OpenDocument.GetPosPixel().Y() - m_aRB_CreateDatabase.GetPosPixel().Y();
- for ( size_t i=0; i < sizeof( pWindowsToMove ) / sizeof( pWindowsToMove[0] ); ++i )
+ for ( size_t i=0; i < SAL_N_ELEMENTS( pWindowsToMove ); ++i )
{
Point aPos( pWindowsToMove[i]->GetPosPixel() );
aPos.Y() -= nOffset;
diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx
index fe8c886529d7..69b789556e00 100644
--- a/dbaccess/source/ui/inc/dbadmin.hxx
+++ b/dbaccess/source/ui/inc/dbadmin.hxx
@@ -28,6 +28,7 @@
#ifndef _DBAUI_DBADMIN_HXX_
#define _DBAUI_DBADMIN_HXX_
+#include <sal/macros.h>
#include <sfx2/tabdlg.hxx>
#include "dsntypes.hxx"
#include "IItemSetHelper.hxx"
diff --git a/dbaccess/source/ui/inc/moduledbu.hxx b/dbaccess/source/ui/inc/moduledbu.hxx
index 143acf31631d..4ce94fec8f79 100644
--- a/dbaccess/source/ui/inc/moduledbu.hxx
+++ b/dbaccess/source/ui/inc/moduledbu.hxx
@@ -30,6 +30,7 @@
#include <osl/mutex.hxx>
#include <tools/resid.hxx>
+#include <sal/macros.h>
class ResMgr;
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index f4ff8064181d..e8789f25468b 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -364,7 +364,7 @@ void ODatabaseExport::insertValueIntoColumn()
,NumberFormat::NUMBER
,NumberFormat::LOGICAL
};
- for (size_t i = 0; i < sizeof(nFormats)/sizeof(nFormats[0]); ++i)
+ for (size_t i = 0; i < SAL_N_ELEMENTS(nFormats); ++i)
{
try
{
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index b092fa750478..637a2d2c70cf 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -1051,7 +1051,7 @@ sal_Bool callColumnFormatDialog(Window* _pParent,
delete pFormatDescriptor;
SfxItemPool::Free(pPool);
- for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
+ for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(pDefaults); ++i)
delete pDefaults[i];
return bRet;
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 4926a5f6aba6..267e8ba88bf1 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -167,7 +167,7 @@ void ObjectCopySource::copyUISettingsTo( const Reference< XPropertySet >& _rxObj
const ::rtl::OUString aCopyProperties[] = {
PROPERTY_FONT, PROPERTY_ROW_HEIGHT, PROPERTY_TEXTCOLOR,PROPERTY_TEXTLINECOLOR,PROPERTY_TEXTEMPHASIS,PROPERTY_TEXTRELIEF
};
- for ( size_t i=0; i < sizeof( aCopyProperties ) / sizeof( aCopyProperties[0] ); ++i )
+ for ( size_t i=0; i < SAL_N_ELEMENTS( aCopyProperties ); ++i )
{
if ( m_xObjectPSI->hasPropertyByName( aCopyProperties[i] ) )
_rxObject->setPropertyValue( aCopyProperties[i], m_xObject->getPropertyValue( aCopyProperties[i] ) );
@@ -194,7 +194,7 @@ void ObjectCopySource::copyFilterAndSortingTo( const Reference< XConnection >& _
sStatement += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" WHERE 0=1"));
- for ( i=0; i < sizeof( aProperties ) / sizeof( aProperties[0] ); ++i )
+ for ( i=0; i < SAL_N_ELEMENTS( aProperties ); ++i )
{
if ( m_xObjectPSI->hasPropertyByName( aProperties[i].first ) )
{
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 3860a84091d2..442fd556b320 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -211,12 +211,12 @@ void OSelectionBrowseBox::initialize()
String sGroup = m_aFunctionStrings.GetToken(m_aFunctionStrings.GetTokenCount() - 1);
m_aFunctionStrings = m_aFunctionStrings.GetToken(0);
- for (size_t i = 0; i < sizeof(eFunctions)/sizeof(eFunctions[0]) ; ++i)
+ for (size_t i = 0; i < SAL_N_ELEMENTS(eFunctions); ++i)
{
m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";"));
m_aFunctionStrings += String(ByteString(rContext.getIntlKeywordAscii(eFunctions[i])),RTL_TEXTENCODING_UTF8);
- } // for (sal_Int32 i = 0; i < sizeof(eFunctions)/sizeof(eFunctions[0]) ; ++i)
+ } // for (sal_Int32 i = 0; i < SAL_N_ELEMENTS(eFunctions) ; ++i)
m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";"));
m_aFunctionStrings += sGroup;
@@ -361,12 +361,12 @@ void OSelectionBrowseBox::Init()
Size aHeight;
const Control* pControls[] = { m_pTextCell,m_pVisibleCell,m_pTableCell,m_pFieldCell };
- for(sal_Size i= 0; i < sizeof(pControls)/sizeof(pControls[0]);++i)
+ for(sal_Size i= 0; i < SAL_N_ELEMENTS(pControls);++i)
{
const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) );
if ( aTemp.Height() > aHeight.Height() )
aHeight.Height() = aTemp.Height();
- } // for(int i= 0; i < sizeof(pControls)/sizeof(pControls[0]);++i
+ } // for(int i= 0; i < SAL_N_ELEMENTS(pControls);++i
SetDataRowHeight(aHeight.Height());
SetTitleLines(1);
// Anzahl der sichtbaren Zeilen ermitteln
@@ -2195,7 +2195,7 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const
{
sal_Int32 nErg(0);
// only the first 11 row are interesting
- sal_Int32 nSize = sizeof(nVisibleRowMask) / sizeof(nVisibleRowMask[0]);
+ sal_Int32 nSize = SAL_N_ELEMENTS(nVisibleRowMask);
for(sal_Int32 i=0;i<nSize;i++)
{
if(!m_bVisibleRow[i])
@@ -2207,7 +2207,7 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const
void OSelectionBrowseBox::SetNoneVisbleRow(long nRows)
{
// only the first 11 row are interesting
- sal_Int32 nSize = sizeof(nVisibleRowMask) / sizeof(nVisibleRowMask[0]);
+ sal_Int32 nSize = SAL_N_ELEMENTS(nVisibleRowMask);
for(sal_Int32 i=0;i< nSize;i++)
m_bVisibleRow[i] = !(nRows & nVisibleRowMask[i]);
}
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 340399e144ae..5569f8a05c62 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -307,12 +307,12 @@ void OTableEditorCtrl::InitCellController()
Size aHeight;
const Control* pControls[] = { pTypeCell,pDescrCell,pNameCell,pHelpTextCell};
- for(sal_Size i= 0; i < sizeof(pControls)/sizeof(pControls[0]);++i)
+ for(sal_Size i= 0; i < SAL_N_ELEMENTS(pControls);++i)
{
const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) );
if ( aTemp.Height() > aHeight.Height() )
aHeight.Height() = aTemp.Height();
- } // for(int i= 0; i < sizeof(pControls)/sizeof(pControls[0]);++i
+ } // for(int i= 0; i < SAL_N_ELEMENTS(pControls);++i
SetDataRowHeight(aHeight.Height());
ClearModified();
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index be1cf5288b21..b7d5577ff6b6 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -746,7 +746,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X
const ::rtl::OUString aSettings[] = {
PROPERTY_FILTER, PROPERTY_ORDER, PROPERTY_HAVING_CLAUSE, PROPERTY_GROUP_BY
};
- for ( size_t i=0; i < sizeof( aSettings ) / sizeof( aSettings[0] ); ++i )
+ for ( size_t i=0; i < SAL_N_ELEMENTS( aSettings ); ++i )
{
if ( lcl_hasNonEmptyStringValue_throw( _rxSourceDescriptor, xPSI, aSettings[i] ) )
{