[Libreoffice-commits] .: basic/source

Takeshi Abe tabe at kemper.freedesktop.org
Tue Aug 14 18:42:49 PDT 2012


 basic/source/classes/image.cxx  |   22 ++++++++++------------
 basic/source/classes/sbxmod.cxx |    8 ++++----
 basic/source/inc/image.hxx      |   10 +++++-----
 3 files changed, 19 insertions(+), 21 deletions(-)

New commits:
commit dfe544c87b55cb6b7db4efe8a992868ad6e11339
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Wed Aug 15 09:44:54 2012 +0900

    sal_Bool to bool
    
    Change-Id: I784fb31bad1ff02987c24abbac04b38207a1f5cf

diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 7b31f6b..81c0910 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -38,7 +38,7 @@ SbiImage::SbiImage()
     nDimBase   = 0;
     bInit      =
     bError     = false;
-    bFirstInit = sal_True;
+    bFirstInit = true;
     eCharSet   = osl_getThreadTextEncoding();
 }
 
@@ -72,9 +72,9 @@ void SbiImage::Clear()
 *
 **************************************************************************/
 
-sal_Bool SbiGood( SvStream& r )
+bool SbiGood( SvStream& r )
 {
-    return sal_Bool( !r.IsEof() && r.GetError() == SVSTREAM_OK );
+    return !r.IsEof() && r.GetError() == SVSTREAM_OK;
 }
 
 // Open Record
@@ -100,7 +100,7 @@ void SbiCloseRecord( SvStream& r, sal_uIntPtr nOff )
 *
 **************************************************************************/
 
-sal_Bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
+bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
 {
 
     sal_uInt16 nSign, nCount;
@@ -226,10 +226,10 @@ done:
     r.Seek( nLast );
     if( !SbiGood( r ) )
         bError = true;
-    return sal_Bool( !bError );
+    return !bError;
 }
 
-sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
+bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
 {
     bool bLegacy = ( nVer < B_EXT_IMG_VERSION );
 
@@ -240,7 +240,7 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
         SbiImage aEmptyImg;
         aEmptyImg.aName = aName;
         aEmptyImg.Save( r, B_LEGACYVERSION );
-        return sal_True;
+        return true;
     }
     // First of all the header
     sal_uIntPtr nStart = SbiOpenRecord( r, B_MODULE, 1 );
@@ -348,7 +348,7 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
     SbiCloseRecord( r, nStart );
     if( !SbiGood( r ) )
         bError = true;
-    return sal_Bool( !bError );
+    return !bError;
 }
 
 /**************************************************************************
@@ -498,11 +498,9 @@ void  SbiImage::ReleaseLegacyBuffer()
     nLegacyCodeSize = 0;
 }
 
-sal_Bool SbiImage::ExceedsLegacyLimits()
+bool SbiImage::ExceedsLegacyLimits()
 {
-    if ( ( nStringSize > 0xFF00L ) || ( CalcLegacyOffset( nCodeSize ) > 0xFF00L ) )
-        return sal_True;
-    return sal_False;
+    return ( nStringSize > 0xFF00L ) || ( CalcLegacyOffset( nCodeSize ) > 0xFF00L );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index a7b401b..61b7f0d 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1314,8 +1314,8 @@ void SbModule::RunInit()
         GetSbData()->pInst->pRun = pRt->pNext;
         delete pRt;
         GetSbData()->pMod = pOldMod;
-        pImage->bInit = sal_True;
-        pImage->bFirstInit = sal_False;
+        pImage->bInit = true;
+        pImage->bFirstInit = false;
 
         // RunInit is not activ anymore
         GetSbData()->bRunInit = sal_False;
@@ -1714,7 +1714,7 @@ sal_Bool SbModule::LoadData( SvStream& rStrm, sal_uInt16 nVer )
 
 sal_Bool SbModule::StoreData( SvStream& rStrm ) const
 {
-    sal_Bool bFixup = ( pImage && !pImage->ExceedsLegacyLimits() );
+    bool bFixup = ( pImage && !pImage->ExceedsLegacyLimits() );
     if ( bFixup )
         fixUpMethodStart( true );
     sal_Bool bRet = SbxObject::StoreData( rStrm );
@@ -1815,7 +1815,7 @@ sal_Bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer )
     sal_Bool bRet = Compile();
     if( bRet )
     {
-        sal_Bool bFixup = ( !nVer && !pImage->ExceedsLegacyLimits() );// save in old image format, fix up method starts
+        bool bFixup = ( !nVer && !pImage->ExceedsLegacyLimits() );// save in old image format, fix up method starts
 
         if ( bFixup ) // save in old image format, fix up method starts
             fixUpMethodStart( true );
diff --git a/basic/source/inc/image.hxx b/basic/source/inc/image.hxx
index f62ac25..96474ad 100644
--- a/basic/source/inc/image.hxx
+++ b/basic/source/inc/image.hxx
@@ -58,16 +58,16 @@ public:
     String aName;                   // macro name
     ::rtl::OUString aOUSource;      // source code
     String aComment;
-    sal_Bool   bInit;
-    sal_Bool   bFirstInit;
+    bool   bInit;
+    bool   bFirstInit;
 
     SbiImage();
    ~SbiImage();
     void Clear();
-    sal_Bool Load( SvStream&, sal_uInt32& nVer );
+    bool Load( SvStream&, sal_uInt32& nVer );
                             // nVer is set to version
                             // of image
-    sal_Bool Save( SvStream&, sal_uInt32 = B_CURVERSION );
+    bool Save( SvStream&, sal_uInt32 = B_CURVERSION );
     bool IsError()                  { return bError;    }
 
     const char* GetCode() const     { return pCode;     }
@@ -84,7 +84,7 @@ public:
     sal_uInt16      CalcLegacyOffset( sal_Int32 nOffset );
     sal_uInt32      CalcNewOffset( sal_Int16 nOffset );
     void        ReleaseLegacyBuffer();
-    sal_Bool        ExceedsLegacyLimits();
+    bool        ExceedsLegacyLimits();
 
 };
 


More information about the Libreoffice-commits mailing list