summaryrefslogtreecommitdiff
path: root/dbaccess
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 /dbaccess
parent5fc3273bdbf424d7b15504e05bc8b2460a2668ff (diff)
targetted SAL_N_ELEMENTS reversion.
Change-Id: I181c5b5dd24836ff0398aa5ed03915c2c7c55183
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/RowSet.cxx2
-rw-r--r--dbaccess/source/core/api/columnsettings.cxx3
-rw-r--r--dbaccess/source/core/api/definitioncolumn.cxx3
-rw-r--r--dbaccess/source/core/api/tablecontainer.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx2
-rw-r--r--dbaccess/source/core/inc/core_resource.hxx1
-rw-r--r--dbaccess/source/core/misc/DatabaseDataProvider.cxx2
-rw-r--r--dbaccess/source/core/misc/dsntypes.cxx4
-rw-r--r--dbaccess/source/core/recovery/dbdocrecovery.cxx3
-rw-r--r--dbaccess/source/ext/macromigration/dbmm_types.hxx1
-rw-r--r--dbaccess/source/ext/macromigration/migrationengine.cxx4
-rw-r--r--dbaccess/source/filter/xml/xmlExport.cxx13
-rw-r--r--dbaccess/source/sdbtools/connection/tablename.cxx3
-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.cxx8
-rw-r--r--dbaccess/source/ui/dlg/dsselect.cxx1
-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.cxx9
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx2
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx2
35 files changed, 54 insertions, 67 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 091d6e436946..8ed1d7f6ca87 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -1704,7 +1704,7 @@ void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertyS
PROPERTY_ALIGN, PROPERTY_RELATIVEPOSITION, PROPERTY_WIDTH, PROPERTY_HIDDEN, PROPERTY_CONTROLMODEL,
PROPERTY_HELPTEXT, PROPERTY_CONTROLDEFAULT
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aPropertyNames ); ++i )
+ for ( size_t i=0; i<sizeof( aPropertyNames ) / sizeof( aPropertyNames[0] ); ++i )
{
if ( xInfo->hasPropertyByName( aPropertyNames[i] ) )
{
diff --git a/dbaccess/source/core/api/columnsettings.cxx b/dbaccess/source/core/api/columnsettings.cxx
index 0b764d2f6917..f89b7eebb22d 100644
--- a/dbaccess/source/core/api/columnsettings.cxx
+++ b/dbaccess/source/core/api/columnsettings.cxx
@@ -37,7 +37,6 @@
#include <comphelper/property.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <sal/macros.h>
//........................................................................
namespace dbaccess
@@ -158,7 +157,7 @@ namespace dbaccess
{ PROPERTY_HIDDEN, PROPERTY_ID_HIDDEN }
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aProps ); ++i )
+ for ( size_t i=0; i < sizeof( aProps ) / sizeof( aProps[0] ); ++i )
{
if ( xPSI->hasPropertyByName( aProps[i].sName ) )
if ( !isDefaulted( aProps[i].nHandle, _rxColumn->getPropertyValue( aProps[i].sName ) ) )
diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx
index 3ab320c56181..5acc09ebe7cc 100644
--- a/dbaccess/source/core/api/definitioncolumn.cxx
+++ b/dbaccess/source/core/api/definitioncolumn.cxx
@@ -43,7 +43,6 @@
#include <cppuhelper/typeprovider.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <sal/macros.h>
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
@@ -215,7 +214,7 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co
{ PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME },
{ PROPERTY_REALNAME, PROPERTY_ID_REALNAME }
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aProps ); ++i )
+ for ( size_t i=0; i < sizeof( aProps ) / sizeof( aProps[0] ); ++i )
{
if ( xPSI->hasPropertyByName( aProps[i].sName ) )
setFastPropertyValue_NoBroadcast( aProps[i].nHandle, _rxParserColumn->getPropertyValue( aProps[i].sName ) );
diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx
index 54ca2f77721c..fa011eed6994 100644
--- a/dbaccess/source/core/api/tablecontainer.cxx
+++ b/dbaccess/source/core/api/tablecontainer.cxx
@@ -363,7 +363,7 @@ ObjectType OTableContainer::appendObject( const ::rtl::OUString& _rForName, cons
, ::rtl::OUString(PROPERTY_ROW_HEIGHT), ::rtl::OUString(PROPERTY_TEXTCOLOR)
, ::rtl::OUString(PROPERTY_TEXTLINECOLOR), ::rtl::OUString(PROPERTY_TEXTEMPHASIS)
, ::rtl::OUString(PROPERTY_TEXTRELIEF) };
- Sequence< ::rtl::OUString> aNames(s_pTableProps,SAL_N_ELEMENTS(s_pTableProps));
+ Sequence< ::rtl::OUString> aNames(s_pTableProps,sizeof(s_pTableProps)/sizeof(s_pTableProps[0]));
if ( bModified || !lcl_isPropertySetDefaulted(aNames,xTableDefinition) )
::dbaccess::notifyDataSourceModified(m_xTableDefinitions,sal_True);
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index a6f3e73be15e..ce354fd433d2 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -1528,7 +1528,7 @@ void ODocumentDefinition::separateOpenCommandArguments( const Sequence< Property
{
"RecoveryStorage"
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( pObjectDescriptorArgs ); ++i )
+ for ( size_t i=0; i < sizeof( pObjectDescriptorArgs ) / sizeof( pObjectDescriptorArgs[0] ); ++i )
{
if ( aOpenCommandArguments.has( pObjectDescriptorArgs[i] ) )
{
diff --git a/dbaccess/source/core/inc/core_resource.hxx b/dbaccess/source/core/inc/core_resource.hxx
index 81e8bafc7056..eb07b348388e 100644
--- a/dbaccess/source/core/inc/core_resource.hxx
+++ b/dbaccess/source/core/inc/core_resource.hxx
@@ -31,7 +31,6 @@
#include <rtl/ustring.hxx>
#include <osl/mutex.hxx>
-#include <sal/macros.h>
class ResMgr;
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index 541c92137383..8bbae744f727 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -828,7 +828,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(sal_Bool _bHasCat
{
aRowLabels.push_back(::rtl::OUString::valueOf(h+1));
::std::vector< double > aRow;
- const sal_Int32 nSize = SAL_N_ELEMENTS(fDefaultData);
+ const sal_Int32 nSize = sizeof(fDefaultData)/sizeof(fDefaultData[0]);
for (size_t j = 0; j < (aColumns.size()-1); ++j,++k)
{
if ( k >= nSize )
diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx
index 0989ab5fc2e7..09c9d337be58 100644
--- a/dbaccess/source/core/misc/dsntypes.cxx
+++ b/dbaccess/source/core/misc/dsntypes.cxx
@@ -27,8 +27,6 @@
************************************************************************/
-#include <sal/macros.h>
-
#include "dsntypes.hxx"
#include "dbamiscres.hrc"
#include <unotools/confignode.hxx>
@@ -435,7 +433,7 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const String& _rDsn) const
KnownPrefix( "sdbc:address:macab", DST_MACAB, true )
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aKnowPrefixes ); ++i )
+ for ( size_t i=0; i < sizeof( aKnowPrefixes ) / sizeof( aKnowPrefixes[0] ); ++i )
{
sal_uInt16 nMatchLen = aKnowPrefixes[i].bMatchComplete ? sDsn.Len() : (sal_uInt16)rtl_str_getLength( aKnowPrefixes[i].pAsciiPrefix );
if ( sDsn.EqualsIgnoreCaseAscii( aKnowPrefixes[i].pAsciiPrefix, 0, nMatchLen ) )
diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx
index 1490f2a99095..1a4c4580dda5 100644
--- a/dbaccess/source/core/recovery/dbdocrecovery.cxx
+++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx
@@ -48,7 +48,6 @@
#include <comphelper/namedvaluecollection.hxx>
#include <rtl/ustrbuf.hxx>
#include <tools/diagnose_ex.h>
-#include <sal/macros.h>
#include <algorithm>
@@ -358,7 +357,7 @@ namespace dbaccess
// read the map from sub storages to object names
MapCompTypeToCompDescs aMapCompDescs;
SubComponentType aKnownTypes[] = { TABLE, QUERY, FORM, REPORT, RELATION_DESIGN };
- for ( size_t i = 0; i < SAL_N_ELEMENTS( aKnownTypes ); ++i )
+ for ( size_t i = 0; i < sizeof( aKnownTypes ) / sizeof( aKnownTypes[0] ); ++i )
{
if ( !xRecoveryStorage->hasByName( SubComponentRecovery::getComponentsStorageName( aKnownTypes[i] ) ) )
continue;
diff --git a/dbaccess/source/ext/macromigration/dbmm_types.hxx b/dbaccess/source/ext/macromigration/dbmm_types.hxx
index 13c02005b68c..a4d708d721cd 100644
--- a/dbaccess/source/ext/macromigration/dbmm_types.hxx
+++ b/dbaccess/source/ext/macromigration/dbmm_types.hxx
@@ -30,7 +30,6 @@
#define DBACCESS_DBMM_TYPES_HXX
#include <tools/string.hxx>
-#include <sal/macros.h>
//........................................................................
namespace dbmm
diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx
index 16126b154e4a..bb4918012733 100644
--- a/dbaccess/source/ext/macromigration/migrationengine.cxx
+++ b/dbaccess/source/ext/macromigration/migrationengine.cxx
@@ -238,7 +238,7 @@ namespace dbmm
LanguageMapping( "Python", ePython ), // TODO: is this correct?
LanguageMapping( "Basic", eBasic )
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( aLanguageMapping ); ++i )
+ for ( size_t i=0; i < sizeof( aLanguageMapping ) / sizeof( aLanguageMapping[0] ); ++i )
{
if ( _rLanguage.equalsAscii( aLanguageMapping[i].pAsciiLanguage ) )
{
@@ -1306,7 +1306,7 @@ namespace dbmm
ScriptType aKnownStorageBasedTypes[] = {
eBeanShell, eJavaScript, ePython, eJava
};
- for ( size_t i=0; i< SAL_N_ELEMENTS( aKnownStorageBasedTypes ); ++i )
+ for ( size_t i=0; i<sizeof( aKnownStorageBasedTypes ) / sizeof( aKnownStorageBasedTypes[0] ); ++i )
aElementNames.erase( lcl_getScriptsSubStorageName( aKnownStorageBasedTypes[i] ) );
if ( !aElementNames.empty() )
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx
index 3fa25bf18672..1b9d039803b5 100644
--- a/dbaccess/source/filter/xml/xmlExport.cxx
+++ b/dbaccess/source/filter/xml/xmlExport.cxx
@@ -57,7 +57,6 @@
#include <tools/diagnose_ex.h>
#include <connectivity/DriversConfig.hxx>
#include <connectivity/dbtools.hxx>
-#include <sal/macros.h>
#include <boost/optional.hpp>
@@ -366,7 +365,7 @@ void ODBExport::exportDataSource()
};
bool bIsXMLDefault = false;
- for ( size_t i=0; i < SAL_N_ELEMENTS( aTokens ); ++i )
+ for ( size_t i=0; i < sizeof( aTokens ) / sizeof( aTokens[0] ); ++i )
{
if ( pProperties->Name == aTokens[i].sPropertyName )
{
@@ -500,7 +499,7 @@ void ODBExport::exportApplicationConnectionSettings(const TSettingsMap& _aSettin
,XML_MAX_ROW_COUNT
,XML_SUPPRESS_VERSION_COLUMNS
};
- for (size_t i = 0; i< SAL_N_ELEMENTS(pSettings); ++i)
+ for (size_t i = 0; i< sizeof(pSettings)/sizeof(pSettings[0]); ++i)
{
TSettingsMap::const_iterator aFind = _aSettings.find(pSettings[i]);
if ( aFind != _aSettings.end() )
@@ -533,7 +532,7 @@ void ODBExport::exportDriverSettings(const TSettingsMap& _aSettings)
,XML_IS_FIRST_ROW_HEADER_LINE
,XML_PARAMETER_NAME_SUBSTITUTION
};
- for (size_t i = 0; i< SAL_N_ELEMENTS(pSettings); ++i)
+ for (size_t i = 0; i< sizeof(pSettings)/sizeof(pSettings[0]); ++i)
{
TSettingsMap::const_iterator aFind = _aSettings.find(pSettings[i]);
if ( aFind != _aSettings.end() )
@@ -635,7 +634,7 @@ void ODBExport::exportConnectionData()
};
for ( size_t i=0;
- i < SAL_N_ELEMENTS( aProperties );
+ i < sizeof( aProperties ) / sizeof( aProperties[0] );
++i
)
{
@@ -1164,7 +1163,7 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
};
::std::vector< XMLPropertyState > aPropertyStates;
- for (size_t i = 0 ; i < SAL_N_ELEMENTS(pExportHelper); ++i)
+ for (size_t i = 0 ; i < sizeof(pExportHelper)/sizeof(pExportHelper[0]); ++i)
{
aPropertyStates = pExportHelper[i].first->Filter(_xProp);
if ( !aPropertyStates.empty() )
@@ -1208,7 +1207,7 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp)
TExportPropMapperPair(m_xColumnExportHelper,TEnumMapperPair(&m_aAutoStyleNames,XML_STYLE_FAMILY_TABLE_COLUMN ))
,TExportPropMapperPair(m_xCellExportHelper,TEnumMapperPair(&m_aCellAutoStyleNames,XML_STYLE_FAMILY_TABLE_CELL))
};
- for (size_t i = 0 ; i < SAL_N_ELEMENTS(pExportHelper); ++i)
+ for (size_t i = 0 ; i < sizeof(pExportHelper)/sizeof(pExportHelper[0]); ++i)
{
::std::vector< XMLPropertyState > aPropStates = pExportHelper[i].first->Filter( _xProp );
if ( !aPropStates.empty() )
diff --git a/dbaccess/source/sdbtools/connection/tablename.cxx b/dbaccess/source/sdbtools/connection/tablename.cxx
index 856674eb2d16..f556773431e2 100644
--- a/dbaccess/source/sdbtools/connection/tablename.cxx
+++ b/dbaccess/source/sdbtools/connection/tablename.cxx
@@ -41,7 +41,6 @@
#include <connectivity/dbtools.hxx>
#include <tools/diagnose_ex.h>
#include <tools/string.hxx>
-#include <sal/macros.h>
//........................................................................
namespace sdbtools
@@ -232,7 +231,7 @@ namespace sdbtools
bool found = false;
size_t i = 0;
- for ( ; ( i < SAL_N_ELEMENTS( TypeTable ) ) && !found; ++i )
+ for ( ; ( i < sizeof( TypeTable ) / sizeof( TypeTable[0] ) ) && !found; ++i )
if ( TypeTable[i].nCompositionType == _nType )
found = true;
if ( !found )
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index cf12780f8713..e16f45f957d9 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -1228,7 +1228,7 @@ IMPL_LINK(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, /*pToolBox*/)
, SID_DB_APP_VIEW_DOCINFO_PREVIEW
};
- for(size_t i=0; i < SAL_N_ELEMENTS(pActions);++i)
+ for(size_t i=0; i < sizeof(pActions)/sizeof(pActions[0]);++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 189cb19e22b4..657154922292 100644
--- a/dbaccess/source/ui/app/AppIconControl.cxx
+++ b/dbaccess/source/ui/app/AppIconControl.cxx
@@ -60,7 +60,7 @@ OApplicationIconControl::OApplicationIconControl(Window* _pParent)
{ RID_STR_FORMS_CONTAINER, E_FORM, IMG_FORMFOLDER_TREE_L },
{ RID_STR_REPORTS_CONTAINER, E_REPORT, IMG_REPORTFOLDER_TREE_L }
};
- for ( size_t i=0; i < SAL_N_ELEMENTS(aCategories); ++i)
+ for ( size_t i=0; i < sizeof(aCategories)/sizeof(aCategories[0]); ++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 99db7f39e327..a9fee272763e 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.cxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.cxx
@@ -51,7 +51,7 @@ OTitleWindow::OTitleWindow(Window* _pParent,sal_uInt16 _nTitleId,WinBits _nBits,
ImplInitSettings( sal_True, sal_True, sal_True );
Window* pWindows [] = { &m_aSpace1, &m_aSpace2, &m_aTitle };
- 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]->Show();
}
// -----------------------------------------------------------------------------
@@ -164,7 +164,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 < SAL_N_ELEMENTS(pWindows); ++i)
+ for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++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 0caddb29b98c..7df8471d18c4 100644
--- a/dbaccess/source/ui/browser/dbloader.cxx
+++ b/dbaccess/source/ui/browser/dbloader.cxx
@@ -58,7 +58,6 @@
#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 +215,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 < SAL_N_ELEMENTS( aImplementations ); ++i )
+ for ( size_t i=0; i < sizeof( aImplementations ) / sizeof( aImplementations[0] ); ++i )
{
if ( sComponentURL.equalsAscii( aImplementations[i].pAsciiServiceName ) )
{
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index d05d8903e562..4283d7eed180 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -50,7 +50,6 @@
#include "UITools.hxx"
#include "commontypes.hxx"
-#include <sal/macros.h>
#include <vcl/waitobj.hxx>
#include <svl/urihelper.hxx>
#include "datasourceconnector.hxx"
@@ -1255,11 +1254,11 @@ namespace
"com.sun.star.formula.FormularProperties", "smath",
"com.sun.star.chart.ChartDocument", "schart"
};
- OSL_ENSURE( ( SAL_N_ELEMENTS( pTransTable ) ) % 2 == 0,
+ OSL_ENSURE( ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) % 2 == 0,
"lcl_getModuleHelpModuleName: odd size of translation table!" );
// loop through the table
- sal_Int32 nTableEntries = ( SAL_N_ELEMENTS( pTransTable ) ) / 2;
+ sal_Int32 nTableEntries = ( sizeof( pTransTable ) / sizeof( pTransTable[0] ) ) / 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 8ec842068115..9db7af8bbba6 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1329,7 +1329,7 @@ void SbaTableQueryBrowser::connectExternalDispatches()
ID_BROWSER_INSERTCONTENT
};
- for ( size_t i=0; i < SAL_N_ELEMENTS( pURLs ); ++i )
+ for ( size_t i=0; i < sizeof( pURLs ) / sizeof( pURLs[0] ); ++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 4b300ba6c6b9..94534b11649b 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -344,7 +344,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 < SAL_N_ELEMENTS(ppAggregates); ++i)
+ for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
getMaxXPosition(ppAggregates[i],lMaxXPosition);
if (m_pHorzScroll)
@@ -459,9 +459,9 @@ void OFieldDescControl::ScrollAllAggregates()
, pTextLenText, pLengthText
, pScaleText, m_pColumnNameText
, m_pTypeText, m_pAutoIncrementValueText};
- OSL_ENSURE(SAL_N_ELEMENTS(ppAggregates) == SAL_N_ELEMENTS(ppAggregatesText),"Lists are not identical!");
+ OSL_ENSURE(sizeof(ppAggregates)/sizeof(ppAggregates[0]) == sizeof(ppAggregatesText)/sizeof(ppAggregatesText[0]),"Lists are not identical!");
- for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(ppAggregates); ++i)
+ for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
ScrollAggregate(ppAggregatesText[i],ppAggregates[i],NULL,nDeltaX, nDeltaY);
ScrollAggregate(pFormatText,pFormatSample,pFormat,nDeltaX, nDeltaY);
@@ -473,7 +473,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 < SAL_N_ELEMENTS(ppAggregates); ++i)
+ for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
if (ppAggregates[i])
++nVisibleAggregates;
return nVisibleAggregates;
@@ -483,7 +483,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 < SAL_N_ELEMENTS(ppAggregates); ++i)
+ for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
{
if ( ppAggregates[i] )
{
@@ -514,9 +514,9 @@ void OFieldDescControl::SetReadOnly( sal_Bool bReadOnly )
, m_pTypeText, m_pAutoIncrementValueText
, pFormatText};
- OSL_ENSURE(SAL_N_ELEMENTS(ppAggregates) == SAL_N_ELEMENTS(ppAggregatesText),"Lists are not identical!");
+ OSL_ENSURE(sizeof(ppAggregates)/sizeof(ppAggregates[0]) == sizeof(ppAggregatesText)/sizeof(ppAggregatesText[0]),"Lists are not identical!");
- for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(ppAggregates); ++i)
+ for (sal_uInt16 i=0; i<sizeof(ppAggregates)/sizeof(ppAggregates[0]); ++i)
{
if ( ppAggregatesText[i] )
ppAggregatesText[i]->Enable( !bReadOnly );
@@ -808,7 +808,7 @@ void OFieldDescControl::ArrangeAggregates()
};
long nMaxWidth = 0;
- for (size_t i=0; i < SAL_N_ELEMENTS(adAggregates); i++)
+ for (size_t i=0; i<sizeof(adAggregates)/sizeof(adAggregates[0]); i++)
{
if (adAggregates[i].pctrlTextControl)
{
@@ -821,7 +821,7 @@ void OFieldDescControl::ArrangeAggregates()
// And go ...
int nCurrentControlPos = 0;
Control* pZOrderPredecessor = NULL;
- for (size_t i=0; i < SAL_N_ELEMENTS(adAggregates); i++)
+ for (size_t i=0; i<sizeof(adAggregates)/sizeof(adAggregates[0]); i++)
{
if (adAggregates[i].pctrlInputControl)
{
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
index 2a1dcd57db53..979697c2599d 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
@@ -191,7 +191,7 @@ namespace dbaui
//{
// String sDisplayName = m_pCollection->getTypeDisplayName(m_eType);
// FixedText* ppTextControls[] ={&m_aFT_Connection};
- // for (size_t i = 0; i < SAL_N_ELEMENTS(ppTextControls); ++i)
+ // for (size_t i = 0; i < sizeof(ppTextControls)/sizeof(ppTextControls[0]); ++i)
// {
// ppTextControls[i]->SetText(sDisplayName);
// }
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index ce492daca84e..5ea8e37f50a9 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -889,7 +889,7 @@ DBG_NAME(OFinalDBPageSetup)
Point aPos(m_aFTFinalHeader.GetPosPixel());
Size aStart(m_aFTFinalHeader.GetSizePixel());
aPos.Y() += aStart.Height() + nUnrelatedHeight;
- sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
+ sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
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 58f0038b0f85..3c19ad990eee 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -145,7 +145,7 @@ DBG_NAME(OTextConnectionHelper)
{ 0, NULL }
};
- for ( size_t section=0; section < SAL_N_ELEMENTS( aSections ) - 1; ++section )
+ for ( size_t section=0; section < sizeof( aSections ) / sizeof( aSections[0] ) - 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 11a8098afe2d..54f02d65d1ee 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -465,7 +465,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp
{0,0}
};
- OSL_ENSURE(SAL_N_ELEMENTS(aItemInfos) == DSID_LAST_ITEM_ID,"Invalid Ids!");
+ OSL_ENSURE(sizeof(aItemInfos)/sizeof(aItemInfos[0]) == 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 140344030785..007b7b1b5ad3 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -110,7 +110,7 @@ namespace dbaui
m_pAutoIncrementLabel, m_pAutoIncrement,
m_pAutoRetrievingLabel, m_pAutoRetrieving };
- sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
+ sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
for (sal_Int32 i=1; i < nCount; ++i)
{
if ( pWindows[i] )
@@ -363,7 +363,7 @@ namespace dbaui
,m_pOptionsLabel,m_pOptions,&m_aUseCatalog
};
- sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
+ sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
for (sal_Int32 i=1; i < nCount; ++i)
pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND);
}
@@ -544,7 +544,7 @@ namespace dbaui
&m_aFTDriverClass, &m_aEDDriverClass,&m_aTestJavaDriver,
m_pCharsetLabel, m_pCharset};
- sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
+ sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
for (sal_Int32 i=1; i < nCount; ++i)
pWindows[i]->SetZOrder(pWindows[i-1], WINDOW_ZORDER_BEHIND);
@@ -677,7 +677,7 @@ namespace dbaui
Window* pWindows[] = { &m_aMySQLSettings, &m_aSeparator2, &m_aUserNameLabel, &m_aUserName,
&m_aPasswordRequired, m_pCharsetLabel, m_pCharset};
- sal_Int32 nCount = SAL_N_ELEMENTS(pWindows);
+ sal_Int32 nCount = sizeof(pWindows) / sizeof(pWindows[0]);
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 baee01c37736..e3009ae7514b 100644
--- a/dbaccess/source/ui/dlg/dsselect.cxx
+++ b/dbaccess/source/ui/dlg/dsselect.cxx
@@ -33,7 +33,6 @@
#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>
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 6433aa01bd34..1887206d359e 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -128,7 +128,7 @@ namespace dbaui
&m_aTypePostLabel
};
const long nOffset = m_aRB_OpenDocument.GetPosPixel().Y() - m_aRB_CreateDatabase.GetPosPixel().Y();
- for ( size_t i=0; i < SAL_N_ELEMENTS( pWindowsToMove ); ++i )
+ for ( size_t i=0; i < sizeof( pWindowsToMove ) / sizeof( pWindowsToMove[0] ); ++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 841bcfabbc2c..60a82630050a 100644
--- a/dbaccess/source/ui/inc/dbadmin.hxx
+++ b/dbaccess/source/ui/inc/dbadmin.hxx
@@ -29,7 +29,6 @@
#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 4297cdef693a..9211a90d9100 100644
--- a/dbaccess/source/ui/inc/moduledbu.hxx
+++ b/dbaccess/source/ui/inc/moduledbu.hxx
@@ -31,7 +31,6 @@
#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 4850a32a2814..c58af20caf73 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -361,7 +361,7 @@ void ODatabaseExport::insertValueIntoColumn()
,NumberFormat::NUMBER
,NumberFormat::LOGICAL
};
- for (size_t i = 0; i < SAL_N_ELEMENTS(nFormats); ++i)
+ for (size_t i = 0; i < sizeof(nFormats)/sizeof(nFormats[0]); ++i)
{
try
{
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index ed2f8717ec7c..cc5409441d91 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -1033,7 +1033,7 @@ sal_Bool callColumnFormatDialog(Window* _pParent,
delete pFormatDescriptor;
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 bRet;
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 36dacbc1810a..752fbf76139a 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 < SAL_N_ELEMENTS( aCopyProperties ); ++i )
+ for ( size_t i=0; i < sizeof( aCopyProperties ) / sizeof( aCopyProperties[0] ); ++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 < SAL_N_ELEMENTS( aProperties ); ++i )
+ for ( i=0; i < sizeof( aProperties ) / sizeof( aProperties[0] ); ++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 a6eb6aa43dc4..8a0b39e589be 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -203,7 +203,7 @@ void OSelectionBrowseBox::initialize()
String sGroup = m_aFunctionStrings.GetToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';') - 1);
m_aFunctionStrings = m_aFunctionStrings.GetToken(0);
- for (size_t i = 0; i < SAL_N_ELEMENTS(eFunctions); ++i)
+ for (size_t i = 0; i < sizeof (eFunctions) / sizeof (eFunctions[0]); ++i)
{
m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";"));
m_aFunctionStrings += rtl::OStringToOUString(rContext.getIntlKeywordAscii(eFunctions[i]),
@@ -354,7 +354,8 @@ void OSelectionBrowseBox::Init()
Size aHeight;
const Control* pControls[] = { m_pTextCell,m_pVisibleCell,m_pTableCell,m_pFieldCell };
- for(sal_Size i= 0; i < SAL_N_ELEMENTS(pControls);++i)
+
+ for (sal_Size_t i = 0; i < sizeof (pControls) / sizeof (pControls[0]); ++i)
{
const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) );
if ( aTemp.Height() > aHeight.Height() )
@@ -2180,7 +2181,7 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const
{
sal_Int32 nErg(0);
// only the first 11 row are interesting
- sal_Int32 nSize = SAL_N_ELEMENTS(nVisibleRowMask);
+ sal_Int32 nSize = sizeof(nVisibleRowMask) / sizeof(nVisibleRowMask[0]);
for(sal_Int32 i=0;i<nSize;i++)
{
if(!m_bVisibleRow[i])
@@ -2192,7 +2193,7 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const
void OSelectionBrowseBox::SetNoneVisbleRow(long nRows)
{
// only the first 11 row are interesting
- sal_Int32 nSize = SAL_N_ELEMENTS(nVisibleRowMask);
+ sal_Int32 nSize = sizeof(nVisibleRowMask) / sizeof(nVisibleRowMask[0]);
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 49a01c53bc54..bd9037b0326c 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -301,7 +301,7 @@ void OTableEditorCtrl::InitCellController()
Size aHeight;
const Control* pControls[] = { pTypeCell,pDescrCell,pNameCell,pHelpTextCell};
- for(sal_Size i= 0; i < SAL_N_ELEMENTS(pControls);++i)
+ for(sal_Size i= 0; i < sizeof(pControls) / sizeof(pControls[0]);++i)
{
const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) );
if ( aTemp.Height() > aHeight.Height() )
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index 3933353b1c06..fbeda28fd36b 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -750,7 +750,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 < SAL_N_ELEMENTS( aSettings ); ++i )
+ for ( size_t i=0; i < sizeof( aSettings ) / sizeof( aSettings[0] ); ++i )
{
if ( lcl_hasNonEmptyStringValue_throw( _rxSourceDescriptor, xPSI, aSettings[i] ) )
{