diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-11-30 14:27:56 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-11-30 18:07:12 +0100 |
commit | 1d6b6298199c2809de49f68714834aa94fb0143e (patch) | |
tree | 50906e391b1740adbb9d0735b3cde9496e9dea08 /svl | |
parent | 715d79bcc59d68c77dc84a1038998dd873df92e9 (diff) |
Fixed style iterators filters to show only hidden styles when required
Change-Id: I60d4dff4fc6eabc3882361457e19ae66f148d114
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/style.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 153edb84240b..6df5bfa71b6e 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -375,15 +375,19 @@ inline bool SfxStyleSheetIterator::IsTrivialSearch() bool SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle) { + bool bMatchFamily = ((GetSearchFamily() == SFX_STYLE_FAMILY_ALL) || + ( pStyle->GetFamily() == GetSearchFamily() )); + + bool bUsed = bSearchUsed ? pStyle->IsUsed( ) : false; + bool bSearchHidden = ( GetSearchMask() & SFXSTYLEBIT_HIDDEN ); - bool bMatchVisibility = bSearchHidden || !pStyle->IsHidden(); + bool bMatchVisibility = !( !bSearchHidden && pStyle->IsHidden() && !bUsed ); + bool bOnlyHidden = GetSearchMask( ) == SFXSTYLEBIT_HIDDEN && pStyle->IsHidden( ); - bool bMatches = ((GetSearchFamily() == SFX_STYLE_FAMILY_ALL) || - ( pStyle->GetFamily() == GetSearchFamily() )) + bool bMatches = bMatchFamily && bMatchVisibility && (( pStyle->GetMask() & ( GetSearchMask() & ~SFXSTYLEBIT_USED )) || - ( bSearchUsed ? pStyle->IsUsed() : false ) || - ( GetSearchMask() & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE ) - && bMatchVisibility; + bUsed || bOnlyHidden || + ( GetSearchMask() & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE ); return bMatches; } |