[Libreoffice-commits] core.git: 2 commits - vcl/source

Takeshi Abe tabe at fixedpoint.jp
Mon Jun 10 17:48:18 PDT 2013


 vcl/source/gdi/bitmap.cxx   |   10 +++++-----
 vcl/source/gdi/bitmapex.cxx |    2 +-
 vcl/source/gdi/bmpacc3.cxx  |    4 ++--
 vcl/source/gdi/cvtsvm.cxx   |    2 +-
 vcl/source/gdi/gdimtf.cxx   |    4 ++--
 vcl/source/gdi/gfxlink.cxx  |    6 +++---
 vcl/source/gdi/graph.cxx    |    2 +-
 vcl/source/gdi/impvect.cxx  |   26 +++++++++++++-------------
 vcl/source/gdi/metaact.cxx  |    4 ++--
 vcl/source/gdi/octree.cxx   |    2 +-
 vcl/source/gdi/outdev.cxx   |    4 ++--
 vcl/source/gdi/outdev3.cxx  |   42 +++++++++++++++++++++---------------------
 12 files changed, 54 insertions(+), 54 deletions(-)

New commits:
commit dbf87e23f96489d9609e3cfcc0e6a2c31d7a14bf
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Tue Jun 11 09:45:00 2013 +0900

    mark as const
    
    Change-Id: I7f3d231d9f82db663a6a0977fa3f250af9dc8991

diff --git a/vcl/source/gdi/octree.cxx b/vcl/source/gdi/octree.cxx
index 93fb8c5..671a091 100644
--- a/vcl/source/gdi/octree.cxx
+++ b/vcl/source/gdi/octree.cxx
@@ -29,7 +29,7 @@
 // - pMask -
 // ---------
 
-static sal_uInt8 pImplMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
+static const sal_uInt8 pImplMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
 
 // -------------
 // - NodeCache -
commit 121ea27f55584ece5c18fcb12fe85a63cd69b349
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Tue Jun 11 09:42:00 2013 +0900

    sal_Bool to bool
    
    Change-Id: I5ccddcab097e820d043a41d8fbe3f900fc1079e5

diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 0853cb1..3520159 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
+#include <algorithm>
 #include <rtl/crc.h>
 #include <tools/stream.hxx>
 #include <tools/poly.hxx>
@@ -1355,14 +1355,14 @@ sal_Bool Bitmap::Replace( const Bitmap& rMask, const Color& rReplaceColor )
                 }
                 else
                 {
-                    sal_Bool* pFlags = new sal_Bool[ nMaxColors ];
+                    bool* pFlags = new bool[ nMaxColors ];
 
-                    // Set all entries to 0
-                    memset( pFlags, 0, nMaxColors );
+                    // Set all entries to false
+                    std::fill( pFlags, pFlags+nMaxColors, false );
 
                     for( long nY = 0L; nY < nHeight; nY++ )
                         for( long nX = 0L; nX < nWidth; nX++ )
-                            pFlags[ pAcc->GetPixelIndex( nY, nX ) ] = sal_True;
+                            pFlags[ pAcc->GetPixelIndex( nY, nX ) ] = true;
 
                     for( sal_uInt16 i = 0UL; i < nMaxColors; i++ )
                     {
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 61edab7..8e769c1 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -405,7 +405,7 @@ sal_Bool BitmapEx::Rotate( long nAngle10, const Color& rFillColor )
 
     if( !!aBitmap )
     {
-        const sal_Bool bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor );
+        const bool bTransRotate = ( Color( COL_TRANSPARENT ) == rFillColor );
 
         if( bTransRotate )
         {
diff --git a/vcl/source/gdi/bmpacc3.cxx b/vcl/source/gdi/bmpacc3.cxx
index 49d971c..791a75d 100644
--- a/vcl/source/gdi/bmpacc3.cxx
+++ b/vcl/source/gdi/bmpacc3.cxx
@@ -143,7 +143,7 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
                 const long  nDYX = ( nDY - nDX ) << 1;
                 const long  nDY2 = nDY << 1;
                 long        nD = nDY2 - nDX;
-                sal_Bool        bPos = nY1 < nY2;
+                bool        bPos = nY1 < nY2;
 
                 for ( nX = nX1, nY = nY1; nX <= nX2; nX++ )
                 {
@@ -182,7 +182,7 @@ void BitmapWriteAccess::DrawLine( const Point& rStart, const Point& rEnd )
                 const long  nDYX = ( nDX - nDY ) << 1;
                 const long  nDY2 = nDX << 1;
                 long        nD = nDY2 - nDY;
-                sal_Bool        bPos = nX1 < nX2;
+                bool        bPos = nX1 < nX2;
 
                 for ( nX = nX1, nY = nY1; nY <= nY2; nY++ )
                 {
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 63134b4..f7a8c49 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -471,7 +471,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
     ::std::stack< LineInfo* > aLIStack;
     VirtualDevice       aFontVDev;
     rtl_TextEncoding    eActualCharSet = osl_getThreadTextEncoding();
-    sal_Bool                bFatLine = sal_False;
+    bool                bFatLine = false;
 
     // TODO: fix reindentation below if you can accept being blamed by the SCM
         MapMode     aMapMode;
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 019e18e..1a9c8e9 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -1236,7 +1236,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
                     }
                     else
                     {
-                        sal_Bool bPathStroke = (pCommentAct->GetComment() == "XPATHSTROKE_SEQ_BEGIN");
+                        bool bPathStroke = (pCommentAct->GetComment() == "XPATHSTROKE_SEQ_BEGIN");
                         if ( bPathStroke || pCommentAct->GetComment() == "XPATHFILL_SEQ_BEGIN" )
                         {
                             if ( pCommentAct->GetDataSize() )
@@ -2255,7 +2255,7 @@ void GDIMetaFile::Adjust( short nLuminancePercent, short nContrastPercent,
 
         // calculate gamma value
         fGamma = ( fGamma <= 0.0 || fGamma > 10.0 ) ? 1.0 : ( 1.0 / fGamma );
-        const sal_Bool bGamma = ( fGamma != 1.0 );
+        const bool bGamma = ( fGamma != 1.0 );
 
         // create mapping table
         for( long nX = 0L; nX < 256L; nX++ )
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 04fc666..e9de2a6 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -344,7 +344,7 @@ ImpSwap::ImpSwap( sal_uInt8* pData, sal_uLong nDataSize ) :
             if( pOStm )
             {
                 pOStm->Write( pData, mnDataSize );
-                sal_Bool bError = ( ERRCODE_NONE != pOStm->GetError() );
+                bool bError = ( ERRCODE_NONE != pOStm->GetError() );
                 delete pOStm;
 
                 if( bError )
@@ -374,11 +374,11 @@ sal_uInt8* ImpSwap::GetData() const
         {
             pData = new sal_uInt8[ mnDataSize ];
             pIStm->Read( pData, mnDataSize );
-            sal_Bool bError = ( ERRCODE_NONE != pIStm->GetError() );
+            bool bError = ( ERRCODE_NONE != pIStm->GetError() );
             sal_Size nActReadSize = pIStm->Tell();
             if (nActReadSize != mnDataSize)
             {
-                bError = sal_True;
+                bError = true;
             }
             delete pIStm;
 
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 464cb62..5771938 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -40,7 +40,7 @@ static void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
     sal_uInt16      nPixelWidth = nPixel;
     Point       aPoint( rDestPt.X() + nPixelWidth, rDestPt.Y() + nPixelWidth );
     Size        aSize( rDestSize.Width() - ( nPixelWidth << 1 ), rDestSize.Height() - ( nPixelWidth << 1 ) );
-    sal_Bool        bFilled = ( pBitmap != NULL || pBitmapEx != NULL || pFont != NULL );
+    bool        bFilled = ( pBitmap != NULL || pBitmapEx != NULL || pFont != NULL );
     Rectangle   aBorderRect( aPoint, aSize );
 
     pOutDev->Push();
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index c69664b..de4a9f9 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -209,9 +209,9 @@ public:
     inline void     Set( long nY, long nX, sal_uInt8 cVal );
     inline sal_uInt8        Get( long nY, long nX ) const;
 
-    inline sal_Bool     IsFree( long nY, long nX ) const;
-    inline sal_Bool     IsCont( long nY, long nX ) const;
-    inline sal_Bool     IsDone( long nY, long nX ) const;
+    inline bool     IsFree( long nY, long nX ) const;
+    inline bool     IsCont( long nY, long nX ) const;
+    inline bool     IsDone( long nY, long nX ) const;
 
 };
 
@@ -247,17 +247,17 @@ inline sal_uInt8    ImplVectMap::Get( long nY, long nX ) const
     return sal::static_int_cast<sal_uInt8>( ( ( mpScan[ nY ][ nX >> 2 ] ) >> ( 6 - ( ( nX & 3 ) << 1 ) ) ) & 3 );
 }
 
-inline sal_Bool ImplVectMap::IsFree( long nY, long nX ) const
+inline bool ImplVectMap::IsFree( long nY, long nX ) const
 {
     return( VECT_FREE_INDEX == Get( nY, nX ) );
 }
 
-inline sal_Bool ImplVectMap::IsCont( long nY, long nX ) const
+inline bool ImplVectMap::IsCont( long nY, long nX ) const
 {
     return( VECT_CONT_INDEX == Get( nY, nX ) );
 }
 
-inline sal_Bool ImplVectMap::IsDone( long nY, long nX ) const
+inline bool ImplVectMap::IsDone( long nY, long nX ) const
 {
     return( VECT_DONE_INDEX == Get( nY, nX ) );
 }
@@ -356,7 +356,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
                 const ChainMove&        rMove = aImplMove[ cMove ];
                 const ChainMove&        rMoveInner = aImplMoveInner[ cMove ];
 //              Point&                  rPt = aArr[ nPolyPos ];
-                sal_Bool                    bDone = sal_True;
+                bool                    bDone = true;
 
                 nLastX += rMove.nDX;
                 nLastY += rMove.nDY;
@@ -414,7 +414,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
                         aArr[ nPolyPos++ ].Y() = nLastY - 1;
                     }
                     else
-                        bDone = sal_False;
+                        bDone = false;
                 }
                 else if( cMove == 7 && cNextMove == 0 )
                 {
@@ -433,7 +433,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
                     aArr[ nPolyPos++ ].Y() = nLastY;
                 }
                 else
-                    bDone = sal_False;
+                    bDone = false;
 
                 if( !bDone )
                 {
@@ -463,7 +463,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
                 const ChainMove&        rMove = aImplMove[ cMove ];
                 const ChainMove&        rMoveOuter = aImplMoveOuter[ cMove ];
 //              Point&                  rPt = aArr[ nPolyPos ];
-                sal_Bool                    bDone = sal_True;
+                bool                    bDone = true;
 
                 nLastX += rMove.nDX;
                 nLastY += rMove.nDY;
@@ -521,7 +521,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
                         aArr[ nPolyPos++ ].Y() = nLastY - 1;
                     }
                     else
-                        bDone = sal_False;
+                        bDone = false;
                 }
                 else if( cMove == 7 && cNextMove == 3 )
                 {
@@ -540,7 +540,7 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
                     aArr[ nPolyPos++ ].Y() = nLastY + 1;
                 }
                 else
-                    bDone = sal_False;
+                    bDone = false;
 
                 if( !bDone )
                 {
@@ -970,7 +970,7 @@ void ImplVectorizer::ImplCalculate( ImplVectMap* pMap, PolyPolygon& rPolyPoly, s
     for( long nY = 0L; nY < nHeight; nY++ )
     {
         long    nX = 0L;
-        sal_Bool    bInner = sal_True;
+        bool    bInner = true;
 
         while( nX < nWidth )
         {
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 417c9d6..6b684fb 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -4014,7 +4014,7 @@ void MetaCommentAction::Move( long nXMove, long nYMove )
     {
         if ( mnDataSize && mpData )
         {
-            sal_Bool bPathStroke = (maComment == "XPATHSTROKE_SEQ_BEGIN");
+            bool bPathStroke = (maComment == "XPATHSTROKE_SEQ_BEGIN");
             if ( bPathStroke || maComment == "XPATHFILL_SEQ_BEGIN" )
             {
                 SvMemoryStream  aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
@@ -4057,7 +4057,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
     {
         if ( mnDataSize && mpData )
         {
-            sal_Bool bPathStroke = (maComment == "XPATHSTROKE_SEQ_BEGIN");
+            bool bPathStroke = (maComment == "XPATHSTROKE_SEQ_BEGIN");
             if ( bPathStroke || maComment == "XPATHFILL_SEQ_BEGIN" )
             {
                 SvMemoryStream  aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 4fba08f..65119b6 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -244,7 +244,7 @@ void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPo
     PCONSTSALPOINT*     pPointAryAry;
     const sal_uInt8**       pFlagAryAry;
     sal_uInt16              i = 0, j = 0, last = 0;
-    sal_Bool                bHaveBezier = sal_False;
+    bool                bHaveBezier = false;
     if ( nPoly > OUTDEV_POLYPOLY_STACKBUF )
     {
         pPointAry       = new sal_uInt32[nPoly];
@@ -269,7 +269,7 @@ void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPo
             last            = i;
 
             if( pFlagAryAry[j] )
-                bHaveBezier = sal_True;
+                bHaveBezier = true;
 
             ++j;
         }
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 10728e6..8338d9f 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -3414,7 +3414,7 @@ static void ImplDrawWavePixel( long nOriginX, long nOriginY,
                                short nOrientation,
                                SalGraphics* pGraphics,
                                OutputDevice* pOutDev,
-                               sal_Bool bDrawPixAsRect,
+                               bool bDrawPixAsRect,
 
                                long nPixWidth, long nPixHeight )
 {
@@ -3471,7 +3471,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
         long    i;
         long    nPixWidth;
         long    nPixHeight;
-        sal_Bool    bDrawPixAsRect;
+        bool    bDrawPixAsRect;
         // On printers that ouput pixel via DrawRect()
         if ( (GetOutDevType() == OUTDEV_PRINTER) || (nLineWidth > 1) )
         {
@@ -3482,7 +3482,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
             }
             mpGraphics->SetFillColor( ImplColorToSal( rColor ) );
             mbInitFillColor = sal_True;
-            bDrawPixAsRect  = sal_True;
+            bDrawPixAsRect  = true;
             nPixWidth       = nLineWidth;
             nPixHeight      = ((nLineWidth*mnDPIX)+(mnDPIY/2))/mnDPIY;
         }
@@ -3492,7 +3492,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
             mbInitLineColor = sal_True;
             nPixWidth       = 1;
             nPixHeight      = 1;
-            bDrawPixAsRect  = sal_False;
+            bDrawPixAsRect  = false;
         }
 
         if ( !nDiffY )
@@ -4013,9 +4013,9 @@ void OutputDevice::ImplDrawTextLine( long nX, long nY,
     Color           aStrikeoutColor = GetTextColor();
     Color           aUnderlineColor = GetTextLineColor();
     Color           aOverlineColor  = GetOverlineColor();
-    sal_Bool            bStrikeoutDone = sal_False;
-    sal_Bool            bUnderlineDone = sal_False;
-    sal_Bool            bOverlineDone  = sal_False;
+    bool            bStrikeoutDone = false;
+    bool            bUnderlineDone = false;
+    bool            bOverlineDone  = false;
 
     if ( IsRTLEnabled() )
     {
@@ -4038,7 +4038,7 @@ void OutputDevice::ImplDrawTextLine( long nX, long nY,
          (eUnderline == UNDERLINE_BOLDWAVE) )
     {
         ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eUnderline, aUnderlineColor, bUnderlineAbove );
-        bUnderlineDone = sal_True;
+        bUnderlineDone = true;
     }
     if ( (eOverline == UNDERLINE_SMALLWAVE) ||
          (eOverline == UNDERLINE_WAVE) ||
@@ -4046,14 +4046,14 @@ void OutputDevice::ImplDrawTextLine( long nX, long nY,
          (eOverline == UNDERLINE_BOLDWAVE) )
     {
         ImplDrawWaveTextLine( nX, nY, nDistX, 0, nWidth, eOverline, aOverlineColor, sal_True );
-        bOverlineDone = sal_True;
+        bOverlineDone = true;
     }
 
     if ( (eStrikeout == STRIKEOUT_SLASH) ||
          (eStrikeout == STRIKEOUT_X) )
     {
         ImplDrawStrikeoutChar( nX, nY, nDistX, 0, nWidth, eStrikeout, aStrikeoutColor );
-        bStrikeoutDone = sal_True;
+        bStrikeoutDone = true;
     }
 
     if ( !bUnderlineDone )
@@ -6171,7 +6171,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
 {
     Color aOldTextColor;
     Color aOldTextFillColor;
-    sal_Bool  bRestoreFillColor = false;
+    bool  bRestoreFillColor = false;
     if ( (nStyle & TEXT_DRAW_DISABLE) && ! pVector )
     {
         sal_Bool  bHighContrastBlack = sal_False;
@@ -6195,7 +6195,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
         aOldTextColor = rTargetDevice.GetTextColor();
         if ( rTargetDevice.IsTextFillColor() )
         {
-            bRestoreFillColor = sal_True;
+            bRestoreFillColor = true;
             aOldTextFillColor = rTargetDevice.GetTextFillColor();
         }
         if( bHighContrastBlack )
@@ -6556,7 +6556,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
         }
         if ( pInfo )
         {
-            sal_Bool bMaxWidth = nMaxWidth == 0;
+            bool bMaxWidth = nMaxWidth == 0;
             pInfo->mnMaxWidth = 0;
             for ( i = 0; i < nLines; i++ )
             {
@@ -6624,16 +6624,16 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
     return aRect;
 }
 
-static sal_Bool ImplIsCharIn( sal_Unicode c, const sal_Char* pStr )
+static bool ImplIsCharIn( sal_Unicode c, const sal_Char* pStr )
 {
     while ( *pStr )
     {
         if ( *pStr == c )
-            return sal_True;
+            return true;
         pStr++;
     }
 
-    return sal_False;
+    return false;
 }
 
 OUString OutputDevice::GetEllipsisString( const OUString& rOrigStr, long nMaxWidth,
@@ -6812,7 +6812,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
                     --nLen;
                 DBG_ASSERT( nMnemonicPos < (nIndex+nLen), "Mnemonic underline marker after last character" );
             }
-            sal_Bool bInvalidPos = sal_False;
+            bool bInvalidPos = false;
 
             if( nMnemonicPos >= nLen )
             {
@@ -6820,7 +6820,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
                 // may occur in BiDi-Strings: the '~' is sometimes found behind the last char
                 // due to some strange BiDi text editors
                 // -> place the underline behind the string to indicate a failure
-                bInvalidPos = sal_True;
+                bInvalidPos = true;
                 nMnemonicPos = nLen-1;
             }
 
@@ -6845,7 +6845,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
     {
         Color aOldTextColor;
         Color aOldTextFillColor;
-        sal_Bool  bRestoreFillColor;
+        bool  bRestoreFillColor;
         sal_Bool  bHighContrastBlack = sal_False;
         sal_Bool  bHighContrastWhite = sal_False;
         const StyleSettings& rStyleSettings( GetSettings().GetStyleSettings() );
@@ -6863,11 +6863,11 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
         aOldTextColor = GetTextColor();
         if ( IsTextFillColor() )
         {
-            bRestoreFillColor = sal_True;
+            bRestoreFillColor = true;
             aOldTextFillColor = GetTextFillColor();
         }
         else
-            bRestoreFillColor = sal_False;
+            bRestoreFillColor = false;
 
         if( bHighContrastBlack )
             SetTextColor( COL_GREEN );


More information about the Libreoffice-commits mailing list