Kaydet (Commit) dfe544c8 authored tarafından Takeshi Abe's avatar Takeshi Abe

sal_Bool to bool

Change-Id: I784fb31bad1ff02987c24abbac04b38207a1f5cf
üst 065b5915
...@@ -38,7 +38,7 @@ SbiImage::SbiImage() ...@@ -38,7 +38,7 @@ SbiImage::SbiImage()
nDimBase = 0; nDimBase = 0;
bInit = bInit =
bError = false; bError = false;
bFirstInit = sal_True; bFirstInit = true;
eCharSet = osl_getThreadTextEncoding(); eCharSet = osl_getThreadTextEncoding();
} }
...@@ -72,9 +72,9 @@ void SbiImage::Clear() ...@@ -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 // Open Record
...@@ -100,7 +100,7 @@ void SbiCloseRecord( SvStream& r, sal_uIntPtr nOff ) ...@@ -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; sal_uInt16 nSign, nCount;
...@@ -226,10 +226,10 @@ done: ...@@ -226,10 +226,10 @@ done:
r.Seek( nLast ); r.Seek( nLast );
if( !SbiGood( r ) ) if( !SbiGood( r ) )
bError = true; 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 ); bool bLegacy = ( nVer < B_EXT_IMG_VERSION );
...@@ -240,7 +240,7 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) ...@@ -240,7 +240,7 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
SbiImage aEmptyImg; SbiImage aEmptyImg;
aEmptyImg.aName = aName; aEmptyImg.aName = aName;
aEmptyImg.Save( r, B_LEGACYVERSION ); aEmptyImg.Save( r, B_LEGACYVERSION );
return sal_True; return true;
} }
// First of all the header // First of all the header
sal_uIntPtr nStart = SbiOpenRecord( r, B_MODULE, 1 ); sal_uIntPtr nStart = SbiOpenRecord( r, B_MODULE, 1 );
...@@ -348,7 +348,7 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) ...@@ -348,7 +348,7 @@ sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
SbiCloseRecord( r, nStart ); SbiCloseRecord( r, nStart );
if( !SbiGood( r ) ) if( !SbiGood( r ) )
bError = true; bError = true;
return sal_Bool( !bError ); return !bError;
} }
/************************************************************************** /**************************************************************************
...@@ -498,11 +498,9 @@ void SbiImage::ReleaseLegacyBuffer() ...@@ -498,11 +498,9 @@ void SbiImage::ReleaseLegacyBuffer()
nLegacyCodeSize = 0; nLegacyCodeSize = 0;
} }
sal_Bool SbiImage::ExceedsLegacyLimits() bool SbiImage::ExceedsLegacyLimits()
{ {
if ( ( nStringSize > 0xFF00L ) || ( CalcLegacyOffset( nCodeSize ) > 0xFF00L ) ) return ( nStringSize > 0xFF00L ) || ( CalcLegacyOffset( nCodeSize ) > 0xFF00L );
return sal_True;
return sal_False;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -1314,8 +1314,8 @@ void SbModule::RunInit() ...@@ -1314,8 +1314,8 @@ void SbModule::RunInit()
GetSbData()->pInst->pRun = pRt->pNext; GetSbData()->pInst->pRun = pRt->pNext;
delete pRt; delete pRt;
GetSbData()->pMod = pOldMod; GetSbData()->pMod = pOldMod;
pImage->bInit = sal_True; pImage->bInit = true;
pImage->bFirstInit = sal_False; pImage->bFirstInit = false;
// RunInit is not activ anymore // RunInit is not activ anymore
GetSbData()->bRunInit = sal_False; GetSbData()->bRunInit = sal_False;
...@@ -1714,7 +1714,7 @@ sal_Bool SbModule::LoadData( SvStream& rStrm, sal_uInt16 nVer ) ...@@ -1714,7 +1714,7 @@ sal_Bool SbModule::LoadData( SvStream& rStrm, sal_uInt16 nVer )
sal_Bool SbModule::StoreData( SvStream& rStrm ) const sal_Bool SbModule::StoreData( SvStream& rStrm ) const
{ {
sal_Bool bFixup = ( pImage && !pImage->ExceedsLegacyLimits() ); bool bFixup = ( pImage && !pImage->ExceedsLegacyLimits() );
if ( bFixup ) if ( bFixup )
fixUpMethodStart( true ); fixUpMethodStart( true );
sal_Bool bRet = SbxObject::StoreData( rStrm ); sal_Bool bRet = SbxObject::StoreData( rStrm );
...@@ -1815,7 +1815,7 @@ sal_Bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer ) ...@@ -1815,7 +1815,7 @@ sal_Bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer )
sal_Bool bRet = Compile(); sal_Bool bRet = Compile();
if( bRet ) 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 if ( bFixup ) // save in old image format, fix up method starts
fixUpMethodStart( true ); fixUpMethodStart( true );
......
...@@ -58,16 +58,16 @@ public: ...@@ -58,16 +58,16 @@ public:
String aName; // macro name String aName; // macro name
::rtl::OUString aOUSource; // source code ::rtl::OUString aOUSource; // source code
String aComment; String aComment;
sal_Bool bInit; bool bInit;
sal_Bool bFirstInit; bool bFirstInit;
SbiImage(); SbiImage();
~SbiImage(); ~SbiImage();
void Clear(); void Clear();
sal_Bool Load( SvStream&, sal_uInt32& nVer ); bool Load( SvStream&, sal_uInt32& nVer );
// nVer is set to version // nVer is set to version
// of image // of image
sal_Bool Save( SvStream&, sal_uInt32 = B_CURVERSION ); bool Save( SvStream&, sal_uInt32 = B_CURVERSION );
bool IsError() { return bError; } bool IsError() { return bError; }
const char* GetCode() const { return pCode; } const char* GetCode() const { return pCode; }
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
sal_uInt16 CalcLegacyOffset( sal_Int32 nOffset ); sal_uInt16 CalcLegacyOffset( sal_Int32 nOffset );
sal_uInt32 CalcNewOffset( sal_Int16 nOffset ); sal_uInt32 CalcNewOffset( sal_Int16 nOffset );
void ReleaseLegacyBuffer(); void ReleaseLegacyBuffer();
sal_Bool ExceedsLegacyLimits(); bool ExceedsLegacyLimits();
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment