Kaydet (Commit) 3f390be5 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

sal_Bool to bool.

Change-Id: I6ad0385041618ebff879ec8533c13ef0ddbe239c
üst a6b459c8
...@@ -47,15 +47,15 @@ class SVT_DLLPUBLIC EmbeddedObjectRef ...@@ -47,15 +47,15 @@ class SVT_DLLPUBLIC EmbeddedObjectRef
{ {
EmbeddedObjectRef_Impl* mpImpl; EmbeddedObjectRef_Impl* mpImpl;
SVT_DLLPRIVATE SvStream* GetGraphicStream( sal_Bool bUpdate ) const; SVT_DLLPRIVATE SvStream* GetGraphicStream( bool bUpdate ) const;
SVT_DLLPRIVATE void GetReplacement( sal_Bool bUpdate ); SVT_DLLPRIVATE void GetReplacement( bool bUpdate );
EmbeddedObjectRef& operator = ( const EmbeddedObjectRef& ); EmbeddedObjectRef& operator = ( const EmbeddedObjectRef& );
public: public:
static void DrawPaintReplacement( const Rectangle &rRect, const OUString &rText, OutputDevice *pOut ); static void DrawPaintReplacement( const Rectangle &rRect, const OUString &rText, OutputDevice *pOut );
static void DrawShading( const Rectangle &rRect, OutputDevice *pOut ); static void DrawShading( const Rectangle &rRect, OutputDevice *pOut );
static sal_Bool TryRunningState( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& ); static bool TryRunningState( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& );
static void SetGraphicToContainer( const Graphic& rGraphic, static void SetGraphicToContainer( const Graphic& rGraphic,
comphelper::EmbeddedObjectContainer& aContainer, comphelper::EmbeddedObjectContainer& aContainer,
const ::rtl::OUString& aName, const ::rtl::OUString& aName,
...@@ -101,12 +101,12 @@ public: ...@@ -101,12 +101,12 @@ public:
void UpdateReplacement(); void UpdateReplacement();
void UpdateReplacementOnDemand(); void UpdateReplacementOnDemand();
void Lock( sal_Bool bLock = sal_True ); void Lock( bool bLock = true );
sal_Bool IsLocked() const;
void Clear(); void Clear();
bool is() const; bool is() const;
sal_Bool IsChart() const; bool IsLocked() const;
bool IsChart() const;
// #i104867# // #i104867#
// Provides a graphic version number for the fetchable Graphic during this object's lifetime. Internally, // Provides a graphic version number for the fetchable Graphic during this object's lifetime. Internally,
......
...@@ -48,8 +48,7 @@ ...@@ -48,8 +48,7 @@
using namespace com::sun::star; using namespace com::sun::star;
namespace svt namespace svt {
{
class EmbedEventListener_Impl : public ::cppu::WeakImplHelper4 < embed::XStateChangeListener, class EmbedEventListener_Impl : public ::cppu::WeakImplHelper4 < embed::XStateChangeListener,
document::XEventListener, document::XEventListener,
...@@ -339,7 +338,7 @@ void EmbeddedObjectRef::Clear() ...@@ -339,7 +338,7 @@ void EmbeddedObjectRef::Clear()
try try
{ {
mpImpl->mxObj->changeState(embed::EmbedStates::LOADED); mpImpl->mxObj->changeState(embed::EmbedStates::LOADED);
xClose->close( sal_True ); xClose->close( true );
} }
catch (const util::CloseVetoException&) catch (const util::CloseVetoException&)
{ {
...@@ -360,12 +359,12 @@ void EmbeddedObjectRef::Clear() ...@@ -360,12 +359,12 @@ void EmbeddedObjectRef::Clear()
} }
mpImpl->mxObj = NULL; mpImpl->mxObj = NULL;
mpImpl->bNeedUpdate = sal_False; mpImpl->bNeedUpdate = false;
} }
mpImpl->pContainer = 0; mpImpl->pContainer = 0;
mpImpl->bIsLocked = sal_False; mpImpl->bIsLocked = false;
mpImpl->bNeedUpdate = sal_False; mpImpl->bNeedUpdate = false;
} }
bool EmbeddedObjectRef::is() const bool EmbeddedObjectRef::is() const
...@@ -397,17 +396,17 @@ void EmbeddedObjectRef::SetViewAspect( sal_Int64 nAspect ) ...@@ -397,17 +396,17 @@ void EmbeddedObjectRef::SetViewAspect( sal_Int64 nAspect )
mpImpl->nViewAspect = nAspect; mpImpl->nViewAspect = nAspect;
} }
void EmbeddedObjectRef::Lock( sal_Bool bLock ) void EmbeddedObjectRef::Lock( bool bLock )
{ {
mpImpl->bIsLocked = bLock; mpImpl->bIsLocked = bLock;
} }
sal_Bool EmbeddedObjectRef::IsLocked() const bool EmbeddedObjectRef::IsLocked() const
{ {
return mpImpl->bIsLocked; return mpImpl->bIsLocked;
} }
void EmbeddedObjectRef::GetReplacement( sal_Bool bUpdate ) void EmbeddedObjectRef::GetReplacement( bool bUpdate )
{ {
if ( bUpdate ) if ( bUpdate )
{ {
...@@ -442,9 +441,9 @@ Graphic* EmbeddedObjectRef::GetGraphic( ::rtl::OUString* pMediaType ) const ...@@ -442,9 +441,9 @@ Graphic* EmbeddedObjectRef::GetGraphic( ::rtl::OUString* pMediaType ) const
{ {
if ( mpImpl->bNeedUpdate ) if ( mpImpl->bNeedUpdate )
// bNeedUpdate will be set to false while retrieving new replacement // bNeedUpdate will be set to false while retrieving new replacement
const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_True ); const_cast < EmbeddedObjectRef* >(this)->GetReplacement( true );
else if ( !mpImpl->pGraphic ) else if ( !mpImpl->pGraphic )
const_cast < EmbeddedObjectRef* >(this)->GetReplacement( sal_False ); const_cast < EmbeddedObjectRef* >(this)->GetReplacement( false );
if ( mpImpl->pGraphic && pMediaType ) if ( mpImpl->pGraphic && pMediaType )
*pMediaType = mpImpl->aMediaType; *pMediaType = mpImpl->aMediaType;
...@@ -538,7 +537,7 @@ void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream ...@@ -538,7 +537,7 @@ void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream
delete pGraphicStream; delete pGraphicStream;
} }
mpImpl->bNeedUpdate = sal_False; mpImpl->bNeedUpdate = false;
} }
...@@ -553,10 +552,10 @@ void EmbeddedObjectRef::SetGraphic( const Graphic& rGraphic, const ::rtl::OUStri ...@@ -553,10 +552,10 @@ void EmbeddedObjectRef::SetGraphic( const Graphic& rGraphic, const ::rtl::OUStri
if ( mpImpl->pContainer ) if ( mpImpl->pContainer )
SetGraphicToContainer( rGraphic, *mpImpl->pContainer, mpImpl->aPersistName, rMediaType ); SetGraphicToContainer( rGraphic, *mpImpl->pContainer, mpImpl->aPersistName, rMediaType );
mpImpl->bNeedUpdate = sal_False; mpImpl->bNeedUpdate = false;
} }
SvStream* EmbeddedObjectRef::GetGraphicStream( sal_Bool bUpdate ) const SvStream* EmbeddedObjectRef::GetGraphicStream( bool bUpdate ) const
{ {
RTL_LOGFILE_CONTEXT( aLog, "svtools (mv76033) svt::EmbeddedObjectRef::GetGraphicStream" ); RTL_LOGFILE_CONTEXT( aLog, "svtools (mv76033) svt::EmbeddedObjectRef::GetGraphicStream" );
DBG_ASSERT( bUpdate || mpImpl->pContainer, "Can't retrieve current graphic!" ); DBG_ASSERT( bUpdate || mpImpl->pContainer, "Can't retrieve current graphic!" );
...@@ -605,7 +604,7 @@ SvStream* EmbeddedObjectRef::GetGraphicStream( sal_Bool bUpdate ) const ...@@ -605,7 +604,7 @@ SvStream* EmbeddedObjectRef::GetGraphicStream( sal_Bool bUpdate ) const
SvStream* pResult = ::utl::UcbStreamHelper::CreateStream( xStream ); SvStream* pResult = ::utl::UcbStreamHelper::CreateStream( xStream );
if ( pResult && bUpdate ) if ( pResult && bUpdate )
mpImpl->bNeedUpdate = sal_False; mpImpl->bNeedUpdate = false;
return pResult; return pResult;
} }
...@@ -619,7 +618,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const OUSt ...@@ -619,7 +618,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const OUSt
MapMode aMM( MAP_APPFONT ); MapMode aMM( MAP_APPFONT );
Size aAppFontSz = pOut->LogicToLogic( Size( 0, 8 ), &aMM, NULL ); Size aAppFontSz = pOut->LogicToLogic( Size( 0, 8 ), &aMM, NULL );
Font aFnt( rtl::OUString("Helvetica"), aAppFontSz ); Font aFnt( rtl::OUString("Helvetica"), aAppFontSz );
aFnt.SetTransparent( sal_True ); aFnt.SetTransparent( true );
aFnt.SetColor( Color( COL_LIGHTRED ) ); aFnt.SetColor( Color( COL_LIGHTRED ) );
aFnt.SetWeight( WEIGHT_BOLD ); aFnt.SetWeight( WEIGHT_BOLD );
aFnt.SetFamily( FAMILY_SWISS ); aFnt.SetFamily( FAMILY_SWISS );
...@@ -636,9 +635,9 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const OUSt ...@@ -636,9 +635,9 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const OUSt
aPt.X() = (rRect.GetWidth() - pOut->GetTextWidth( rText )) / 2; aPt.X() = (rRect.GetWidth() - pOut->GetTextWidth( rText )) / 2;
aPt.Y() = (rRect.GetHeight() - pOut->GetTextHeight()) / 2; aPt.Y() = (rRect.GetHeight() - pOut->GetTextHeight()) / 2;
sal_Bool bTiny = sal_False; bool bTiny = false;
if( aPt.X() < 0 ) bTiny = sal_True, aPt.X() = 0; if( aPt.X() < 0 ) bTiny = true, aPt.X() = 0;
if( aPt.Y() < 0 ) bTiny = sal_True, aPt.Y() = 0; if( aPt.Y() < 0 ) bTiny = true, aPt.Y() = 0;
if( bTiny ) if( bTiny )
{ {
// heruntergehen bei kleinen Bildern // heruntergehen bei kleinen Bildern
...@@ -720,10 +719,10 @@ void EmbeddedObjectRef::DrawShading( const Rectangle &rRect, OutputDevice *pOut ...@@ -720,10 +719,10 @@ void EmbeddedObjectRef::DrawShading( const Rectangle &rRect, OutputDevice *pOut
} }
sal_Bool EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbeddedObject >& xEmbObj ) bool EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbeddedObject >& xEmbObj )
{ {
if ( !xEmbObj.is() ) if ( !xEmbObj.is() )
return sal_False; return false;
try try
{ {
...@@ -732,10 +731,10 @@ sal_Bool EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbe ...@@ -732,10 +731,10 @@ sal_Bool EmbeddedObjectRef::TryRunningState( const uno::Reference < embed::XEmbe
} }
catch (const uno::Exception&) catch (const uno::Exception&)
{ {
return sal_False; return false;
} }
return sal_True; return true;
} }
void EmbeddedObjectRef::SetGraphicToContainer( const Graphic& rGraphic, void EmbeddedObjectRef::SetGraphicToContainer( const Graphic& rGraphic,
...@@ -767,13 +766,13 @@ uno::Reference< io::XInputStream > EmbeddedObjectRef::GetGraphicReplacementStrea ...@@ -767,13 +766,13 @@ uno::Reference< io::XInputStream > EmbeddedObjectRef::GetGraphicReplacementStrea
void EmbeddedObjectRef::UpdateReplacement() void EmbeddedObjectRef::UpdateReplacement()
{ {
GetReplacement( sal_True ); GetReplacement( true );
} }
void EmbeddedObjectRef::UpdateReplacementOnDemand() void EmbeddedObjectRef::UpdateReplacementOnDemand()
{ {
DELETEZ( mpImpl->pGraphic ); DELETEZ( mpImpl->pGraphic );
mpImpl->bNeedUpdate = sal_True; mpImpl->bNeedUpdate = true;
mpImpl->mnGraphicVersion++; mpImpl->mnGraphicVersion++;
if( mpImpl->pContainer ) if( mpImpl->pContainer )
...@@ -783,7 +782,7 @@ void EmbeddedObjectRef::UpdateReplacementOnDemand() ...@@ -783,7 +782,7 @@ void EmbeddedObjectRef::UpdateReplacementOnDemand()
} }
} }
sal_Bool EmbeddedObjectRef::IsChart() const bool EmbeddedObjectRef::IsChart() const
{ {
//todo maybe for 3.0: //todo maybe for 3.0:
//if the changes work good for chart //if the changes work good for chart
...@@ -802,10 +801,10 @@ sal_Bool EmbeddedObjectRef::IsChart() const ...@@ -802,10 +801,10 @@ sal_Bool EmbeddedObjectRef::IsChart() const
|| SvGlobalName(SO3_SCH_CLASSID_50) == aObjClsId || SvGlobalName(SO3_SCH_CLASSID_50) == aObjClsId
|| SvGlobalName(SO3_SCH_CLASSID_60) == aObjClsId) || SvGlobalName(SO3_SCH_CLASSID_60) == aObjClsId)
{ {
return sal_True; return true;
} }
return sal_False; return false;
} }
// #i104867# // #i104867#
......
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