summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svl/source/items/style.cxx16
-rw-r--r--sw/source/ui/app/docstyle.cxx17
2 files changed, 25 insertions, 8 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;
}
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index f6f96f879be2..cae4c506b10f 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -2532,6 +2532,9 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
if( ( !bSearchHidden && pFmt->IsHidden() && !bUsed ) || ( pFmt->IsDefault() && pFmt != rDoc.GetDfltCharFmt() ) )
continue;
+ if ( nSrchMask == SFXSTYLEBIT_HIDDEN && !pFmt->IsHidden( ) )
+ continue;
+
if( !bUsed )
{
// Standard is no User template
@@ -2609,6 +2612,9 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
if ( ( !bSearchHidden && pColl->IsHidden( ) && !bUsed ) || pColl->IsDefault() )
continue;
+ if ( nSMask == SFXSTYLEBIT_HIDDEN && !pColl->IsHidden( ) )
+ continue;
+
if( !(bIsSearchUsed && bUsed ))
{
const sal_uInt16 nId = pColl->GetPoolFmtId();
@@ -2750,9 +2756,10 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
bool bUsed = bIsSearchUsed && ( bOrganizer || rDoc.IsUsed(*pFmt));
if( ( !bSearchHidden && pFmt->IsHidden( ) && !bUsed ) || pFmt->IsDefault() || pFmt->IsAuto() )
- {
continue;
- }
+
+ if ( nSrchMask == SFXSTYLEBIT_HIDDEN && !pFmt->IsHidden( ) )
+ continue;
const sal_uInt16 nId = pFmt->GetPoolFmtId();
if( !bUsed )
@@ -2795,6 +2802,9 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
continue;
}
+ if ( nSrchMask == SFXSTYLEBIT_HIDDEN && !rDesc.IsHidden( ) )
+ continue;
+
aLst.Append( cPAGE, rDesc.GetName() );
}
if ( bAll )
@@ -2811,6 +2821,9 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
const SwNumRule& rRule = *rNumTbl[ i ];
if( !rRule.IsAutoRule() )
{
+ if ( nSrchMask == SFXSTYLEBIT_HIDDEN && !rRule.IsHidden( ) )
+ continue;
+
bool bUsed = bIsSearchUsed && ( bOrganizer || rDoc.IsUsed(rRule) );
if( !bUsed )
{