Kaydet (Commit) c2963398 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

sal_Bool->bool in svl::SfxStyleSheetBase

Change-Id: Id506fa56d07be56d63715703e354625715275933
üst 055b6f12
...@@ -51,17 +51,17 @@ public: ...@@ -51,17 +51,17 @@ public:
ScStyleSheet( const ScStyleSheet& rStyle ); ScStyleSheet( const ScStyleSheet& rStyle );
virtual sal_Bool SetParent ( const String& rParentName ); virtual bool SetParent ( const String& rParentName );
virtual SfxItemSet& GetItemSet (); virtual SfxItemSet& GetItemSet ();
virtual sal_Bool IsUsed () const; virtual bool IsUsed () const;
virtual sal_Bool HasFollowSupport () const; virtual bool HasFollowSupport () const;
virtual sal_Bool HasParentSupport () const; virtual bool HasParentSupport () const;
virtual const String& GetName() const; virtual const String& GetName() const;
virtual const String& GetParent() const; virtual const String& GetParent() const;
virtual const String& GetFollow() const; virtual const String& GetFollow() const;
virtual sal_Bool SetName( const String& ); virtual bool SetName( const String& );
void SetUsage( ScStyleSheet::Usage eUse ) const void SetUsage( ScStyleSheet::Usage eUse ) const
{ eUsage = eUse; } { eUsage = eUse; }
......
...@@ -85,20 +85,20 @@ ScStyleSheet::~ScStyleSheet() ...@@ -85,20 +85,20 @@ ScStyleSheet::~ScStyleSheet()
//------------------------------------------------------------------------ //------------------------------------------------------------------------
sal_Bool ScStyleSheet::HasFollowSupport() const bool ScStyleSheet::HasFollowSupport() const
{ {
return false; return false;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
sal_Bool ScStyleSheet::HasParentSupport () const bool ScStyleSheet::HasParentSupport () const
{ {
sal_Bool bHasParentSupport = false; bool bHasParentSupport = false;
switch ( GetFamily() ) switch ( GetFamily() )
{ {
case SFX_STYLE_FAMILY_PARA: bHasParentSupport = sal_True; break; case SFX_STYLE_FAMILY_PARA: bHasParentSupport = true; break;
case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = false; break; case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = false; break;
default: default:
{ {
...@@ -111,9 +111,9 @@ sal_Bool ScStyleSheet::HasParentSupport () const ...@@ -111,9 +111,9 @@ sal_Bool ScStyleSheet::HasParentSupport () const
//------------------------------------------------------------------------ //------------------------------------------------------------------------
sal_Bool ScStyleSheet::SetParent( const String& rParentName ) bool ScStyleSheet::SetParent( const String& rParentName )
{ {
sal_Bool bResult = false; bool bResult = false;
String aEffName = rParentName; String aEffName = rParentName;
SfxStyleSheetBase* pStyle = pPool->Find( aEffName, nFamily ); SfxStyleSheetBase* pStyle = pPool->Find( aEffName, nFamily );
if (!pStyle) if (!pStyle)
...@@ -263,7 +263,7 @@ SfxItemSet& ScStyleSheet::GetItemSet() ...@@ -263,7 +263,7 @@ SfxItemSet& ScStyleSheet::GetItemSet()
//------------------------------------------------------------------------ //------------------------------------------------------------------------
sal_Bool ScStyleSheet::IsUsed() const bool ScStyleSheet::IsUsed() const
{ {
if ( GetFamily() == SFX_STYLE_FAMILY_PARA ) if ( GetFamily() == SFX_STYLE_FAMILY_PARA )
{ {
...@@ -277,7 +277,7 @@ sal_Bool ScStyleSheet::IsUsed() const ...@@ -277,7 +277,7 @@ sal_Bool ScStyleSheet::IsUsed() const
return eUsage == USED; return eUsage == USED;
} }
else else
return sal_True; return true;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
...@@ -332,7 +332,7 @@ const String& ScStyleSheet::GetFollow() const ...@@ -332,7 +332,7 @@ const String& ScStyleSheet::GetFollow() const
//! Flag gesetzt und abgefragt werden. //! Flag gesetzt und abgefragt werden.
//! Die ganze Abfrage muss raus, wenn fuer eine neue Datei-Version die Namens-Umsetzung wegfaellt. //! Die ganze Abfrage muss raus, wenn fuer eine neue Datei-Version die Namens-Umsetzung wegfaellt.
sal_Bool ScStyleSheet::SetName( const String& rNew ) bool ScStyleSheet::SetName( const String& rNew )
{ {
String aFileStdName = rtl::OUString(STRING_STANDARD); String aFileStdName = rtl::OUString(STRING_STANDARD);
if ( rNew == aFileStdName && aFileStdName != ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ) if ( rNew == aFileStdName && aFileStdName != ScGlobal::GetRscString(STR_STYLENAME_STANDARD) )
......
...@@ -54,13 +54,13 @@ public: ...@@ -54,13 +54,13 @@ public:
SdStyleSheet( const rtl::OUString& rDisplayName, SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily, sal_uInt16 nMask ); SdStyleSheet( const rtl::OUString& rDisplayName, SfxStyleSheetBasePool& rPool, SfxStyleFamily eFamily, sal_uInt16 nMask );
SdStyleSheet( const SdStyleSheet& ); SdStyleSheet( const SdStyleSheet& );
virtual sal_Bool SetParent (const String& rParentName); virtual bool SetParent (const String& rParentName);
virtual SfxItemSet& GetItemSet(); virtual SfxItemSet& GetItemSet();
virtual sal_Bool IsUsed() const; virtual bool IsUsed() const;
virtual sal_Bool HasFollowSupport() const; virtual bool HasFollowSupport() const;
virtual sal_Bool HasParentSupport() const; virtual bool HasParentSupport() const;
virtual sal_Bool HasClearParentSupport() const; virtual bool HasClearParentSupport() const;
virtual sal_Bool SetName( const UniString& ); virtual bool SetName( const UniString& );
virtual void SetHelpId( const String& r, sal_uLong nId ); virtual void SetHelpId( const String& r, sal_uLong nId );
void AdjustToFontHeight(SfxItemSet& rSet, sal_Bool bOnlyMissingItems = sal_True); void AdjustToFontHeight(SfxItemSet& rSet, sal_Bool bOnlyMissingItems = sal_True);
......
...@@ -197,9 +197,9 @@ void SdStyleSheet::Store(SvStream& rOut) ...@@ -197,9 +197,9 @@ void SdStyleSheet::Store(SvStream& rOut)
|* |*
\************************************************************************/ \************************************************************************/
sal_Bool SdStyleSheet::SetParent(const String& rParentName) bool SdStyleSheet::SetParent(const String& rParentName)
{ {
sal_Bool bResult = sal_False; bool bResult = sal_False;
if (SfxStyleSheet::SetParent(rParentName)) if (SfxStyleSheet::SetParent(rParentName))
{ {
...@@ -211,7 +211,7 @@ sal_Bool SdStyleSheet::SetParent(const String& rParentName) ...@@ -211,7 +211,7 @@ sal_Bool SdStyleSheet::SetParent(const String& rParentName)
SfxStyleSheetBase* pStyle = pPool->Find(rParentName, nFamily); SfxStyleSheetBase* pStyle = pPool->Find(rParentName, nFamily);
if (pStyle) if (pStyle)
{ {
bResult = sal_True; bResult = true;
SfxItemSet& rParentSet = pStyle->GetItemSet(); SfxItemSet& rParentSet = pStyle->GetItemSet();
GetItemSet().SetParent(&rParentSet); GetItemSet().SetParent(&rParentSet);
Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
...@@ -219,14 +219,14 @@ sal_Bool SdStyleSheet::SetParent(const String& rParentName) ...@@ -219,14 +219,14 @@ sal_Bool SdStyleSheet::SetParent(const String& rParentName)
} }
else else
{ {
bResult = sal_True; bResult = true;
GetItemSet().SetParent(NULL); GetItemSet().SetParent(NULL);
Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
} }
} }
else else
{ {
bResult = sal_True; bResult = true;
} }
} }
return bResult; return bResult;
...@@ -342,9 +342,9 @@ SfxItemSet& SdStyleSheet::GetItemSet() ...@@ -342,9 +342,9 @@ SfxItemSet& SdStyleSheet::GetItemSet()
|* |*
\************************************************************************/ \************************************************************************/
sal_Bool SdStyleSheet::IsUsed() const bool SdStyleSheet::IsUsed() const
{ {
sal_Bool bResult = sal_False; bool bResult = false;
sal_uInt16 nListenerCount = GetListenerCount(); sal_uInt16 nListenerCount = GetListenerCount();
if (nListenerCount > 0) if (nListenerCount > 0)
...@@ -636,28 +636,28 @@ void SdStyleSheet::AdjustToFontHeight(SfxItemSet& rSet, sal_Bool bOnlyMissingIte ...@@ -636,28 +636,28 @@ void SdStyleSheet::AdjustToFontHeight(SfxItemSet& rSet, sal_Bool bOnlyMissingIte
// -------------------------------------------------------------------- // --------------------------------------------------------------------
sal_Bool SdStyleSheet::HasFollowSupport() const bool SdStyleSheet::HasFollowSupport() const
{ {
return sal_False; return false;
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
sal_Bool SdStyleSheet::HasParentSupport() const bool SdStyleSheet::HasParentSupport() const
{ {
return sal_True; return true;
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
sal_Bool SdStyleSheet::HasClearParentSupport() const bool SdStyleSheet::HasClearParentSupport() const
{ {
return sal_True; return true;
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
sal_Bool SdStyleSheet::SetName( const UniString& rName ) bool SdStyleSheet::SetName( const UniString& rName )
{ {
return SfxStyleSheet::SetName( rName ); return SfxStyleSheet::SetName( rName );
} }
......
...@@ -89,7 +89,7 @@ protected: ...@@ -89,7 +89,7 @@ protected:
sal_uLong nHelpId; // Hilfe-ID sal_uLong nHelpId; // Hilfe-ID
sal_Bool bMySet; // sal_True: Set loeschen im dtor bool bMySet; // sal_True: Set loeschen im dtor
SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool*, SfxStyleFamily eFam, sal_uInt16 mask ); SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool*, SfxStyleFamily eFam, sal_uInt16 mask );
SfxStyleSheetBase( const SfxStyleSheetBase& ); SfxStyleSheetBase( const SfxStyleSheetBase& );
...@@ -104,7 +104,7 @@ public: ...@@ -104,7 +104,7 @@ public:
virtual const UniString& GetName() const; virtual const UniString& GetName() const;
// sets the internal name of this style // sets the internal name of this style
virtual sal_Bool SetName( const UniString& ); virtual bool SetName( const UniString& );
/** returns the display name of this style, it is used at the user interface. /** returns the display name of this style, it is used at the user interface.
If the display name is empty, this method returns the internal name. */ If the display name is empty, this method returns the internal name. */
...@@ -114,13 +114,13 @@ public: ...@@ -114,13 +114,13 @@ public:
virtual void SetDisplayName( const rtl::OUString& ); virtual void SetDisplayName( const rtl::OUString& );
virtual const UniString& GetParent() const; virtual const UniString& GetParent() const;
virtual sal_Bool SetParent( const UniString& ); virtual bool SetParent( const UniString& );
virtual const UniString& GetFollow() const; virtual const UniString& GetFollow() const;
virtual sal_Bool SetFollow( const UniString& ); virtual bool SetFollow( const UniString& );
virtual sal_Bool HasFollowSupport() const; // Default sal_True virtual bool HasFollowSupport() const; // Default true
virtual sal_Bool HasParentSupport() const; // Default sal_True virtual bool HasParentSupport() const; // Default true
virtual sal_Bool HasClearParentSupport() const; // Default sal_False virtual bool HasClearParentSupport() const; // Default false
virtual sal_Bool IsUsed() const; // Default sal_True virtual bool IsUsed() const; // Default true
// Default aus dem Itemset; entweder dem uebergebenen // Default aus dem Itemset; entweder dem uebergebenen
// oder aus dem per GetItemSet() zurueckgelieferten Set // oder aus dem per GetItemSet() zurueckgelieferten Set
virtual UniString GetDescription(); virtual UniString GetDescription();
...@@ -130,8 +130,8 @@ public: ...@@ -130,8 +130,8 @@ public:
SfxStyleFamily GetFamily() const { return nFamily; } SfxStyleFamily GetFamily() const { return nFamily; }
sal_uInt16 GetMask() const { return nMask; } sal_uInt16 GetMask() const { return nMask; }
void SetMask( sal_uInt16 mask) { nMask = mask; } void SetMask( sal_uInt16 mask) { nMask = mask; }
sal_Bool IsUserDefined() const bool IsUserDefined() const
{ return sal_Bool( ( nMask & SFXSTYLEBIT_USERDEF) != 0 ); } { return ( nMask & SFXSTYLEBIT_USERDEF) != 0; }
virtual sal_uLong GetHelpId( String& rFile ); virtual sal_uLong GetHelpId( String& rFile );
virtual void SetHelpId( const String& r, sal_uLong nId ); virtual void SetHelpId( const String& r, sal_uLong nId );
...@@ -172,16 +172,17 @@ protected: ...@@ -172,16 +172,17 @@ protected:
SfxStyleSheetBasePool* pBasePool; SfxStyleSheetBasePool* pBasePool;
SfxStyleFamily nSearchFamily; SfxStyleFamily nSearchFamily;
sal_uInt16 nMask; sal_uInt16 nMask;
sal_Bool SearchUsed() const { return bSearchUsed; }
bool SearchUsed() const { return bSearchUsed; }
private: private:
sal_uInt16 GetPos(){return nAktPosition;} sal_uInt16 GetPos() { return nAktPosition; }
SVL_DLLPRIVATE sal_Bool IsTrivialSearch(); SVL_DLLPRIVATE bool IsTrivialSearch();
SVL_DLLPRIVATE sal_Bool DoesStyleMatch(SfxStyleSheetBase *pStyle); SVL_DLLPRIVATE bool DoesStyleMatch(SfxStyleSheetBase *pStyle);
SfxStyleSheetBase* pAktStyle; SfxStyleSheetBase* pAktStyle;
sal_uInt16 nAktPosition; sal_uInt16 nAktPosition;
sal_Bool bSearchUsed; bool bSearchUsed;
friend class SfxStyleSheetBasePool; friend class SfxStyleSheetBasePool;
}; };
...@@ -207,7 +208,7 @@ protected: ...@@ -207,7 +208,7 @@ protected:
sal_uInt16 nMask; sal_uInt16 nMask;
SfxStyleSheetBase& Add( SfxStyleSheetBase& ); SfxStyleSheetBase& Add( SfxStyleSheetBase& );
void ChangeParent( const UniString&, const UniString&, sal_Bool bVirtual = sal_True ); void ChangeParent( const UniString&, const UniString&, bool bVirtual = true );
virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, sal_uInt16 ); virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, sal_uInt16 );
virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& ); virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& );
...@@ -247,7 +248,7 @@ public: ...@@ -247,7 +248,7 @@ public:
virtual SfxStyleSheetBase* Next(); virtual SfxStyleSheetBase* Next();
virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, sal_uInt16 n=0xFFFF ); virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, sal_uInt16 n=0xFFFF );
virtual sal_Bool SetParent(SfxStyleFamily eFam, virtual bool SetParent(SfxStyleFamily eFam,
const UniString &rStyle, const UniString &rStyle,
const UniString &rParent); const UniString &rParent);
...@@ -271,7 +272,7 @@ public: ...@@ -271,7 +272,7 @@ public:
SfxStyleSheet( const SfxStyleSheet& ); SfxStyleSheet( const SfxStyleSheet& );
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
virtual sal_Bool SetParent( const UniString& ); virtual bool SetParent( const UniString& );
protected: protected:
SfxStyleSheet() // do not use! needed by MSVC at compile time to satisfy ImplInheritanceHelper2 SfxStyleSheet() // do not use! needed by MSVC at compile time to satisfy ImplInheritanceHelper2
......
...@@ -162,7 +162,7 @@ const XubString& SfxStyleSheetBase::GetName() const ...@@ -162,7 +162,7 @@ const XubString& SfxStyleSheetBase::GetName() const
return aName; return aName;
} }
sal_Bool SfxStyleSheetBase::SetName( const XubString& rName ) bool SfxStyleSheetBase::SetName( const XubString& rName )
{ {
if(rName.Len() == 0) if(rName.Len() == 0)
return sal_False; return sal_False;
...@@ -214,10 +214,10 @@ const XubString& SfxStyleSheetBase::GetParent() const ...@@ -214,10 +214,10 @@ const XubString& SfxStyleSheetBase::GetParent() const
return aParent; return aParent;
} }
sal_Bool SfxStyleSheetBase::SetParent( const XubString& rName ) bool SfxStyleSheetBase::SetParent( const XubString& rName )
{ {
if ( rName == aName ) if ( rName == aName )
return sal_False; return false;
if( aParent != rName ) if( aParent != rName )
{ {
...@@ -225,20 +225,20 @@ sal_Bool SfxStyleSheetBase::SetParent( const XubString& rName ) ...@@ -225,20 +225,20 @@ sal_Bool SfxStyleSheetBase::SetParent( const XubString& rName )
if( rName.Len() && !pIter ) if( rName.Len() && !pIter )
{ {
OSL_FAIL( "StyleSheet-Parent nicht gefunden" ); OSL_FAIL( "StyleSheet-Parent nicht gefunden" );
return sal_False; return false;
} }
// rekursive Verknuepfungen verhindern // rekursive Verknuepfungen verhindern
if( aName.Len() ) if( aName.Len() )
while(pIter) while(pIter)
{ {
if(pIter->GetName() == aName) if(pIter->GetName() == aName)
return sal_False; return false;
pIter = pPool->Find(pIter->GetParent(), nFamily); pIter = pPool->Find(pIter->GetParent(), nFamily);
} }
aParent = rName; aParent = rName;
} }
pPool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) ); pPool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) );
return sal_True; return true;
} }
// Follow aendern // Follow aendern
...@@ -248,19 +248,19 @@ const XubString& SfxStyleSheetBase::GetFollow() const ...@@ -248,19 +248,19 @@ const XubString& SfxStyleSheetBase::GetFollow() const
return aFollow; return aFollow;
} }
sal_Bool SfxStyleSheetBase::SetFollow( const XubString& rName ) bool SfxStyleSheetBase::SetFollow( const XubString& rName )
{ {
if( aFollow != rName ) if( aFollow != rName )
{ {
if( !pPool->Find( rName, nFamily ) ) if( !pPool->Find( rName, nFamily ) )
{ {
OSL_FAIL( "StyleSheet-Follow nicht gefunden" ); OSL_FAIL( "StyleSheet-Follow nicht gefunden" );
return sal_False; return false;
} }
aFollow = rName; aFollow = rName;
} }
pPool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) ); pPool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) );
return sal_True; return true;
} }
// Itemset setzen. Die Dflt-Implementation legt ein neues Set an. // Itemset setzen. Die Dflt-Implementation legt ein neues Set an.
...@@ -291,30 +291,30 @@ void SfxStyleSheetBase::SetHelpId( const String& rFile, sal_uLong nId ) ...@@ -291,30 +291,30 @@ void SfxStyleSheetBase::SetHelpId( const String& rFile, sal_uLong nId )
// Folgevorlage m"oglich? Default: Ja // Folgevorlage m"oglich? Default: Ja
sal_Bool SfxStyleSheetBase::HasFollowSupport() const bool SfxStyleSheetBase::HasFollowSupport() const
{ {
return sal_True; return true;
} }
// Basisvorlage m"oglich? Default: Ja // Basisvorlage m"oglich? Default: Ja
sal_Bool SfxStyleSheetBase::HasParentSupport() const bool SfxStyleSheetBase::HasParentSupport() const
{ {
return sal_True; return true;
} }
// Basisvorlage uf NULL setzen m"oglich? Default: Nein // Basisvorlage uf NULL setzen m"oglich? Default: Nein
sal_Bool SfxStyleSheetBase::HasClearParentSupport() const bool SfxStyleSheetBase::HasClearParentSupport() const
{ {
return sal_False; return false;
} }
// Defaultmaessig sind alle StyleSheets Used // Defaultmaessig sind alle StyleSheets Used
sal_Bool SfxStyleSheetBase::IsUsed() const bool SfxStyleSheetBase::IsUsed() const
{ {
return sal_True; return true;
} }
// eingestellte Attribute ausgeben // eingestellte Attribute ausgeben
...@@ -361,17 +361,17 @@ SfxStyleFamily SfxStyleSheetIterator::GetSearchFamily() const ...@@ -361,17 +361,17 @@ SfxStyleFamily SfxStyleSheetIterator::GetSearchFamily() const
return nSearchFamily; return nSearchFamily;
} }
inline sal_Bool SfxStyleSheetIterator::IsTrivialSearch() inline bool SfxStyleSheetIterator::IsTrivialSearch()
{ {
return nMask == 0xFFFF && GetSearchFamily() == SFX_STYLE_FAMILY_ALL; return nMask == 0xFFFF && GetSearchFamily() == SFX_STYLE_FAMILY_ALL;
} }
sal_Bool SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle) bool SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle)
{ {
return ((GetSearchFamily() == SFX_STYLE_FAMILY_ALL) || return ((GetSearchFamily() == SFX_STYLE_FAMILY_ALL) ||
( pStyle->GetFamily() == GetSearchFamily() )) ( pStyle->GetFamily() == GetSearchFamily() ))
&& (( pStyle->GetMask() & ( GetSearchMask() & ~SFXSTYLEBIT_USED )) || && (( pStyle->GetMask() & ( GetSearchMask() & ~SFXSTYLEBIT_USED )) ||
( bSearchUsed ? pStyle->IsUsed() : sal_False ) || ( bSearchUsed ? pStyle->IsUsed() : false ) ||
GetSearchMask() == SFXSTYLEBIT_ALL ); GetSearchMask() == SFXSTYLEBIT_ALL );
} }
...@@ -581,16 +581,15 @@ SfxStyleSheetBasePool::~SfxStyleSheetBasePool() ...@@ -581,16 +581,15 @@ SfxStyleSheetBasePool::~SfxStyleSheetBasePool()
delete pImp; delete pImp;
} }
sal_Bool SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rStyle, const XubString& rParent) bool SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rStyle, const XubString& rParent)
{ {
SfxStyleSheetIterator aIter(this,eFam,SFXSTYLEBIT_ALL); SfxStyleSheetIterator aIter(this,eFam,SFXSTYLEBIT_ALL);
SfxStyleSheetBase *pStyle = SfxStyleSheetBase *pStyle = aIter.Find(rStyle);
aIter.Find(rStyle);
OSL_ENSURE(pStyle, "Vorlage nicht gefunden. Writer mit Solar <2541??"); OSL_ENSURE(pStyle, "Vorlage nicht gefunden. Writer mit Solar <2541??");
if(pStyle) if(pStyle)
return pStyle->SetParent(rParent); return pStyle->SetParent(rParent);
else else
return sal_False; return false;
} }
...@@ -807,7 +806,7 @@ void SfxStyleSheetBasePool::Clear() ...@@ -807,7 +806,7 @@ void SfxStyleSheetBasePool::Clear()
void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld, void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld,
const XubString& rNew, const XubString& rNew,
sal_Bool bVirtual) bool bVirtual)
{ {
const sal_uInt16 nTmpMask = GetSearchMask(); const sal_uInt16 nTmpMask = GetSearchMask();
SetSearchMask(GetSearchFamily(), 0xffff); SetSearchMask(GetSearchFamily(), 0xffff);
...@@ -865,10 +864,10 @@ SfxStyleSheet::~SfxStyleSheet() ...@@ -865,10 +864,10 @@ SfxStyleSheet::~SfxStyleSheet()
} }
sal_Bool SfxStyleSheet::SetParent( const XubString& rName ) bool SfxStyleSheet::SetParent( const XubString& rName )
{ {
if(aParent == rName) if(aParent == rName)
return sal_True; return true;
const XubString aOldParent(aParent); const XubString aOldParent(aParent);
if(SfxStyleSheetBase::SetParent(rName)) { if(SfxStyleSheetBase::SetParent(rName)) {
// aus der Benachrichtigungskette des alten // aus der Benachrichtigungskette des alten
...@@ -885,9 +884,9 @@ sal_Bool SfxStyleSheet::SetParent( const XubString& rName ) ...@@ -885,9 +884,9 @@ sal_Bool SfxStyleSheet::SetParent( const XubString& rName )
if(pParent) if(pParent)
StartListening(*pParent); StartListening(*pParent);
} }
return sal_True; return true;
} }
return sal_False; return false;
} }
// alle Zuhoerer benachtichtigen // alle Zuhoerer benachtichtigen
......
...@@ -130,13 +130,13 @@ public: ...@@ -130,13 +130,13 @@ public:
void PresetParent(const String& rName){ aParent = rName; } void PresetParent(const String& rName){ aParent = rName; }
void PresetFollow(const String& rName){ aFollow = rName; } void PresetFollow(const String& rName){ aFollow = rName; }
virtual sal_Bool SetName( const String& rStr); virtual bool SetName( const String& rStr);
virtual sal_Bool SetParent( const String& rStr); virtual bool SetParent( const String& rStr);
virtual sal_Bool SetFollow( const String& rStr); virtual bool SetFollow( const String& rStr);
virtual sal_Bool HasFollowSupport() const; virtual bool HasFollowSupport() const;
virtual sal_Bool HasParentSupport() const; virtual bool HasParentSupport() const;
virtual sal_Bool HasClearParentSupport() const; virtual bool HasClearParentSupport() const;
virtual String GetDescription(); virtual String GetDescription();
virtual String GetDescription(SfxMapUnit eUnit); virtual String GetDescription(SfxMapUnit eUnit);
...@@ -147,7 +147,7 @@ public: ...@@ -147,7 +147,7 @@ public:
const SwNumRule* GetNumRule(); const SwNumRule* GetNumRule();
void SetNumRule(const SwNumRule& rRule); void SetNumRule(const SwNumRule& rRule);
virtual sal_Bool IsUsed() const; virtual bool IsUsed() const;
}; };
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -204,7 +204,7 @@ public: ...@@ -204,7 +204,7 @@ public:
virtual SfxStyleSheetBase* Find( const String&, SfxStyleFamily eFam, virtual SfxStyleSheetBase* Find( const String&, SfxStyleFamily eFam,
sal_uInt16 n=0xFFFF ); sal_uInt16 n=0xFFFF );
virtual sal_Bool SetParent( SfxStyleFamily eFam, const String &rStyle, virtual bool SetParent( SfxStyleFamily eFam, const String &rStyle,
const String &rParent ); const String &rParent );
virtual void Remove( SfxStyleSheetBase* pStyle); virtual void Remove( SfxStyleSheetBase* pStyle);
......
...@@ -530,19 +530,19 @@ const String& SwDocStyleSheet::GetFollow() const ...@@ -530,19 +530,19 @@ const String& SwDocStyleSheet::GetFollow() const
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
sal_Bool SwDocStyleSheet::HasFollowSupport() const bool SwDocStyleSheet::HasFollowSupport() const
{ {
switch(nFamily) switch(nFamily)
{ {
case SFX_STYLE_FAMILY_PARA : case SFX_STYLE_FAMILY_PARA :
case SFX_STYLE_FAMILY_PAGE : return sal_True; case SFX_STYLE_FAMILY_PAGE : return true;
case SFX_STYLE_FAMILY_FRAME: case SFX_STYLE_FAMILY_FRAME:
case SFX_STYLE_FAMILY_CHAR : case SFX_STYLE_FAMILY_CHAR :
case SFX_STYLE_FAMILY_PSEUDO: return sal_False; case SFX_STYLE_FAMILY_PSEUDO: return false;
default: default:
OSL_ENSURE(!this, "unknown style family"); OSL_ENSURE(!this, "unknown style family");
} }
return sal_False; return false;
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -550,28 +550,28 @@ sal_Bool SwDocStyleSheet::HasFollowSupport() const ...@@ -550,28 +550,28 @@ sal_Bool SwDocStyleSheet::HasFollowSupport() const
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
sal_Bool SwDocStyleSheet::HasParentSupport() const bool SwDocStyleSheet::HasParentSupport() const
{ {
sal_Bool bRet = sal_False; bool bRet = false;
switch(nFamily) switch(nFamily)
{ {
case SFX_STYLE_FAMILY_CHAR : case SFX_STYLE_FAMILY_CHAR :
case SFX_STYLE_FAMILY_PARA : case SFX_STYLE_FAMILY_PARA :
case SFX_STYLE_FAMILY_FRAME: bRet = sal_True; case SFX_STYLE_FAMILY_FRAME: bRet = true;
default:; //prevent warning default:; //prevent warning
} }
return bRet; return bRet;
} }
sal_Bool SwDocStyleSheet::HasClearParentSupport() const bool SwDocStyleSheet::HasClearParentSupport() const
{ {
sal_Bool bRet = sal_False; bool bRet = false;
switch(nFamily) switch(nFamily)
{ {
case SFX_STYLE_FAMILY_PARA : case SFX_STYLE_FAMILY_PARA :
case SFX_STYLE_FAMILY_CHAR : case SFX_STYLE_FAMILY_CHAR :
case SFX_STYLE_FAMILY_FRAME: bRet = sal_True; case SFX_STYLE_FAMILY_FRAME: bRet = true;
default:; //prevent warning default:; //prevent warning
} }
return bRet; return bRet;
...@@ -758,20 +758,20 @@ String SwDocStyleSheet::GetDescription() ...@@ -758,20 +758,20 @@ String SwDocStyleSheet::GetDescription()
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
sal_Bool SwDocStyleSheet::SetName( const String& rStr) bool SwDocStyleSheet::SetName( const String& rStr)
{ {
if( !rStr.Len() ) if( !rStr.Len() )
return sal_False; return false;
if( aName != rStr ) if( aName != rStr )
{ {
if( !SfxStyleSheetBase::SetName( rStr )) if( !SfxStyleSheetBase::SetName( rStr ))
return sal_False; return false;
} }
else if(!bPhysical) else if(!bPhysical)
FillStyleSheet( FillPhysical ); FillStyleSheet( FillPhysical );
int bChg = sal_False; int bChg = false;
switch(nFamily) switch(nFamily)
{ {
case SFX_STYLE_FAMILY_CHAR : case SFX_STYLE_FAMILY_CHAR :
...@@ -780,7 +780,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) ...@@ -780,7 +780,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
if( pCharFmt && pCharFmt->GetName() != rStr ) if( pCharFmt && pCharFmt->GetName() != rStr )
{ {
pCharFmt->SetName( rStr ); pCharFmt->SetName( rStr );
bChg = sal_True; bChg = true;
} }
break; break;
} }
...@@ -794,7 +794,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) ...@@ -794,7 +794,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
else else
pColl->SetName(rStr); pColl->SetName(rStr);
bChg = sal_True; bChg = true;
} }
break; break;
} }
...@@ -808,7 +808,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) ...@@ -808,7 +808,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
else else
pFrmFmt->SetName( rStr ); pFrmFmt->SetName( rStr );
bChg = sal_True; bChg = true;
} }
break; break;
} }
...@@ -830,7 +830,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) ...@@ -830,7 +830,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
rDoc.GetIDocumentUndoRedo().DoUndo(bDoesUndo); rDoc.GetIDocumentUndoRedo().DoUndo(bDoesUndo);
rDoc.SetModified(); rDoc.SetModified();
bChg = sal_True; bChg = true;
} }
break; break;
case SFX_STYLE_FAMILY_PSEUDO: case SFX_STYLE_FAMILY_PSEUDO:
...@@ -848,7 +848,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) ...@@ -848,7 +848,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
pNumRule = rDoc.FindNumRulePtr(rStr); pNumRule = rDoc.FindNumRulePtr(rStr);
rDoc.SetModified(); rDoc.SetModified();
bChg = sal_True; bChg = true;
} }
} }
else else
...@@ -857,7 +857,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) ...@@ -857,7 +857,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
((SwNumRule*)pNumRule)->SetName( rStr, rDoc ); ((SwNumRule*)pNumRule)->SetName( rStr, rDoc );
rDoc.SetModified(); rDoc.SetModified();
bChg = sal_True; bChg = true;
} }
} }
...@@ -875,7 +875,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) ...@@ -875,7 +875,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
if( pSh ) if( pSh )
pSh->CallChgLnk(); pSh->CallChgLnk();
} }
return sal_True; return true;
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -883,7 +883,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr) ...@@ -883,7 +883,7 @@ sal_Bool SwDocStyleSheet::SetName( const String& rStr)
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
sal_Bool SwDocStyleSheet::SetParent( const String& rStr) bool SwDocStyleSheet::SetParent( const String& rStr)
{ {
SwFmt* pFmt = 0, *pParent = 0; SwFmt* pFmt = 0, *pParent = 0;
switch(nFamily) switch(nFamily)
...@@ -913,7 +913,7 @@ sal_Bool SwDocStyleSheet::SetParent( const String& rStr) ...@@ -913,7 +913,7 @@ sal_Bool SwDocStyleSheet::SetParent( const String& rStr)
OSL_ENSURE(!this, "unknown style family"); OSL_ENSURE(!this, "unknown style family");
} }
sal_Bool bRet = sal_False; bool bRet = false;
if( pFmt && pFmt->DerivedFrom() && if( pFmt && pFmt->DerivedFrom() &&
pFmt->DerivedFrom()->GetName() != rStr ) pFmt->DerivedFrom()->GetName() != rStr )
{ {
...@@ -938,10 +938,10 @@ sal_Bool SwDocStyleSheet::SetParent( const String& rStr) ...@@ -938,10 +938,10 @@ sal_Bool SwDocStyleSheet::SetParent( const String& rStr)
--------------------------------------------------------------------*/ --------------------------------------------------------------------*/
sal_Bool SwDocStyleSheet::SetFollow( const String& rStr) bool SwDocStyleSheet::SetFollow( const String& rStr)
{ {
if( rStr.Len() && !SfxStyleSheetBase::SetFollow( rStr )) if( rStr.Len() && !SfxStyleSheetBase::SetFollow( rStr ))
return sal_False; return false;
SwImplShellAction aTmpSh( rDoc ); SwImplShellAction aTmpSh( rDoc );
switch(nFamily) switch(nFamily)
...@@ -987,7 +987,7 @@ sal_Bool SwDocStyleSheet::SetFollow( const String& rStr) ...@@ -987,7 +987,7 @@ sal_Bool SwDocStyleSheet::SetFollow( const String& rStr)
OSL_ENSURE(!this, "unknwown style family"); OSL_ENSURE(!this, "unknwown style family");
} }
return sal_True; return true;
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -1843,7 +1843,7 @@ SwFrmFmt* SwDocStyleSheet::GetFrmFmt() ...@@ -1843,7 +1843,7 @@ SwFrmFmt* SwDocStyleSheet::GetFrmFmt()
return pFrmFmt; return pFrmFmt;
} }
sal_Bool SwDocStyleSheet::IsUsed() const bool SwDocStyleSheet::IsUsed() const
{ {
if( !bPhysical ) if( !bPhysical )
{ {
...@@ -1852,7 +1852,7 @@ sal_Bool SwDocStyleSheet::IsUsed() const ...@@ -1852,7 +1852,7 @@ sal_Bool SwDocStyleSheet::IsUsed() const
} }
if( !bPhysical ) if( !bPhysical )
return sal_False; return false;
const SwModify* pMod; const SwModify* pMod;
switch( nFamily ) switch( nFamily )
...@@ -1863,11 +1863,11 @@ sal_Bool SwDocStyleSheet::IsUsed() const ...@@ -1863,11 +1863,11 @@ sal_Bool SwDocStyleSheet::IsUsed() const
case SFX_STYLE_FAMILY_PAGE : pMod = pDesc; break; case SFX_STYLE_FAMILY_PAGE : pMod = pDesc; break;
case SFX_STYLE_FAMILY_PSEUDO: case SFX_STYLE_FAMILY_PSEUDO:
return pNumRule ? rDoc.IsUsed( *pNumRule ) : sal_False; return pNumRule ? rDoc.IsUsed( *pNumRule ) : false;
default: default:
OSL_ENSURE(!this, "unknown style family"); OSL_ENSURE(!this, "unknown style family");
return sal_False; return false;
} }
return rDoc.IsUsed( *pMod ); return rDoc.IsUsed( *pMod );
} }
...@@ -2230,7 +2230,7 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle) ...@@ -2230,7 +2230,7 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* pStyle)
sal_Bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam,
const String &rStyle, const String &rParent ) const String &rStyle, const String &rParent )
{ {
SwFmt* pFmt = 0, *pParent = 0; SwFmt* pFmt = 0, *pParent = 0;
...@@ -2259,7 +2259,7 @@ sal_Bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam, ...@@ -2259,7 +2259,7 @@ sal_Bool SwDocStyleSheetPool::SetParent( SfxStyleFamily eFam,
OSL_ENSURE(!this, "unknown style family"); OSL_ENSURE(!this, "unknown style family");
} }
sal_Bool bRet = sal_False; bool bRet = false;
if( pFmt && pFmt->DerivedFrom() && if( pFmt && pFmt->DerivedFrom() &&
pFmt->DerivedFrom()->GetName() != rParent ) pFmt->DerivedFrom()->GetName() != rParent )
{ {
......
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