[Libreoffice-commits] .: 7 commits - basegfx/source chart2/source dbaccess/source reportdesign/source sc/source svtools/source sw/source tools/source writerfilter/source

Michael Meeks michael at kemper.freedesktop.org
Thu May 31 05:10:47 PDT 2012


 basegfx/source/polygon/b2dpolypolygoncutter.cxx           |    4 +-
 chart2/source/view/main/ChartView.cxx                     |    2 -
 chart2/source/view/main/VDataSeries.cxx                   |    2 -
 dbaccess/source/core/api/RowSet.cxx                       |    2 -
 dbaccess/source/core/api/columnsettings.cxx               |    3 -
 dbaccess/source/core/api/definitioncolumn.cxx             |    3 -
 dbaccess/source/core/api/tablecontainer.cxx               |    2 -
 dbaccess/source/core/dataaccess/documentdefinition.cxx    |    2 -
 dbaccess/source/core/inc/core_resource.hxx                |    1 
 dbaccess/source/core/misc/DatabaseDataProvider.cxx        |    2 -
 dbaccess/source/core/misc/dsntypes.cxx                    |    4 --
 dbaccess/source/core/recovery/dbdocrecovery.cxx           |    3 -
 dbaccess/source/ext/macromigration/dbmm_types.hxx         |    1 
 dbaccess/source/ext/macromigration/migrationengine.cxx    |    4 +-
 dbaccess/source/filter/xml/xmlExport.cxx                  |   13 +++----
 dbaccess/source/sdbtools/connection/tablename.cxx         |    3 -
 dbaccess/source/ui/app/AppDetailPageHelper.cxx            |    2 -
 dbaccess/source/ui/app/AppIconControl.cxx                 |    2 -
 dbaccess/source/ui/app/AppTitleWindow.cxx                 |    4 +-
 dbaccess/source/ui/browser/dbloader.cxx                   |    3 -
 dbaccess/source/ui/browser/genericcontroller.cxx          |    5 +-
 dbaccess/source/ui/browser/unodatbr.cxx                   |    2 -
 dbaccess/source/ui/control/FieldDescControl.cxx           |   18 +++++-----
 dbaccess/source/ui/dlg/ConnectionPageSetup.cxx            |    2 -
 dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx         |    2 -
 dbaccess/source/ui/dlg/TextConnectionHelper.cxx           |    2 -
 dbaccess/source/ui/dlg/dbadmin.cxx                        |    2 -
 dbaccess/source/ui/dlg/detailpages.cxx                    |    8 ++--
 dbaccess/source/ui/dlg/dsselect.cxx                       |    1 
 dbaccess/source/ui/dlg/generalpage.cxx                    |    2 -
 dbaccess/source/ui/inc/dbadmin.hxx                        |    1 
 dbaccess/source/ui/inc/moduledbu.hxx                      |    1 
 dbaccess/source/ui/misc/DExport.cxx                       |    2 -
 dbaccess/source/ui/misc/UITools.cxx                       |    2 -
 dbaccess/source/ui/misc/WCopyTable.cxx                    |    4 +-
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx     |    9 ++---
 dbaccess/source/ui/tabledesign/TEditControl.cxx           |    2 -
 dbaccess/source/ui/uno/copytablewizard.cxx                |    2 -
 reportdesign/source/core/api/FixedLine.cxx                |    2 -
 reportdesign/source/core/api/FixedText.cxx                |    2 -
 reportdesign/source/core/api/FormattedField.cxx           |    2 -
 reportdesign/source/core/api/ImageControl.cxx             |    2 -
 reportdesign/source/core/api/ReportDefinition.cxx         |    4 +-
 reportdesign/source/core/api/Section.cxx                  |    6 +--
 reportdesign/source/core/api/Shape.cxx                    |    2 -
 reportdesign/source/core/inc/Tools.hxx                    |    1 
 reportdesign/source/filter/xml/xmlExport.cxx              |    2 -
 reportdesign/source/ui/dlg/CondFormat.cxx                 |    2 -
 reportdesign/source/ui/dlg/DateTime.cxx                   |    2 -
 reportdesign/source/ui/dlg/GroupsSorting.cxx              |   25 ++++++--------
 reportdesign/source/ui/inc/metadata.hxx                   |    2 -
 reportdesign/source/ui/inspection/DataProviderHandler.cxx |    2 -
 reportdesign/source/ui/inspection/DefaultInspection.cxx   |    4 +-
 reportdesign/source/ui/inspection/GeometryHandler.cxx     |    2 -
 reportdesign/source/ui/inspection/metadata.cxx            |    4 +-
 reportdesign/source/ui/misc/UITools.cxx                   |    7 +--
 reportdesign/source/ui/report/ReportController.cxx        |   24 ++++++-------
 reportdesign/source/ui/report/propbrw.cxx                 |    4 +-
 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/XMLStylesExportHelper.cxx            |    2 -
 sc/source/filter/xml/xmlimprt.cxx                         |    2 -
 sc/source/filter/xml/xmlstyli.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 -
 sc/source/ui/vba/vbarange.cxx                             |    2 -
 svtools/source/control/ruler.cxx                          |    6 +--
 svtools/source/control/toolbarmenu.cxx                    |    2 -
 svtools/source/filter/igif/gifread.cxx                    |    4 +-
 svtools/source/filter/sgvmain.cxx                         |    3 +
 svtools/source/filter/sgvspln.cxx                         |   16 +++++---
 svtools/source/filter/sgvtext.cxx                         |    2 -
 sw/source/filter/ww8/wrtw8sty.cxx                         |    4 +-
 sw/source/ui/config/uinums.cxx                            |    2 -
 tools/source/inet/inetstrm.cxx                            |    2 -
 writerfilter/source/dmapper/WrapPolygonHandler.cxx        |    6 +--
 writerfilter/source/resourcemodel/XPathLogger.cxx         |    3 +
 87 files changed, 158 insertions(+), 170 deletions(-)

New commits:
commit d4fac516c2294596786321c040597c2659a06132
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu May 31 13:03:38 2012 +0100

    targetted revert of small prefix operator changes
    
    Change-Id: I02e9af0034f4e9ed626615083c7c1506597f2a7e

diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.cxx b/writerfilter/source/dmapper/WrapPolygonHandler.cxx
index 8d6682a..dd3e168 100644
--- a/writerfilter/source/dmapper/WrapPolygonHandler.cxx
+++ b/writerfilter/source/dmapper/WrapPolygonHandler.cxx
@@ -90,7 +90,7 @@ WrapPolygon::Pointer_t WrapPolygon::move(const awt::Point & rPoint)
     {
         awt::Point aPoint(aIt->X + rPoint.X, aIt->Y + rPoint.Y);
         pResult->addPoint(aPoint);
-        ++aIt;
+        aIt++;
     }
 
     return pResult;
@@ -107,7 +107,7 @@ WrapPolygon::Pointer_t WrapPolygon::scale(const Fraction & rFractionX, const Fra
     {
         awt::Point aPoint(Fraction(aIt->X) * rFractionX, Fraction(aIt->Y) * rFractionY);
         pResult->addPoint(aPoint);
-        ++aIt;
+        aIt++;
     }
 
     return pResult;
@@ -149,7 +149,7 @@ drawing::PointSequenceSequence WrapPolygon::getPointSequenceSequence() const
     {
         (*pPolygon)[n] = *aIt;
         ++n;
-        ++aIt;
+        aIt++;
     }
 
     return aPolyPolygon;
diff --git a/writerfilter/source/resourcemodel/XPathLogger.cxx b/writerfilter/source/resourcemodel/XPathLogger.cxx
index b9381e3..8f2d2f0 100644
--- a/writerfilter/source/resourcemodel/XPathLogger.cxx
+++ b/writerfilter/source/resourcemodel/XPathLogger.cxx
@@ -52,7 +52,8 @@ void XPathLogger::updateCurrentPath()
     m_currentPath = "";
 
     for (vector<string>::const_iterator aIt = m_path.begin();
-         aIt != m_path.end(); ++aIt)
+         aIt != m_path.end();
+         aIt++)
     {
         if (m_currentPath.size() > 0)
             m_currentPath += "/";
commit c326e8c68748b8793272018c2c5fa414613aa722
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu May 31 13:01:18 2012 +0100

    targetted revert of minor cppcheck cleanups
    
    Change-Id: I2ec1bc3fd5dd5d38c2b3b9600265943083873515

diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 43a6910..a85de0c 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -3201,7 +3201,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
                                             ,PROPERTY_FORMATSSUPPLIER
                                             ,PROPERTY_BACKGROUNDCOLOR
         };
-        for(size_t i = 0; i < sizeof (nProps) / sizeof (nProps[0]);++i)
+        for(size_t i = 0; i < sizeof (sProps) / sizeof (sProps[0]); ++i)
         {
             if ( xInfo->hasPropertyByName(sProps[i]) && xShapeInfo->hasPropertyByName(sProps[i]) )
                 xUnoProp->setPropertyValue(sProps[i],xShapeProp->getPropertyValue(sProps[i]));
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 31cd5ce..f7519a5 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -451,10 +451,13 @@ void Ruler::ImplInvertLines( sal_Bool bErase )
 
 void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
 {
+    long    n = 0;
     long    nTick3 = aImplRulerUnitTab[mnUnitIndex].nTick3;
     long    nTickCount = aImplRulerUnitTab[mnUnitIndex].nTick1;
     Size    aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode );
     long    nTickWidth;
+    long    nX;
+    long    nY;
     sal_Bool    bNoTicks = sal_False;
 
     //Amelia
@@ -550,9 +553,6 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
 
     if ( !bNoTicks )
     {
-        long nX;
-        long nY;
-        long n = 0;
         long nTick = 0;
         while ( ((nStart-n) >= nMin) || ((nStart+n) <= nMax) )
         {
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index d09344c..84b8af0 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -1017,12 +1017,12 @@ void ToolbarMenu::MouseMove( const MouseEvent& rMEvt )
 
 void ToolbarMenu::implHighlightEntry( const MouseEvent& rMEvt, bool /*bMBDown*/ )
 {
+    long nY = 0;
     long nMouseY = rMEvt.GetPosPixel().Y();
     Size aOutSz = GetOutputSizePixel();
     if ( ( nMouseY >= 0 ) && ( nMouseY < aOutSz.Height() ) )
     {
         bool bHighlighted = sal_False;
-        long nY = 0;
 
         const int nEntryCount = mpImpl->maEntryVector.size();
         int nEntry;
diff --git a/svtools/source/filter/igif/gifread.cxx b/svtools/source/filter/igif/gifread.cxx
index 210b940..4dc6750 100644
--- a/svtools/source/filter/igif/gifread.cxx
+++ b/svtools/source/filter/igif/gifread.cxx
@@ -450,7 +450,7 @@ void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount )
         {
             if( bInterlaced )
             {
-                long nT1;
+                long nT1, nT2;
 
                 // falls Interlaced, werden die Zeilen kopiert
                 if( nLastInterCount )
@@ -488,7 +488,7 @@ void GIFReader::FillImages( HPBYTE pBytes, sal_uLong nCount )
 
                 if( nT1 >= nImageHeight )
                 {
-                    long nT2 = nImageY - ( ( nImageHeight + 7 ) >> 3 );
+                    nT2 = nImageY - ( ( nImageHeight + 7 ) >> 3 );
                     nT1 = ( nT2 << 3 ) + 4;
                     nLastInterCount = 3;
 
diff --git a/svtools/source/filter/sgvmain.cxx b/svtools/source/filter/sgvmain.cxx
index bbfda53..4e8aea6 100644
--- a/svtools/source/filter/sgvmain.cxx
+++ b/svtools/source/filter/sgvmain.cxx
@@ -766,6 +766,7 @@ void CircType::Draw(OutputDevice& rOut)
 void BmapType::Draw(OutputDevice& rOut)
 {
     //ifstream aInp;
+    unsigned char   nSgfTyp;
     sal_uInt16          nVersion;
     String          aStr(
         reinterpret_cast< char const * >(&Filename[ 1 ]),
@@ -775,7 +776,7 @@ void BmapType::Draw(OutputDevice& rOut)
     SvStream* pInp = ::utl::UcbStreamHelper::CreateStream( aFNam.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ );
     if ( pInp )
     {
-        unsigned char nSgfTyp=CheckSgfTyp( *pInp,nVersion);
+        nSgfTyp=CheckSgfTyp( *pInp,nVersion);
         switch(nSgfTyp) {
             case SGF_BITIMAGE: {
                 GraphicFilter aFlt;
diff --git a/svtools/source/filter/sgvspln.cxx b/svtools/source/filter/sgvspln.cxx
index 175ae72..f4cee7c 100644
--- a/svtools/source/filter/sgvspln.cxx
+++ b/svtools/source/filter/sgvspln.cxx
@@ -801,6 +801,9 @@ sal_Bool CalcSpline(Polygon& rPoly, sal_Bool Periodic, sal_uInt16& n,
 *************************************************************************/
 sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly)
 {
+    short  MinKoord=-32000; // zur Vermeidung
+    short  MaxKoord=32000;  // von Ueberlaeufen
+
     double* ax;          // Koeffizienten der Polynome
     double* ay;
     double* bx;
@@ -811,20 +814,19 @@ sal_Bool Spline2Poly(Polygon& rSpln, sal_Bool Periodic, Polygon& rPoly)
     double* dy;
     double* tv;
 
+    double  Step;        // Schrittweite fuer t
+    double  dt1,dt2,dt3; // Delta t, y, ^3
+    double  t;
     sal_Bool    bEnde;       // Teilpolynom zu Ende?
     sal_uInt16  n;           // Anzahl der zu zeichnenden Teilpolynome
     sal_uInt16  i;           // aktuelles Teilpolynom
     sal_Bool    bOk;         // noch alles ok?
+    sal_uInt16  PolyMax=16380;// Maximale Anzahl von Polygonpunkten
+    long    x,y;
 
     bOk=CalcSpline(rSpln,Periodic,n,ax,ay,bx,by,cx,cy,dx,dy,tv);
     if (bOk) {
-        short  MinKoord=-32000; // zur Vermeidung
-        short  MaxKoord=32000;  // von Ueberlaeufen
-        double Step =10;
-        double  dt1,dt2,dt3; // Delta t, y, ^3
-        double  t;
-        sal_uInt16  PolyMax=16380;// Maximale Anzahl von Polygonpunkten
-        long    x,y;
+        Step =10;
 
         rPoly.SetSize(1);
         rPoly.SetPoint(Point(short(ax[0]),short(ay[0])),0); // erster Punkt
diff --git a/svtools/source/filter/sgvtext.cxx b/svtools/source/filter/sgvtext.cxx
index 1060c48..b87ec91 100644
--- a/svtools/source/filter/sgvtext.cxx
+++ b/svtools/source/filter/sgvtext.cxx
@@ -723,6 +723,7 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A
                   sal_uInt16& nChars, sal_uInt16 Rest,
                   short* Line, UCHAR* cLine)
 {
+    sal_uInt16       KernDist=0;       // Wert fuer Kerning
     sal_uInt16       ChrWidth;
     UCHAR        c;
     UCHAR        c1;
@@ -732,7 +733,6 @@ UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& A
 
     AbsEnd=(c==AbsatzEnd || c==TextEnd);
     if (AbsEnd==sal_False) {
-        sal_uInt16       KernDist=0;       // Wert fuer Kerning
         R.OutCh=ConvertTextChar(c); // von HardTrenn nach '-', ...
         R.Kapt=(R.Attrib.Schnitt & TextKaptBit) !=0 && UpcasePossible(R.OutCh);
         if (R.Kapt) R.OutCh=Upcase(R.OutCh);
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index ad14ed5..683e671 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -1648,9 +1648,9 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
                 for( pOldPos = pChar = (const sal_Char *) pMsgBuffer->GetData(); nBufSize--;
                      pChar++ )
                 {
+                    int status;
                     if( *pChar == '\r' || *pChar == '\n' )
                     {
-                        int status;
                         if( aDelim.compareTo(pOldPos, aDelim.getLength())
                             != -1 &&
                             aClose.compareTo(pOldPos, aClose.getLength())
commit dbd01385199225ff7011811b28a75e88b0d2f8c8
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu May 31 12:51:36 2012 +0100

    targetted minor cppcheck reversion
    
    Change-Id: I897739c4623123c32433d0e10fd301e073bb496e

diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index f475108..b1686c5 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -2036,13 +2036,13 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp,
                                            nTTyp );
                     {
                         SwNodeIndex aContentIdx = *pNdIdx;
-                        ++aContentIdx;
+                        aContentIdx++;
                         if ( aContentIdx.GetNode().IsTableNode() )
                         {
                             bool bContainsOnlyTables = true;
                             do {
                                 aContentIdx = *(aContentIdx.GetNode().EndOfSectionNode());
-                                ++aContentIdx;
+                                aContentIdx++;
                                 if ( !aContentIdx.GetNode().IsTableNode() &&
                                      aContentIdx.GetIndex() != pNdIdx->GetNode().EndOfSectionIndex() )
                                 {
diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx
index 64170c2..2118eff 100644
--- a/sw/source/ui/config/uinums.cxx
+++ b/sw/source/ui/config/uinums.cxx
@@ -331,6 +331,7 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
     CharSet eEncoding = osl_getThreadTextEncoding();
     {
         sal_uInt16 nUS;
+        short nShort;
         sal_Char cChar;
         sal_Bool bFlag;
         String sStr;
@@ -362,7 +363,6 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
         }
         else                // old start-value was a Byte
         {
-            short nShort;
             rStream >> nUS;         aFmt.SetStart( nUS );
             sStr = rStream.ReadUniOrByteString(eEncoding);
             aFmt.SetPrefix( sStr );
commit b1ca0f247280ca1b7f96fef8c89bc451c38d11af
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu May 31 12:47:35 2012 +0100

    targetted SAL_N_ELEMENTS reversion.
    
    Change-Id: I58636bc87bc17ff2b35621ad554bd05f5c1dab20

diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 8a0b39e..39ed8c6 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 1e0dcbe..e9713d0 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 b6abe7d..b4b62cf 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 a46bd00..d1e07de 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 ad9e350..dc84359 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 379ccf1..2129da3 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 6c8e8b7..e9f5dec 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 c2fb1fd..9c2e1b6 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 2ed3182..f1defb8 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 7e254d9..43d0bb5 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 c106409..5b622f6 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 38bc190..1929a60 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 4671989..753e655 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 5477dfd..d7cbb74 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 43df5df..9d210f8 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 209dd2d..ba9ab47 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)
commit 5feff80fd2943124568eba07c8cdc465ac201e5d
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu May 31 12:42:13 2012 +0100

    targetted minor size vs. empty reversion
    
    Change-Id: I35aef43b4dd023440509faaa8c73a0e5a45d37a7

diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx
index 522bc37..b5a0868 100644
--- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx
+++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx
@@ -903,7 +903,7 @@ namespace basegfx
 
             // first step: prepareForPolygonOperation and simple merge of non-overlapping
             // PolyPolygons for speedup; this is possible for the wanted OR-operation
-            if(!aInput.empty())
+            if(aInput.size())
             {
                 std::vector< basegfx::B2DPolyPolygon > aResult;
                 aResult.reserve(aInput.size());
@@ -912,7 +912,7 @@ namespace basegfx
                 {
                     const basegfx::B2DPolyPolygon aCandidate(prepareForPolygonOperation(aInput[a]));
 
-                    if(!aResult.empty())
+                    if(aResult.size())
                     {
                         const B2DRange aCandidateRange(aCandidate.getB2DRange());
                         bool bCouldMergeSimple(false);
commit 9bd64312c2662adc5016735a03f3844654d40d4f
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu May 31 12:38:05 2012 +0100

    targetted minor size vs. empty reversion
    
    Change-Id: Icf49ed7746a4325e626976ce376762804d0c82be

diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 15133ee..7aaa32d 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -765,7 +765,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
     }
 
     //transport seriesnames to the coordinatesystems if needed
-    if( !m_aSeriesPlotterList.empty() )
+    if( m_aSeriesPlotterList.size() )
     {
         uno::Sequence< rtl::OUString > aSeriesNames;
         bool bSeriesNamesInitialized = false;
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 25420ad..9fc7695 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -110,7 +110,7 @@ struct lcl_LessXOfPoint
     inline bool operator() ( const std::vector< double >& first,
                              const std::vector< double >& second )
     {
-        if( !first.empty() && !second.empty() )
+        if( first.size() > 0 && second.size() > 0 )
         {
             return first[0]<second[0];
         }
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 48d9502..df27367 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -353,7 +353,7 @@ void ScMyValidationsContainer::WriteMessage(ScXMLExport& rExport,
 
 void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport)
 {
-    if (!aValidationVec.empty())
+    if (aValidationVec.size())
     {
         SvXMLElementExport aElemVs(rExport, XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATIONS, true, true);
         ScMyValidationVec::iterator aItr(aValidationVec.begin());
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index 72155e6..e675651 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -523,7 +523,7 @@ void XMLTableStyleContext::FillPropertySet(
             sal_Int32 nNumFmt = GetNumberFormat();
             if (nNumFmt >= 0)
                 AddProperty(CTF_SC_NUMBERFORMAT, uno::makeAny(nNumFmt));
-            if (!bConditionalFormatCreated && (!aMaps.empty()))
+            if (!bConditionalFormatCreated && (aMaps.size() > 0))
             {
                 aConditionalFormat = rPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CONDXML)));
                 std::vector<ScXMLMapContent>::iterator aItr(aMaps.begin());
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 99a2308..572abbe 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -1163,7 +1163,7 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S
         vNames.push_back( aToken );
     } while ( nIndex >= 0 );
 
-    if ( vNames.empty() )
+    if ( !vNames.size() )
         vNames.push_back( sName );
 
     std::vector< rtl::OUString >::iterator it = vNames.begin();
commit a0bbb2a1af40e42d02f0f7567580475b3c39e50b
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu May 31 12:36:21 2012 +0100

    targetted SAL_N_ELEMENTS reversion.
    
    Change-Id: I181c5b5dd24836ff0398aa5ed03915c2c7c55183

diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 091d6e4..8ed1d7f 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 0b764d2..f89b7ee 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 3ab320c..5acc09e 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 54ca2f7..fa011ee 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 a6f3e73..ce354fd 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 81e8baf..eb07b34 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 541c921..8bbae74 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 0989ab5..09c9d33 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 1490f2a..1a4c458 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 13c0200..a4d708d 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 16126b1..bb49180 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 3fa25bf..1b9d039 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 856674e..f556773 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 cf12780..e16f45f 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 189cb19..6571549 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 99db7f3..a9fee27 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 0caddb2..7df8471 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 d05d890..4283d7e 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 8ec8420..9db7af8 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 4b300ba..94534b1 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 2a1dcd5..979697c 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 ce492da..5ea8e37 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 58f0038..3c19ad9 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 11a8098..54f02d6 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 1403440..007b7b1 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 baee01c..e3009ae 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 6433aa0..1887206 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 841bcfa..60a8263 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 4297cde..9211a90 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 4850a32..c58af20 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 ed2f871..cc54094 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 36dacbc..752fbf7 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 a6eb6aa..8a0b39e 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 49a01c5..bd9037b 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 3933353..fbeda28 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] ) )
         {
diff --git a/reportdesign/source/core/api/FixedLine.cxx b/reportdesign/source/core/api/FixedLine.cxx
index 4167db8..dee328a 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 4a3ed8a..aff7ff7 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 d138f55..95a2243 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 6dea31f..71d2a22 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 45e0611..202567b 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 6c6aba2..dd054af 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 8752284..2685b12 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 f61bd09..1be4ad8 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 ee2ebc1..91f122d 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 6078904..0a7c337 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 e197c66..3212681 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 e83b0b9..49c21d3 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 2d0b49f..1af5268 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 0080558..8866591 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 3d00aac..3822648 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 2286da7..b20c628 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 057d7dc..7563a46 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 cdddcf3..3e6aa10 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 54c6488..43a6910 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 8a8509c..45b4f1a 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]);
         }
     }


More information about the Libreoffice-commits mailing list