From b1ca0f247280ca1b7f96fef8c89bc451c38d11af Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 31 May 2012 12:47:35 +0100 Subject: targetted SAL_N_ELEMENTS reversion. Change-Id: I58636bc87bc17ff2b35621ad554bd05f5c1dab20 --- sc/source/core/data/cell2.cxx | 2 +- sc/source/core/data/dpobject.cxx | 2 +- sc/source/core/tool/compiler.cxx | 2 +- sc/source/core/tool/interpr2.cxx | 6 +++--- sc/source/core/tool/odffmap.cxx | 2 +- sc/source/filter/qpro/qproform.cxx | 2 +- sc/source/filter/xml/xmlimprt.cxx | 2 +- sc/source/ui/miscdlgs/protectiondlg.cxx | 2 +- sc/source/ui/unoobj/scdetect.cxx | 4 ++-- sc/source/ui/unoobj/servuno.cxx | 6 +++--- sc/source/ui/unoobj/tokenuno.cxx | 2 +- sc/source/ui/vba/vbaborders.cxx | 3 ++- sc/source/ui/vba/vbadialog.cxx | 2 +- sc/source/ui/vba/vbaglobals.cxx | 3 ++- sc/source/ui/vba/vbapalette.cxx | 2 +- 15 files changed, 22 insertions(+), 20 deletions(-) (limited to 'sc') 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> 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 ScServiceProvider::MakeInstance( uno::Sequence ScServiceProvider::GetAllServiceNames() { - const sal_uInt16 nEntries = SAL_N_ELEMENTS(aProvNamesId); + const sal_uInt16 nEntries = sizeof(aProvNamesId) / sizeof(aProvNamesId[0]); uno::Sequence 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 #include #include + #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 #include #include + #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) -- cgit