summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-11-30 11:51:46 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-11-30 18:07:12 +0100
commit715d79bcc59d68c77dc84a1038998dd873df92e9 (patch)
treeea5d16b5cf2f62a3c252d6b559bc6f36ff1692d3
parent2fd9c2bf9af0c50dae3af3dbe5e22965ccdb4ae7 (diff)
Styles & Formatting: added SFXSTYLEBIT_ALL_VISIBLE and show hidden styles
Change-Id: Ie74ec3c15ba270afd0a6864bd5824a5bc0e3ea8b
-rw-r--r--sc/source/ui/styleui/scstyles.src4
-rw-r--r--sd/source/ui/app/res_bmp.src6
-rw-r--r--sfx2/source/dialog/templdlg.cxx8
-rw-r--r--svl/inc/svl/style.hrc13
-rw-r--r--svl/source/items/style.cxx8
-rw-r--r--sw/source/ui/app/app.src15
-rw-r--r--sw/source/ui/app/docstyle.cxx13
7 files changed, 40 insertions, 27 deletions
diff --git a/sc/source/ui/styleui/scstyles.src b/sc/source/ui/styleui/scstyles.src
index 2e28aa2b801e..5f2a0906d41f 100644
--- a/sc/source/ui/styleui/scstyles.src
+++ b/sc/source/ui/styleui/scstyles.src
@@ -37,7 +37,8 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
StyleFamily = SFX_STYLE_FAMILY_PARA ;
FilterList [ en-US ] =
{
- < "All Styles" ; SFXSTYLEBIT_ALL ; > ;
+ < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
< "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
< "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
@@ -50,6 +51,7 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
FilterList [ en-US ] =
{
< "All Styles" ; SFXSTYLEBIT_ALL ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
< "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
Text [ en-US ] = "Page Styles" ;
diff --git a/sd/source/ui/app/res_bmp.src b/sd/source/ui/app/res_bmp.src
index c38add267032..d828a9b690ba 100644
--- a/sd/source/ui/app/res_bmp.src
+++ b/sd/source/ui/app/res_bmp.src
@@ -267,7 +267,8 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
StyleFamily = SFX_STYLE_FAMILY_PARA ;
FilterList [ en-US ] =
{
- < "All Styles" ; SFXSTYLEBIT_ALL ; > ;
+ < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
< "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
< "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
@@ -278,7 +279,8 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
StyleFamily = SFX_STYLE_FAMILY_PSEUDO ;
FilterList [ en-US ] =
{
- < "All Styles" ; SFXSTYLEBIT_ALL ; > ;
+ < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
};
};
};
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 25ea1ba1ff33..cb19f5017f1d 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1064,7 +1064,7 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const String &rStr)
if ( !pItem )
return;
const SfxStyleFamily eFam = pItem->GetFamily();
- SfxStyleSheetBase* pStyle = pStyleSheetPool->Find( rStr, eFam, SFXSTYLEBIT_ALL | SFXSTYLEBIT_HIDDEN );
+ SfxStyleSheetBase* pStyle = pStyleSheetPool->Find( rStr, eFam, SFXSTYLEBIT_ALL );
if( pStyle )
{
bool bReadWrite = !(pStyle->GetMask() & SFXSTYLEBIT_READONLY);
@@ -1170,7 +1170,7 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox()
if(pStyleSheetPool && nActFamily != 0xffff)
{
const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
- pStyleSheetPool->SetSearchMask(pItem->GetFamily(), SFXSTYLEBIT_ALL);
+ pStyleSheetPool->SetSearchMask(pItem->GetFamily(), SFXSTYLEBIT_ALL_VISIBLE);
StyleTreeArr_Impl aArr;
SfxStyleSheetBase *pStyle = pStyleSheetPool->First();
if(pStyle && pStyle->HasParentSupport() && bTreeDrag )
@@ -1589,7 +1589,7 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint
const SfxStyleFamily eFam = pItem->GetFamily();
SfxStyleSheetBase *pStyle =
pStyleSheetPool->Find(
- aStr, eFam, SFXSTYLEBIT_ALL | SFXSTYLEBIT_HIDDEN );
+ aStr, eFam, SFXSTYLEBIT_ALL );
if( pStyle )
{
bool bReadWrite = !(pStyle->GetMask() & SFXSTYLEBIT_READONLY);
@@ -2090,7 +2090,7 @@ void SfxCommonTemplateDialog_Impl::EnableDelete()
if(!nFilter) // automatic
nFilter = nAppFilter;
const SfxStyleSheetBase *pStyle =
- pStyleSheetPool->Find(aTemplName,eFam, pTreeBox? SFXSTYLEBIT_ALL | SFXSTYLEBIT_HIDDEN : nFilter);
+ pStyleSheetPool->Find(aTemplName,eFam, pTreeBox? SFXSTYLEBIT_ALL : nFilter);
OSL_ENSURE(pStyle, "Style ot found");
if(pStyle && pStyle->IsUserDefined())
diff --git a/svl/inc/svl/style.hrc b/svl/inc/svl/style.hrc
index ae08df4c2c76..d4988400083a 100644
--- a/svl/inc/svl/style.hrc
+++ b/svl/inc/svl/style.hrc
@@ -19,11 +19,12 @@
#ifndef _SFX_STYLE_HRC
#define _SFX_STYLE_HRC
-#define SFXSTYLEBIT_AUTO 0x0000 // automatisch; Flags kommen von der Applikation
-#define SFXSTYLEBIT_HIDDEN 0x0200 // benutzte Vorlage (als Suchmaske)
-#define SFXSTYLEBIT_READONLY 0x2000 // benutzte Vorlage (als Suchmaske)
-#define SFXSTYLEBIT_USED 0x4000 // benutzte Vorlage (als Suchmaske)
-#define SFXSTYLEBIT_USERDEF 0x8000 // benutzerdefinierte Vorlage
-#define SFXSTYLEBIT_ALL 0xFDFF // alle Vorlagen
+#define SFXSTYLEBIT_AUTO 0x0000 // automatisch; Flags kommen von der Applikation
+#define SFXSTYLEBIT_HIDDEN 0x0200 // benutzte Vorlage (als Suchmaske)
+#define SFXSTYLEBIT_READONLY 0x2000 // benutzte Vorlage (als Suchmaske)
+#define SFXSTYLEBIT_USED 0x4000 // benutzte Vorlage (als Suchmaske)
+#define SFXSTYLEBIT_USERDEF 0x8000 // benutzerdefinierte Vorlage
+#define SFXSTYLEBIT_ALL_VISIBLE 0xFDFF // alle Vorlagen
+#define SFXSTYLEBIT_ALL 0xFFFF // alle Vorlagen
#endif
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 15deda60bdc8..153edb84240b 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -369,7 +369,8 @@ SfxStyleFamily SfxStyleSheetIterator::GetSearchFamily() const
inline bool SfxStyleSheetIterator::IsTrivialSearch()
{
- return nMask == SFXSTYLEBIT_ALL && GetSearchFamily() == SFX_STYLE_FAMILY_ALL;
+ return ( nMask & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE
+ && GetSearchFamily() == SFX_STYLE_FAMILY_ALL;
}
bool SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle)
@@ -381,7 +382,7 @@ bool SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle)
( pStyle->GetFamily() == GetSearchFamily() ))
&& (( pStyle->GetMask() & ( GetSearchMask() & ~SFXSTYLEBIT_USED )) ||
( bSearchUsed ? pStyle->IsUsed() : false ) ||
- GetSearchMask() == SFXSTYLEBIT_ALL )
+ ( GetSearchMask() & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE )
&& bMatchVisibility;
return bMatches;
}
@@ -393,7 +394,8 @@ SfxStyleSheetIterator::SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase,
pBasePool=pBase;
nSearchFamily=eFam;
bSearchUsed=sal_False;
- if((n != SFXSTYLEBIT_ALL ) && ((n & SFXSTYLEBIT_USED) == SFXSTYLEBIT_USED))
+ if( (( n & SFXSTYLEBIT_ALL_VISIBLE ) != SFXSTYLEBIT_ALL_VISIBLE )
+ && ((n & SFXSTYLEBIT_USED) == SFXSTYLEBIT_USED))
{
bSearchUsed = sal_True;
n &= ~SFXSTYLEBIT_USED;
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index d56012d7df65..2af7888aef49 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -92,7 +92,8 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
StyleFamily = SFX_STYLE_FAMILY_PARA ;
FilterList [ en-US ] =
{
- < "All Styles" ; SFXSTYLEBIT_ALL ; > ;
+ < "All Styles" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
< "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
< "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
< "Automatic" ; SFXSTYLEBIT_AUTO ; > ;
@@ -111,7 +112,8 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
StyleFamily = SFX_STYLE_FAMILY_CHAR ;
FilterList [ en-US ] =
{
- < "All" ; SFXSTYLEBIT_ALL ; > ;
+ < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
< "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
< "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
@@ -122,7 +124,8 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
StyleFamily = SFX_STYLE_FAMILY_FRAME ;
FilterList [ en-US ] =
{
- < "All" ; SFXSTYLEBIT_ALL ; > ;
+ < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
< "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
< "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
@@ -133,7 +136,8 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
StyleFamily = SFX_STYLE_FAMILY_PAGE ;
FilterList [ en-US ] =
{
- < "All" ; SFXSTYLEBIT_ALL ; > ;
+ < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
< "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
< "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
@@ -143,7 +147,8 @@ SfxStyleFamilies DLG_STYLE_DESIGNER
StyleFamily = SFX_STYLE_FAMILY_PSEUDO ;
FilterList [ en-US ] =
{
- < "All" ; SFXSTYLEBIT_ALL ; > ;
+ < "All" ; SFXSTYLEBIT_ALL_VISIBLE ; > ;
+ < "Hidden Styles" ; SFXSTYLEBIT_HIDDEN ; > ;
< "Applied Styles" ; SFXSTYLEBIT_USED ; > ;
< "Custom Styles" ; SFXSTYLEBIT_USERDEF ; > ;
};
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index e881cb1f4ac8..f6f96f879be2 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -2518,6 +2518,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
bool bSearchHidden = ( nMask & SFXSTYLEBIT_HIDDEN );
const sal_Bool bOrganizer = ((SwDocStyleSheetPool*)pBasePool)->IsOrganizerMode();
+ bool bAll = ( nSrchMask & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE;
if( nSearchFamily == SFX_STYLE_FAMILY_CHAR
|| nSearchFamily == SFX_STYLE_FAMILY_ALL )
@@ -2561,7 +2562,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
// PoolFormate
//
- if( nSrchMask == SFXSTYLEBIT_ALL )
+ if( bAll )
{
if( !rDoc.get(IDocumentSettingAccess::HTML_MODE) )
AppendStyleList(SwStyleNameMapper::GetChrFmtUINameArray(),
@@ -2589,7 +2590,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
if( rDoc.get(IDocumentSettingAccess::HTML_MODE) )
{
// then only HTML-Template are of interest
- if( SFXSTYLEBIT_ALL == nSMask )
+ if( SFXSTYLEBIT_ALL_VISIBLE == ( nSMask & SFXSTYLEBIT_ALL_VISIBLE ) )
nSMask = SWSTYLEBIT_HTML | SFXSTYLEBIT_USERDEF |
SFXSTYLEBIT_USED;
else
@@ -2675,7 +2676,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
aLst.Append( cPARA, pColl->GetName() );
}
- const sal_Bool bAll = nSMask == SFXSTYLEBIT_ALL;
+ bAll = ( nSMask & SFXSTYLEBIT_ALL_VISIBLE ) == SFXSTYLEBIT_ALL_VISIBLE;
if ( bAll || (nSMask & ~SFXSTYLEBIT_USED) == SWSTYLEBIT_TEXT )
AppendStyleList(SwStyleNameMapper::GetTextUINameArray(),
bIsSearchUsed, bSearchHidden, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, cPARA );
@@ -2770,7 +2771,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
// PoolFormate
//
- if ( nSrchMask == SFXSTYLEBIT_ALL )
+ if ( bAll )
AppendStyleList(SwStyleNameMapper::GetFrmFmtUINameArray(),
bIsSearchUsed, bSearchHidden, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, cFRAME);
}
@@ -2796,7 +2797,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
aLst.Append( cPAGE, rDesc.GetName() );
}
- if ( nSrchMask == SFXSTYLEBIT_ALL )
+ if ( bAll )
AppendStyleList(SwStyleNameMapper::GetPageDescUINameArray(),
bIsSearchUsed, bSearchHidden, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, cPAGE);
}
@@ -2824,7 +2825,7 @@ SfxStyleSheetBase* SwStyleSheetIterator::First()
aLst.Append( cNUMRULE, rRule.GetName() );
}
}
- if ( nSrchMask == SFXSTYLEBIT_ALL )
+ if ( bAll )
AppendStyleList(SwStyleNameMapper::GetNumRuleUINameArray(),
bIsSearchUsed, bSearchHidden, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE, cNUMRULE);
}