Kaydet (Commit) c849d750 authored tarafından Noel Grandin's avatar Noel Grandin

svtools: sal_Bool->bool

Change-Id: I05dd992f332ab2f3dbcc65aed6dac909872168d4
üst 2d3a1d2a
...@@ -349,24 +349,24 @@ private: ...@@ -349,24 +349,24 @@ private:
long mnOffY; long mnOffY;
long mnLastOffX; long mnLastOffX;
long mnSplitSize; long mnSplitSize;
sal_uLong mnSwitchTime; sal_uLong mnSwitchTime;
WinBits mnWinStyle; WinBits mnWinStyle;
sal_uInt16 mnCurPageId; sal_uInt16 mnCurPageId;
sal_uInt16 mnFirstPos; sal_uInt16 mnFirstPos;
sal_uInt16 mnDropPos; sal_uInt16 mnDropPos;
sal_uInt16 mnSwitchId; sal_uInt16 mnSwitchId;
sal_uInt16 mnEditId; sal_uInt16 mnEditId;
sal_Bool mbFormat; bool mbFormat;
sal_Bool mbFirstFormat; bool mbFirstFormat;
sal_Bool mbSizeFormat; bool mbSizeFormat;
sal_Bool mbAutoMaxWidth; bool mbAutoMaxWidth;
sal_Bool mbInSwitching; bool mbInSwitching;
sal_Bool mbAutoEditMode; bool mbAutoEditMode;
sal_Bool mbEditCanceled; bool mbEditCanceled;
sal_Bool mbDropPos; bool mbDropPos;
sal_Bool mbInSelect; bool mbInSelect;
sal_Bool mbSelColor; bool mbSelColor;
sal_Bool mbSelTextColor; bool mbSelTextColor;
bool mbMirrored; bool mbMirrored;
bool mbHasInsertTab; // if true, the tab bar has an extra tab at the end. bool mbHasInsertTab; // if true, the tab bar has an extra tab at the end.
bool mbScrollAlwaysEnabled; bool mbScrollAlwaysEnabled;
...@@ -383,18 +383,18 @@ private: ...@@ -383,18 +383,18 @@ private:
using Window::ImplInit; using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle ); SVT_DLLPRIVATE void ImplInit( WinBits nWinStyle );
SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bBackground ); SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bBackground );
SVT_DLLPRIVATE void ImplGetColors( Color& rFaceColor, Color& rFaceTextColor, SVT_DLLPRIVATE void ImplGetColors( Color& rFaceColor, Color& rFaceTextColor,
Color& rSelectColor, Color& rSelectTextColor ); Color& rSelectColor, Color& rSelectTextColor );
SVT_DLLPRIVATE void ImplShowPage( sal_uInt16 nPos ); SVT_DLLPRIVATE void ImplShowPage( sal_uInt16 nPos );
SVT_DLLPRIVATE sal_Bool ImplCalcWidth(); SVT_DLLPRIVATE bool ImplCalcWidth();
SVT_DLLPRIVATE void ImplFormat(); SVT_DLLPRIVATE void ImplFormat();
SVT_DLLPRIVATE sal_uInt16 ImplGetLastFirstPos(); SVT_DLLPRIVATE sal_uInt16 ImplGetLastFirstPos();
SVT_DLLPRIVATE void ImplInitControls(); SVT_DLLPRIVATE void ImplInitControls();
SVT_DLLPRIVATE void ImplEnableControls(); SVT_DLLPRIVATE void ImplEnableControls();
SVT_DLLPRIVATE void ImplSelect(); SVT_DLLPRIVATE void ImplSelect();
SVT_DLLPRIVATE void ImplActivatePage(); SVT_DLLPRIVATE void ImplActivatePage();
SVT_DLLPRIVATE long ImplDeactivatePage(); SVT_DLLPRIVATE long ImplDeactivatePage();
SVT_DLLPRIVATE void ImplPrePaint(); SVT_DLLPRIVATE void ImplPrePaint();
SVT_DLLPRIVATE ImplTabBarItem* ImplGetLastTabBarItem( sal_uInt16 nItemCount ); SVT_DLLPRIVATE ImplTabBarItem* ImplGetLastTabBarItem( sal_uInt16 nItemCount );
SVT_DLLPRIVATE Rectangle ImplGetInsertTabRect(ImplTabBarItem* pItem) const; SVT_DLLPRIVATE Rectangle ImplGetInsertTabRect(ImplTabBarItem* pItem) const;
...@@ -439,50 +439,50 @@ public: ...@@ -439,50 +439,50 @@ public:
Color GetTabBgColor( sal_uInt16 nPageId ) const; Color GetTabBgColor( sal_uInt16 nPageId ) const;
void SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor ); void SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor );
sal_Bool IsDefaultTabBgColor( sal_uInt16 nPageId ); bool IsDefaultTabBgColor( sal_uInt16 nPageId );
void Clear(); void Clear();
sal_Bool IsPageEnabled( sal_uInt16 nPageId ) const; bool IsPageEnabled( sal_uInt16 nPageId ) const;
void SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits = 0 ); void SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits = 0 );
TabBarPageBits GetPageBits( sal_uInt16 nPageId ) const; TabBarPageBits GetPageBits( sal_uInt16 nPageId ) const;
sal_uInt16 GetPageCount() const; sal_uInt16 GetPageCount() const;
sal_uInt16 GetPageId( sal_uInt16 nPos ) const; sal_uInt16 GetPageId( sal_uInt16 nPos ) const;
sal_uInt16 GetPagePos( sal_uInt16 nPageId ) const; sal_uInt16 GetPagePos( sal_uInt16 nPageId ) const;
sal_uInt16 GetPageId( const Point& rPos, bool bCheckInsTab = false ) const; sal_uInt16 GetPageId( const Point& rPos, bool bCheckInsTab = false ) const;
Rectangle GetPageRect( sal_uInt16 nPageId ) const; Rectangle GetPageRect( sal_uInt16 nPageId ) const;
// returns the rectangle in which page tabs are drawn // returns the rectangle in which page tabs are drawn
Rectangle GetPageArea() const; Rectangle GetPageArea() const;
void SetCurPageId( sal_uInt16 nPageId ); void SetCurPageId( sal_uInt16 nPageId );
sal_uInt16 GetCurPageId() const { return mnCurPageId; } sal_uInt16 GetCurPageId() const { return mnCurPageId; }
void SetFirstPageId( sal_uInt16 nPageId ); void SetFirstPageId( sal_uInt16 nPageId );
sal_uInt16 GetFirstPageId() const { return GetPageId( mnFirstPos ); } sal_uInt16 GetFirstPageId() const { return GetPageId( mnFirstPos ); }
void MakeVisible( sal_uInt16 nPageId ); void MakeVisible( sal_uInt16 nPageId );
void SelectPage( sal_uInt16 nPageId, sal_Bool bSelect = sal_True ); void SelectPage( sal_uInt16 nPageId, bool bSelect = true );
sal_uInt16 GetSelectPageCount() const; sal_uInt16 GetSelectPageCount() const;
sal_Bool IsPageSelected( sal_uInt16 nPageId ) const; bool IsPageSelected( sal_uInt16 nPageId ) const;
void EnableAutoMaxPageWidth( sal_Bool bEnable = sal_True ) { mbAutoMaxWidth = bEnable; } void EnableAutoMaxPageWidth( bool bEnable = true ) { mbAutoMaxWidth = bEnable; }
sal_Bool IsAutoMaxPageWidthEnabled() const { return mbAutoMaxWidth; } bool IsAutoMaxPageWidthEnabled() const { return mbAutoMaxWidth; }
void SetMaxPageWidth( long nMaxWidth ); void SetMaxPageWidth( long nMaxWidth );
long GetMaxPageWidth() const { return mnMaxPageWidth; } long GetMaxPageWidth() const { return mnMaxPageWidth; }
void ResetMaxPageWidth() { SetMaxPageWidth( 0 ); } void ResetMaxPageWidth() { SetMaxPageWidth( 0 ); }
sal_Bool IsMaxPageWidth() const { return mnMaxPageWidth != 0; } bool IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
void EnableEditMode( sal_Bool bEnable = sal_True ) { mbAutoEditMode = bEnable; } void EnableEditMode( bool bEnable = true ) { mbAutoEditMode = bEnable; }
sal_Bool IsEditModeEnabled() const { return mbAutoEditMode; } bool IsEditModeEnabled() const { return mbAutoEditMode; }
sal_Bool StartEditMode( sal_uInt16 nPageId ); bool StartEditMode( sal_uInt16 nPageId );
void EndEditMode( sal_Bool bCancel = sal_False ); void EndEditMode( bool bCancel = false );
void SetEditText( const OUString& rText ) { maEditText = rText; } void SetEditText( const OUString& rText ) { maEditText = rText; }
const OUString& GetEditText() const { return maEditText; } const OUString& GetEditText() const { return maEditText; }
sal_Bool IsInEditMode() const { return (mpEdit != NULL); } bool IsInEditMode() const { return (mpEdit != NULL); }
sal_Bool IsEditModeCanceled() const { return mbEditCanceled; } bool IsEditModeCanceled() const { return mbEditCanceled; }
sal_uInt16 GetEditPageId() const { return mnEditId; } sal_uInt16 GetEditPageId() const { return mnEditId; }
/** Mirrors the entire control including position of buttons and splitter. /** Mirrors the entire control including position of buttons and splitter.
Mirroring is done relative to the current direction of the GUI. Mirroring is done relative to the current direction of the GUI.
...@@ -500,17 +500,17 @@ public: ...@@ -500,17 +500,17 @@ public:
/** Returns true, if the control draws from right to left (see SetEffectiveRTL()). */ /** Returns true, if the control draws from right to left (see SetEffectiveRTL()). */
bool IsEffectiveRTL() const; bool IsEffectiveRTL() const;
sal_Bool StartDrag( const CommandEvent& rCEvt, Region& rRegion ); bool StartDrag( const CommandEvent& rCEvt, Region& rRegion );
sal_uInt16 ShowDropPos( const Point& rPos ); sal_uInt16 ShowDropPos( const Point& rPos );
void HideDropPos(); void HideDropPos();
sal_Bool SwitchPage( const Point& rPos ); bool SwitchPage( const Point& rPos );
void EndSwitchPage(); void EndSwitchPage();
sal_Bool IsInSwitching() { return mbInSwitching; } bool IsInSwitching() { return mbInSwitching; }
const Color& GetSelectColor() const { return maSelColor; } const Color& GetSelectColor() const { return maSelColor; }
sal_Bool IsSelectColor() const { return mbSelColor; } bool IsSelectColor() const { return mbSelColor; }
const Color& GetSelectTextColor() const { return maSelTextColor; } const Color& GetSelectTextColor() const { return maSelTextColor; }
sal_Bool IsSelectTextColor() const { return mbSelTextColor; } bool IsSelectTextColor() const { return mbSelTextColor; }
void SetPageText( sal_uInt16 nPageId, const OUString& rText ); void SetPageText( sal_uInt16 nPageId, const OUString& rText );
OUString GetPageText( sal_uInt16 nPageId ) const; OUString GetPageText( sal_uInt16 nPageId ) const;
......
...@@ -71,7 +71,7 @@ namespace svt ...@@ -71,7 +71,7 @@ namespace svt
If the current state is not known (e.g. because you did not call needsUpdate, which retrieves it), If the current state is not known (e.g. because you did not call needsUpdate, which retrieves it),
it is not retrieved in the dtor, regardless of the <arg>_bAutoStoreState</arg> flag. it is not retrieved in the dtor, regardless of the <arg>_bAutoStoreState</arg> flag.
*/ */
TemplateFolderCache( sal_Bool _bAutoStoreState = sal_False ); TemplateFolderCache( bool _bAutoStoreState = false );
~TemplateFolderCache( ); ~TemplateFolderCache( );
/** determines whether or not the template configuration needs to be updated /** determines whether or not the template configuration needs to be updated
...@@ -82,7 +82,7 @@ namespace svt ...@@ -82,7 +82,7 @@ namespace svt
@return @return
<TRUE/> if the template configuration needs to be updated <TRUE/> if the template configuration needs to be updated
*/ */
sal_Bool needsUpdate( sal_Bool _bForceCheck = sal_False ); bool needsUpdate( bool _bForceCheck = false );
/** stores the current state of the template folders in the cache /** stores the current state of the template folders in the cache
@param _bForceRetrieval @param _bForceRetrieval
...@@ -90,7 +90,7 @@ namespace svt ...@@ -90,7 +90,7 @@ namespace svt
Usually, you set this to <FALSE/>: After calling <method>needsUpdate</method>, the state is know and does not Usually, you set this to <FALSE/>: After calling <method>needsUpdate</method>, the state is know and does not
need to be read again. need to be read again.
*/ */
void storeState( sal_Bool _bForceRetrieval = sal_False ); void storeState( bool _bForceRetrieval = false );
}; };
......
...@@ -73,7 +73,7 @@ public: ...@@ -73,7 +73,7 @@ public:
private: private:
SVT_DLLPRIVATE void InitImpl( ); SVT_DLLPRIVATE void InitImpl( );
SVT_DLLPRIVATE sal_Bool CanEnableEditBtn() const; SVT_DLLPRIVATE bool CanEnableEditBtn() const;
}; };
#endif // INCLUDED_SVTOOLS_TEMPLDLG_HXX #endif // INCLUDED_SVTOOLS_TEMPLDLG_HXX
......
...@@ -59,7 +59,7 @@ class SVT_DLLPUBLIC ToolboxController : ...@@ -59,7 +59,7 @@ class SVT_DLLPUBLIC ToolboxController :
public ::comphelper::OPropertyArrayUsageHelper< ToolboxController > public ::comphelper::OPropertyArrayUsageHelper< ToolboxController >
{ {
private: private:
sal_Bool m_bSupportVisible; bool m_bSupportVisible;
public: public:
ToolboxController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, ToolboxController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
...@@ -124,7 +124,7 @@ class SVT_DLLPUBLIC ToolboxController : ...@@ -124,7 +124,7 @@ class SVT_DLLPUBLIC ToolboxController :
protected: protected:
bool getToolboxId( sal_uInt16& rItemId, ToolBox** ppToolBox ); bool getToolboxId( sal_uInt16& rItemId, ToolBox** ppToolBox );
void setSupportVisibleProperty(sal_Bool bValue); void setSupportVisibleProperty(bool bValue);
struct Listener struct Listener
{ {
Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) : Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) :
...@@ -161,13 +161,13 @@ class SVT_DLLPUBLIC ToolboxController : ...@@ -161,13 +161,13 @@ class SVT_DLLPUBLIC ToolboxController :
void removeStatusListener( const OUString& aCommandURL ); void removeStatusListener( const OUString& aCommandURL );
void bindListener(); void bindListener();
void unbindListener(); void unbindListener();
sal_Bool isBound() const; bool isBound() const;
// TODO remove // TODO remove
::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > getURLTransformer() const; ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > getURLTransformer() const;
// TODO remove // TODO remove
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getParent() const; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getParent() const;
sal_Bool m_bInitialized : 1, bool m_bInitialized : 1,
m_bDisposed : 1; m_bDisposed : 1;
sal_uInt16 m_nToolBoxId; sal_uInt16 m_nToolBoxId;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
......
...@@ -1270,7 +1270,7 @@ SfxDocumentTemplates::~SfxDocumentTemplates() ...@@ -1270,7 +1270,7 @@ SfxDocumentTemplates::~SfxDocumentTemplates()
void SfxDocumentTemplates::Update( bool _bSmart ) void SfxDocumentTemplates::Update( bool _bSmart )
{ {
if ( !_bSmart // don't be smart if ( !_bSmart // don't be smart
|| ::svt::TemplateFolderCache( sal_True ).needsUpdate() // update is really necessary || ::svt::TemplateFolderCache( true ).needsUpdate() // update is really necessary
) )
{ {
if ( pImp->Construct() ) if ( pImp->Construct() )
......
...@@ -1510,9 +1510,9 @@ SvtDocumentTemplateDialog::~SvtDocumentTemplateDialog() ...@@ -1510,9 +1510,9 @@ SvtDocumentTemplateDialog::~SvtDocumentTemplateDialog()
sal_Bool SvtDocumentTemplateDialog::CanEnableEditBtn() const bool SvtDocumentTemplateDialog::CanEnableEditBtn() const
{ {
sal_Bool bEnable = sal_False; bool bEnable = false;
OUString aFolderURL = pImpl->pWin->GetFolderURL(); OUString aFolderURL = pImpl->pWin->GetFolderURL();
if ( pImpl->pWin->IsFileSelected() && !aFolderURL.isEmpty() ) if ( pImpl->pWin->IsFileSelected() && !aFolderURL.isEmpty() )
......
...@@ -89,7 +89,7 @@ namespace svt ...@@ -89,7 +89,7 @@ namespace svt
} }
sal_Bool operator == ( const util::DateTime& _rLHS, const util::DateTime& _rRHS ) bool operator == ( const util::DateTime& _rLHS, const util::DateTime& _rRHS )
{ {
return _rLHS.NanoSeconds == _rRHS.NanoSeconds return _rLHS.NanoSeconds == _rRHS.NanoSeconds
&& _rLHS.Seconds == _rRHS.Seconds && _rLHS.Seconds == _rRHS.Seconds
...@@ -102,7 +102,7 @@ namespace svt ...@@ -102,7 +102,7 @@ namespace svt
} }
sal_Bool operator != ( const util::DateTime& _rLHS, const util::DateTime& _rRHS ) bool operator != ( const util::DateTime& _rLHS, const util::DateTime& _rRHS )
{ {
return !( _rLHS == _rRHS ); return !( _rLHS == _rRHS );
} }
...@@ -449,48 +449,48 @@ namespace svt ...@@ -449,48 +449,48 @@ namespace svt
uno::Reference< util::XOfficeInstallationDirectories > m_xOfficeInstDirs; uno::Reference< util::XOfficeInstallationDirectories > m_xOfficeInstDirs;
SvStream* m_pCacheStream; SvStream* m_pCacheStream;
sal_Bool m_bNeedsUpdate : 1; bool m_bNeedsUpdate : 1;
sal_Bool m_bKnowState : 1; bool m_bKnowState : 1;
sal_Bool m_bValidCurrentState : 1; bool m_bValidCurrentState : 1;
sal_Bool m_bAutoStoreState : 1; bool m_bAutoStoreState : 1;
public: public:
TemplateFolderCacheImpl( sal_Bool _bAutoStoreState ); TemplateFolderCacheImpl( bool _bAutoStoreState );
~TemplateFolderCacheImpl( ); ~TemplateFolderCacheImpl( );
sal_Bool needsUpdate( sal_Bool _bForceCheck ); bool needsUpdate( bool _bForceCheck );
void storeState( sal_Bool _bForceRetrieval ); void storeState( bool _bForceRetrieval );
private: private:
sal_Bool openCacheStream( sal_Bool _bForRead ); bool openCacheStream( bool _bForRead );
void closeCacheStream( ); void closeCacheStream( );
/// read the state of the dirs from the cache file /// read the state of the dirs from the cache file
sal_Bool readPreviousState(); bool readPreviousState();
/// read the current state of the dirs /// read the current state of the dirs
sal_Bool readCurrentState(); bool readCurrentState();
OUString implParseSmart( const OUString& _rPath ); OUString implParseSmart( const OUString& _rPath );
sal_Bool implReadFolder( const ::rtl::Reference< TemplateContent >& _rxRoot ); bool implReadFolder( const ::rtl::Reference< TemplateContent >& _rxRoot );
static OUString getCacheFileName(); static OUString getCacheFileName();
static sal_Int32 getMagicNumber(); static sal_Int32 getMagicNumber();
static void normalize( TemplateFolderContent& _rState ); static void normalize( TemplateFolderContent& _rState );
// @return <TRUE/> if the states equal // @return <TRUE/> if the states equal
static sal_Bool equalStates( const TemplateFolderContent& _rLHS, const TemplateFolderContent& _rRHS ); static bool equalStates( const TemplateFolderContent& _rLHS, const TemplateFolderContent& _rRHS );
// late initialize m_xOfficeInstDirs // late initialize m_xOfficeInstDirs
uno::Reference< util::XOfficeInstallationDirectories > getOfficeInstDirs(); uno::Reference< util::XOfficeInstallationDirectories > getOfficeInstDirs();
}; };
TemplateFolderCacheImpl::TemplateFolderCacheImpl( sal_Bool _bAutoStoreState ) TemplateFolderCacheImpl::TemplateFolderCacheImpl( bool _bAutoStoreState )
:m_pCacheStream ( NULL ) :m_pCacheStream ( NULL )
,m_bNeedsUpdate ( sal_True ) ,m_bNeedsUpdate ( true )
,m_bKnowState ( sal_False ) ,m_bKnowState ( false )
,m_bValidCurrentState ( sal_False ) ,m_bValidCurrentState ( false )
,m_bAutoStoreState ( _bAutoStoreState ) ,m_bAutoStoreState ( _bAutoStoreState )
{ {
} }
...@@ -500,7 +500,7 @@ namespace svt ...@@ -500,7 +500,7 @@ namespace svt
{ {
// store the current state if possible and required // store the current state if possible and required
if ( m_bValidCurrentState && m_bAutoStoreState ) if ( m_bValidCurrentState && m_bAutoStoreState )
storeState( sal_False ); storeState( false );
closeCacheStream( ); closeCacheStream( );
} }
...@@ -530,10 +530,10 @@ namespace svt ...@@ -530,10 +530,10 @@ namespace svt
} }
sal_Bool TemplateFolderCacheImpl::equalStates( const TemplateFolderContent& _rLHS, const TemplateFolderContent& _rRHS ) bool TemplateFolderCacheImpl::equalStates( const TemplateFolderContent& _rLHS, const TemplateFolderContent& _rRHS )
{ {
if ( _rLHS.size() != _rRHS.size() ) if ( _rLHS.size() != _rRHS.size() )
return sal_False; return false;
// as both arrays are sorted (by definition - this is a precondition of this method) // as both arrays are sorted (by definition - this is a precondition of this method)
// we can simply go from the front to the back and compare the single elements // we can simply go from the front to the back and compare the single elements
...@@ -549,12 +549,12 @@ namespace svt ...@@ -549,12 +549,12 @@ namespace svt
} }
void TemplateFolderCacheImpl::storeState( sal_Bool _bForceRetrieval ) void TemplateFolderCacheImpl::storeState( bool _bForceRetrieval )
{ {
if ( !m_bValidCurrentState || _bForceRetrieval ) if ( !m_bValidCurrentState || _bForceRetrieval )
readCurrentState( ); readCurrentState( );
if ( m_bValidCurrentState && openCacheStream( sal_False ) ) if ( m_bValidCurrentState && openCacheStream( false ) )
{ {
m_pCacheStream->WriteInt32( getMagicNumber() ); m_pCacheStream->WriteInt32( getMagicNumber() );
...@@ -599,7 +599,7 @@ namespace svt ...@@ -599,7 +599,7 @@ namespace svt
} }
sal_Bool TemplateFolderCacheImpl::implReadFolder( const ::rtl::Reference< TemplateContent >& _rxRoot ) bool TemplateFolderCacheImpl::implReadFolder( const ::rtl::Reference< TemplateContent >& _rxRoot )
{ {
try try
{ {
...@@ -624,7 +624,7 @@ namespace svt ...@@ -624,7 +624,7 @@ namespace svt
catch( CommandAbortedException& ) catch( CommandAbortedException& )
{ {
SAL_WARN( "svtools.misc", "TemplateFolderCacheImpl::implReadFolder: caught a CommandAbortedException!" ); SAL_WARN( "svtools.misc", "TemplateFolderCacheImpl::implReadFolder: caught a CommandAbortedException!" );
return sal_False; return false;
} }
catch( ::com::sun::star::uno::Exception& ) catch( ::com::sun::star::uno::Exception& )
{ {
...@@ -664,16 +664,16 @@ namespace svt ...@@ -664,16 +664,16 @@ namespace svt
catch( const Exception& ) catch( const Exception& )
{ {
OSL_FAIL( "TemplateFolderCacheImpl::implReadFolder: caught an exception!" ); OSL_FAIL( "TemplateFolderCacheImpl::implReadFolder: caught an exception!" );
return sal_False; return false;
} }
return sal_True; return true;
} }
sal_Bool TemplateFolderCacheImpl::readCurrentState() bool TemplateFolderCacheImpl::readCurrentState()
{ {
// reset // reset
m_bValidCurrentState = sal_False; m_bValidCurrentState = false;
TemplateFolderContent aTemplateFolderContent; TemplateFolderContent aTemplateFolderContent;
m_aCurrentState.swap( aTemplateFolderContent ); m_aCurrentState.swap( aTemplateFolderContent );
...@@ -704,19 +704,19 @@ namespace svt ...@@ -704,19 +704,19 @@ namespace svt
--aCurrentRoot; --aCurrentRoot;
if ( !implReadFolder( *aCurrentRoot ) ) if ( !implReadFolder( *aCurrentRoot ) )
return sal_False; return false;
} }
while ( nIndex >= 0 ); while ( nIndex >= 0 );
// normalize the array (which basically means "sort it") // normalize the array (which basically means "sort it")
normalize( m_aCurrentState ); normalize( m_aCurrentState );
m_bValidCurrentState = sal_True; m_bValidCurrentState = true;
return m_bValidCurrentState; return m_bValidCurrentState;
} }
sal_Bool TemplateFolderCacheImpl::readPreviousState() bool TemplateFolderCacheImpl::readPreviousState()
{ {
DBG_ASSERT( m_pCacheStream, "TemplateFolderCacheImpl::readPreviousState: not to be called without stream!" ); DBG_ASSERT( m_pCacheStream, "TemplateFolderCacheImpl::readPreviousState: not to be called without stream!" );
...@@ -729,7 +729,7 @@ namespace svt ...@@ -729,7 +729,7 @@ namespace svt
m_pCacheStream->ReadInt32( nMagic ); m_pCacheStream->ReadInt32( nMagic );
DBG_ASSERT( getMagicNumber() == nMagic, "TemplateFolderCacheImpl::readPreviousState: invalid cache file!" ); DBG_ASSERT( getMagicNumber() == nMagic, "TemplateFolderCacheImpl::readPreviousState: invalid cache file!" );
if ( getMagicNumber() != nMagic ) if ( getMagicNumber() != nMagic )
return sal_False; return false;
// the root directories // the root directories
// their number // their number
...@@ -759,11 +759,11 @@ namespace svt ...@@ -759,11 +759,11 @@ namespace svt
// normalize the array (which basically means "sort it") // normalize the array (which basically means "sort it")
normalize( m_aPreviousState ); normalize( m_aPreviousState );
return sal_True; return true;
} }
sal_Bool TemplateFolderCacheImpl::openCacheStream( sal_Bool _bForRead ) bool TemplateFolderCacheImpl::openCacheStream( bool _bForRead )
{ {
// close any old stream instance // close any old stream instance
closeCacheStream( ); closeCacheStream( );
...@@ -774,7 +774,7 @@ namespace svt ...@@ -774,7 +774,7 @@ namespace svt
if ( INET_PROT_NOT_VALID == aStorageURL.GetProtocol() ) if ( INET_PROT_NOT_VALID == aStorageURL.GetProtocol() )
{ {
OSL_FAIL( "TemplateFolderCacheImpl::openCacheStream: invalid storage path!" ); OSL_FAIL( "TemplateFolderCacheImpl::openCacheStream: invalid storage path!" );
return sal_False; return false;
} }
// append our name // append our name
...@@ -796,18 +796,18 @@ namespace svt ...@@ -796,18 +796,18 @@ namespace svt
} }
sal_Bool TemplateFolderCacheImpl::needsUpdate( sal_Bool _bForceCheck ) bool TemplateFolderCacheImpl::needsUpdate( bool _bForceCheck )
{ {
if ( m_bKnowState && !_bForceCheck ) if ( m_bKnowState && !_bForceCheck )
return m_bNeedsUpdate; return m_bNeedsUpdate;
m_bNeedsUpdate = sal_True; m_bNeedsUpdate = true;
m_bKnowState = sal_True; m_bKnowState = true;
if ( readCurrentState() ) if ( readCurrentState() )
{ {
// open the stream which contains the cached state of the directories // open the stream which contains the cached state of the directories
if ( openCacheStream( sal_True ) ) if ( openCacheStream( true ) )
{ // opening the stream succeeded { // opening the stream succeeded
if ( readPreviousState() ) if ( readPreviousState() )
{ {
...@@ -843,7 +843,7 @@ namespace svt ...@@ -843,7 +843,7 @@ namespace svt
//= TemplateFolderCache //= TemplateFolderCache
TemplateFolderCache::TemplateFolderCache( sal_Bool _bAutoStoreState ) TemplateFolderCache::TemplateFolderCache( bool _bAutoStoreState )
:m_pImpl( new TemplateFolderCacheImpl( _bAutoStoreState ) ) :m_pImpl( new TemplateFolderCacheImpl( _bAutoStoreState ) )
{ {
} }
...@@ -855,13 +855,13 @@ namespace svt ...@@ -855,13 +855,13 @@ namespace svt
} }
sal_Bool TemplateFolderCache::needsUpdate( sal_Bool _bForceCheck ) bool TemplateFolderCache::needsUpdate( bool _bForceCheck )
{ {
return m_pImpl->needsUpdate( _bForceCheck ); return m_pImpl->needsUpdate( _bForceCheck );
} }
void TemplateFolderCache::storeState( sal_Bool _bForceRetrieval ) void TemplateFolderCache::storeState( bool _bForceRetrieval )
{ {
m_pImpl->storeState( _bForceRetrieval ); m_pImpl->storeState( _bForceRetrieval );
} }
......
...@@ -59,7 +59,7 @@ GenericToolboxController::GenericToolboxController( const Reference< XComponentC ...@@ -59,7 +59,7 @@ GenericToolboxController::GenericToolboxController( const Reference< XComponentC
, m_nID( nID ) , m_nID( nID )
{ {
// Initialization is done through ctor // Initialization is done through ctor
m_bInitialized = sal_True; m_bInitialized = true;
// insert main command to our listener map // insert main command to our listener map
if ( !m_aCommandURL.isEmpty() ) if ( !m_aCommandURL.isEmpty() )
......
...@@ -53,12 +53,12 @@ ToolboxController::ToolboxController( ...@@ -53,12 +53,12 @@ ToolboxController::ToolboxController(
const Reference< XComponentContext >& rxContext, const Reference< XComponentContext >& rxContext,
const Reference< XFrame >& xFrame, const Reference< XFrame >& xFrame,
const OUString& aCommandURL ) : const OUString& aCommandURL ) :
OPropertyContainer(GetBroadcastHelper()) OPropertyContainer( GetBroadcastHelper() )
, m_bSupportVisible(sal_False) , m_bSupportVisible( false )
, m_bInitialized( sal_False ) , m_bInitialized( false )
, m_bDisposed( sal_False ) , m_bDisposed( false )
, m_nToolBoxId( SAL_MAX_UINT16 ) , m_nToolBoxId( SAL_MAX_UINT16 )
, m_xFrame(xFrame) , m_xFrame( xFrame )
, m_xContext( rxContext ) , m_xContext( rxContext )
, m_aCommandURL( aCommandURL ) , m_aCommandURL( aCommandURL )
, m_aListenerContainer( m_aMutex ) , m_aListenerContainer( m_aMutex )
...@@ -80,9 +80,9 @@ ToolboxController::ToolboxController( ...@@ -80,9 +80,9 @@ ToolboxController::ToolboxController(
ToolboxController::ToolboxController() : ToolboxController::ToolboxController() :
OPropertyContainer(GetBroadcastHelper()) OPropertyContainer(GetBroadcastHelper())
, m_bSupportVisible(sal_False) , m_bSupportVisible(false)
, m_bInitialized( sal_False ) , m_bInitialized( false )
, m_bDisposed( sal_False ) , m_bDisposed( false )
, m_nToolBoxId( SAL_MAX_UINT16 ) , m_nToolBoxId( SAL_MAX_UINT16 )
, m_aListenerContainer( m_aMutex ) , m_aListenerContainer( m_aMutex )
{ {
...@@ -179,8 +179,8 @@ throw ( Exception, RuntimeException, std::exception ) ...@@ -179,8 +179,8 @@ throw ( Exception, RuntimeException, std::exception )
if ( !bInitialized ) if ( !bInitialized )
{ {
SolarMutexGuard aSolarMutexGuard; SolarMutexGuard aSolarMutexGuard;
m_bInitialized = sal_True; m_bInitialized = true;
m_bSupportVisible = sal_False; m_bSupportVisible = false;
PropertyValue aPropValue; PropertyValue aPropValue;
for ( int i = 0; i < aArguments.getLength(); i++ ) for ( int i = 0; i < aArguments.getLength(); i++ )
{ {
...@@ -271,7 +271,7 @@ throw (::com::sun::star::uno::RuntimeException, std::exception) ...@@ -271,7 +271,7 @@ throw (::com::sun::star::uno::RuntimeException, std::exception)
++pIter; ++pIter;
} }
m_bDisposed = sal_True; m_bDisposed = true;
} }
void SAL_CALL ToolboxController::addEventListener( const Reference< XEventListener >& xListener ) void SAL_CALL ToolboxController::addEventListener( const Reference< XEventListener >& xListener )
...@@ -614,18 +614,18 @@ void ToolboxController::unbindListener() ...@@ -614,18 +614,18 @@ void ToolboxController::unbindListener()
} }
} }
sal_Bool ToolboxController::isBound() const bool ToolboxController::isBound() const
{ {
SolarMutexGuard aSolarMutexGuard; SolarMutexGuard aSolarMutexGuard;
if ( !m_bInitialized ) if ( !m_bInitialized )
return sal_False; return false;
URLToDispatchMap::const_iterator pIter = m_aListenerMap.find( m_aCommandURL ); URLToDispatchMap::const_iterator pIter = m_aListenerMap.find( m_aCommandURL );
if ( pIter != m_aListenerMap.end() ) if ( pIter != m_aListenerMap.end() )
return ( pIter->second.is() ); return pIter->second.is();
return sal_False; return false;
} }
void ToolboxController::updateStatus() void ToolboxController::updateStatus()
...@@ -727,7 +727,7 @@ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_C ...@@ -727,7 +727,7 @@ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_C
return new ::cppu::OPropertyArrayHelper(aProps); return new ::cppu::OPropertyArrayHelper(aProps);
} }
void ToolboxController::setSupportVisibleProperty(sal_Bool bValue) void ToolboxController::setSupportVisibleProperty(bool bValue)
{ {
m_bSupportVisible = bValue; m_bSupportVisible = bValue;
} }
...@@ -743,7 +743,7 @@ sal_Bool SAL_CALL ToolboxController::convertFastPropertyValue( com::sun::star::u ...@@ -743,7 +743,7 @@ sal_Bool SAL_CALL ToolboxController::convertFastPropertyValue( com::sun::star::u
{ {
sal_Bool aNewValue(sal_False); sal_Bool aNewValue(sal_False);
aValue >>= aNewValue; aValue >>= aNewValue;
if (aNewValue != m_bSupportVisible) if (aNewValue != (m_bSupportVisible ? 1 : 0))
{ {
aConvertedValue <<= aNewValue; aConvertedValue <<= aNewValue;
aOldValue <<= m_bSupportVisible; aOldValue <<= m_bSupportVisible;
......
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