summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-05-31 12:47:35 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-05-31 13:09:03 +0100
commitb1ca0f247280ca1b7f96fef8c89bc451c38d11af (patch)
treea40a29d958539ce0a4ae1dac2f8b6dfea5d53138
parent5feff80fd2943124568eba07c8cdc465ac201e5d (diff)
targetted SAL_N_ELEMENTS reversion.
Change-Id: I58636bc87bc17ff2b35621ad554bd05f5c1dab20
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx2
-rw-r--r--sc/source/core/data/cell2.cxx2
-rw-r--r--sc/source/core/data/dpobject.cxx2
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sc/source/core/tool/interpr2.cxx6
-rw-r--r--sc/source/core/tool/odffmap.cxx2
-rw-r--r--sc/source/filter/qpro/qproform.cxx2
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx2
-rw-r--r--sc/source/ui/miscdlgs/protectiondlg.cxx2
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx4
-rw-r--r--sc/source/ui/unoobj/servuno.cxx6
-rw-r--r--sc/source/ui/unoobj/tokenuno.cxx2
-rw-r--r--sc/source/ui/vba/vbaborders.cxx3
-rw-r--r--sc/source/ui/vba/vbadialog.cxx2
-rw-r--r--sc/source/ui/vba/vbaglobals.cxx3
-rw-r--r--sc/source/ui/vba/vbapalette.cxx2
16 files changed, 23 insertions, 21 deletions
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 8a0b39e589be..39ed8c602eed 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -355,7 +355,7 @@ void OSelectionBrowseBox::Init()
Size aHeight;
const Control* pControls[] = { m_pTextCell,m_pVisibleCell,m_pTableCell,m_pFieldCell };
- for (sal_Size_t i = 0; i < sizeof (pControls) / sizeof (pControls[0]); ++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/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index 1e0dcbe6728a..e9713d0d7ad5 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -153,7 +153,7 @@ void ScEditCell::RemoveCharAttribs( const ScPatternAttr& rAttr )
{ ATTR_FONT_WEIGHT, EE_CHAR_WEIGHT },
{ ATTR_FONT_COLOR, EE_CHAR_COLOR }
};
- sal_uInt16 nMapCount = SAL_N_ELEMENTS(AttrTypeMap);
+ sal_uInt16 nMapCount = sizeof (AttrTypeMap) / sizeof (AttrTypeMap[0]);
const SfxItemSet& rSet = rAttr.GetItemSet();
const SfxPoolItem* pItem;
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index b6abe7d512ab..b4b62cfdc278 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -1236,7 +1236,7 @@ bool lcl_ParseFunction( const String& rList, xub_StrLen nStartPos, xub_StrLen& r
{
aFuncStr = comphelper::string::strip(aFuncStr, ' ');
- const sal_Int32 nFuncCount = SAL_N_ELEMENTS(aFunctions);
+ const sal_Int32 nFuncCount = sizeof(aFunctions) / sizeof(aFunctions[0]);
for ( sal_Int32 nFunc=0; nFunc<nFuncCount && !bFound; nFunc++ )
{
if ( aFuncStr.EqualsIgnoreCaseAscii( aFunctions[nFunc].pName ) )
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index a46bd00e4e0b..d1e07de9e362 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2483,7 +2483,7 @@ bool ScCompiler::IsOpCode( const String& rName, bool bInArray )
// XXX none currently. Example:
//{ "ORG.OPENOFFICE.EASTERSUNDAY", ocEasterSunday }
};
- static const size_t nOdffAliases = SAL_N_ELEMENTS(aOdffAliases);
+ static const size_t nOdffAliases = sizeof(aOdffAliases) / sizeof(aOdffAliases[0]);
for (size_t i=0; i<nOdffAliases; ++i)
{
if (rName.EqualsIgnoreCaseAscii( aOdffAliases[i].pName))
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index ad9e3501d1c2..dc843591e9ba 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2364,7 +2364,7 @@ void ScInterpreter::ScBase()
'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
0
};
- static const int nDigits = SAL_N_ELEMENTS(pDigits)-1;
+ static const int nDigits = (sizeof (pDigits)/sizeof(pDigits[0]))-1;
xub_StrLen nMinLen;
if ( nParamCount == 3 )
{
@@ -2573,7 +2573,7 @@ void ScInterpreter::ScRoman()
{
static const sal_Unicode pChars[] = { 'M', 'D', 'C', 'L', 'X', 'V', 'I' };
static const sal_uInt16 pValues[] = { 1000, 500, 100, 50, 10, 5, 1 };
- static const sal_uInt16 nMaxIndex = (sal_uInt16)(SAL_N_ELEMENTS(pValues) - 1);
+ static const sal_uInt16 nMaxIndex = (sal_uInt16)((sizeof(pValues)/sizeof(pValues[0])) - 1);
String aRoman;
sal_uInt16 nVal = (sal_uInt16) fVal;
@@ -2806,7 +2806,7 @@ bool lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec )
{ "SKK", 30.1260, 2 }
};
- const size_t nConversionCount = SAL_N_ELEMENTS(aConvertTable);
+ const size_t nConversionCount = sizeof( aConvertTable ) / sizeof( aConvertTable[0] );
for ( size_t i = 0; i < nConversionCount; i++ )
if ( aSearchUnit.EqualsIgnoreCaseAscii( aConvertTable[i].pCurrText ) )
{
diff --git a/sc/source/core/tool/odffmap.cxx b/sc/source/core/tool/odffmap.cxx
index 379ccf19e123..2129da3708c1 100644
--- a/sc/source/core/tool/odffmap.cxx
+++ b/sc/source/core/tool/odffmap.cxx
@@ -143,7 +143,7 @@ const ScCompiler::AddInMap* ScCompiler::GetAddInMap()
size_t ScCompiler::GetAddInMapCount()
{
- return SAL_N_ELEMENTS(maAddInMap);
+ return sizeof(maAddInMap)/sizeof(maAddInMap[0]);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index 6c8e8b7d371c..e9f5dece0ed1 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -556,7 +556,7 @@ static const struct
{ ocNoName, FT_NotImpl } // gives properties of DOS menus
};
-const int nIndexCount = SAL_N_ELEMENTS(aFuncMap);
+const int nIndexCount = sizeof( aFuncMap ) / sizeof( aFuncMap[ 0 ] );
DefTokenId QProToSc::IndexToToken( sal_uInt16 nIndex )
{
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index c2fb1fdf498e..9c2e1b601f55 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1964,7 +1964,7 @@ ScXMLImport::ScXMLImport(
{ XML_CURRENCY, util::NumberFormat::CURRENCY },
{ XML_BOOLEAN, util::NumberFormat::LOGICAL }
};
- size_t n = SAL_N_ELEMENTS(aCellTypePairs);
+ size_t n = sizeof(aCellTypePairs)/sizeof(aCellTypePairs[0]);
for (size_t i = 0; i < n; ++i)
{
aCellTypeMap.insert(
diff --git a/sc/source/ui/miscdlgs/protectiondlg.cxx b/sc/source/ui/miscdlgs/protectiondlg.cxx
index 2ed31823c4a0..f1defb8404e2 100644
--- a/sc/source/ui/miscdlgs/protectiondlg.cxx
+++ b/sc/source/ui/miscdlgs/protectiondlg.cxx
@@ -41,7 +41,7 @@ static const ScTableProtection::Option aOptions[] = {
ScTableProtection::SELECT_LOCKED_CELLS,
ScTableProtection::SELECT_UNLOCKED_CELLS,
};
-static const sal_uInt16 nOptionCount = SAL_N_ELEMENTS(aOptions);
+static const sal_uInt16 nOptionCount = sizeof(aOptions) / sizeof (aOptions[0]);
ScTableProtectionDlg::ScTableProtectionDlg(Window* pParent) :
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 7e254d9cd592..43d0bb5f84c8 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -193,7 +193,7 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
rStream.Seek(STREAM_SEEK_TO_BEGIN);
rStream >> nMark;
bool bValidMark = false;
- for (size_t i=0; i < SAL_N_ELEMENTS(nValidMarks) && !bValidMark; ++i)
+ for (size_t i=0; i < sizeof(nValidMarks)/sizeof(nValidMarks[0]) && !bValidMark; ++i)
{
if (nValidMarks[i] == nMark)
bValidMark = true;
@@ -650,7 +650,7 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
pLotus2,
pQPro
};
- const sal_uInt16 nFilterCount = SAL_N_ELEMENTS(ppFilterPatterns);
+ const sal_uInt16 nFilterCount = sizeof (ppFilterPatterns) / sizeof (ppFilterPatterns[0]);
static const sal_Char* const pFilterName[] = // zugehoerige Filter
{
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index c106409eb77a..5b622f693393 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -398,8 +398,8 @@ sal_uInt16 ScServiceProvider::GetProviderType(const String& rServiceName)
{
if (rServiceName.Len())
{
- const sal_uInt16 nEntries = SAL_N_ELEMENTS(aProvNamesId);
-
+ const sal_uInt16 nEntries =
+ sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
for (sal_uInt16 i = 0; i < nEntries; i++)
{
if (rServiceName.EqualsAscii( aProvNamesId[i].pName ))
@@ -662,7 +662,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
uno::Sequence<rtl::OUString> ScServiceProvider::GetAllServiceNames()
{
- const sal_uInt16 nEntries = SAL_N_ELEMENTS(aProvNamesId);
+ const sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]);
uno::Sequence<rtl::OUString> aRet(nEntries);
rtl::OUString* pArray = aRet.getArray();
for (sal_uInt16 i = 0; i < nEntries; i++)
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index 38bc1909a38c..1929a6014524 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -107,7 +107,7 @@ void ScFormulaParserObj::SetCompilerFlags( ScCompiler& rCompiler ) const
formula::FormulaGrammar::CONV_XL_OOX, // <- AddressConvention::XL_OOX
formula::FormulaGrammar::CONV_LOTUS_A1 // <- AddressConvention::LOTUS_A1
};
- static const sal_Int16 nConvMapCount = SAL_N_ELEMENTS(aConvMap);
+ static const sal_Int16 nConvMapCount = sizeof(aConvMap)/sizeof(aConvMap[0]);
// If mxOpCodeMap is not empty it overrides mbEnglish, and vice versa. We
// don't need to initialize things twice.
diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx
index 46719890a00c..753e6552a1ea 100644
--- a/sc/source/ui/vba/vbaborders.cxx
+++ b/sc/source/ui/vba/vbaborders.cxx
@@ -36,6 +36,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/XColumnRowRange.hpp>
+
#include "vbapalette.hxx"
using namespace ::com::sun::star;
@@ -332,7 +333,7 @@ public:
// XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException)
{
- return SAL_N_ELEMENTS( supportedIndexTable );
+ return sizeof( supportedIndexTable ) / sizeof( supportedIndexTable[0] );
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
{
diff --git a/sc/source/ui/vba/vbadialog.cxx b/sc/source/ui/vba/vbadialog.cxx
index 5477dfd3caaa..d7cbb7446b1d 100644
--- a/sc/source/ui/vba/vbadialog.cxx
+++ b/sc/source/ui/vba/vbadialog.cxx
@@ -69,7 +69,7 @@ static const DialogMatch aDialogMatchList[] =
{ 269, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoFormat" ) ) } // xlDialogFormatAuto -> .uno:AutoFormat
};
-const sal_Int32 nDialogSize = SAL_N_ELEMENTS( aDialogMatchList ) ;
+const sal_Int32 nDialogSize = sizeof (aDialogMatchList) / sizeof (aDialogMatchList[0]);
rtl::OUString
ScVbaDialog::mapIndexToName( sal_Int32 nIndex )
diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx
index 43df5dfe15e7..9d210f81b62e 100644
--- a/sc/source/ui/vba/vbaglobals.cxx
+++ b/sc/source/ui/vba/vbaglobals.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <cppuhelper/component_context.hxx>
+
#include "vbaapplication.hxx"
#include "vbaworksheet.hxx"
#include "vbarange.hxx"
@@ -271,7 +272,7 @@ ScVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException)
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ooo.vba.excel.Hyperlink" ) ),
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.script.vba.VBASpreadsheetEventProcessor" ) )
};
- sal_Int32 nExcelServices = ( SAL_N_ELEMENTS(names) );
+ sal_Int32 nExcelServices = ( sizeof( names )/ sizeof( names[0] ) );
sal_Int32 startIndex = serviceNames.getLength();
serviceNames.realloc( serviceNames.getLength() + nExcelServices );
for ( sal_Int32 index = 0; index < nExcelServices; ++index )
diff --git a/sc/source/ui/vba/vbapalette.cxx b/sc/source/ui/vba/vbapalette.cxx
index 209dd2d8e564..ba9ab473159a 100644
--- a/sc/source/ui/vba/vbapalette.cxx
+++ b/sc/source/ui/vba/vbapalette.cxx
@@ -65,7 +65,7 @@ public:
// Methods XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException)
{
- return SAL_N_ELEMENTS(spnDefColorTable8);
+ return sizeof(spnDefColorTable8) / sizeof(spnDefColorTable8[0]);
}
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)