From 2fd9c2bf9af0c50dae3af3dbe5e22965ccdb4ae7 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Sun, 25 Nov 2012 15:24:42 +0100 Subject: Allow to hide styles in the "Styles & Formating" dialog In its current state, the feature only hides the styles. Things to sort out are: + Add some automatic filter to show hidden styles + Make the visibility persist in the file format Change-Id: I5904f41bb567add7b6bf501c6c5297f9f149a915 --- sd/sdi/_drvwsh.sdi | 7 +++++++ sd/sdi/outlnvsh.sdi | 7 +++++++ sd/source/ui/func/futempl.cxx | 11 +++++++++-- sd/source/ui/view/drviewsc.cxx | 1 + sd/source/ui/view/outlnvsh.cxx | 3 +++ 5 files changed, 27 insertions(+), 2 deletions(-) (limited to 'sd') diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index fc2f01eb9da7..0fabae44e060 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -1366,6 +1366,13 @@ interface DrawView GroupId = GID_DOCUMENT ; Cachable ; ] + SID_STYLE_HIDE + [ + ExecMethod = FuTemporary ; + StateMethod = GetAttrState ; + GroupId = GID_DOCUMENT ; + Cachable ; + ] SID_STYLE_APPLY // ole : no, status : ? [ ExecMethod = FuTemporary ; diff --git a/sd/sdi/outlnvsh.sdi b/sd/sdi/outlnvsh.sdi index ec06d37e6994..6632f09f6feb 100644 --- a/sd/sdi/outlnvsh.sdi +++ b/sd/sdi/outlnvsh.sdi @@ -326,6 +326,13 @@ interface OutlineView GroupId = GID_DOCUMENT ; Cachable ; ] + SID_STYLE_HIDE + [ + ExecMethod = FuTemporary ; + StateMethod = GetAttrState ; + GroupId = GID_DOCUMENT ; + Cachable ; + ] SID_AUTOSPELL_CHECK // ole : no, status : play rec [ ExecMethod = FuSupport ; diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index 1326e5102576..f1d9feae1487 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -128,13 +128,14 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) } String aStyleName; - sal_uInt16 nRetMask = 0xffff; + sal_uInt16 nRetMask = SFXSTYLEBIT_ALL; switch( nSId ) { case SID_STYLE_APPLY: case SID_STYLE_EDIT: case SID_STYLE_DELETE: + case SID_STYLE_HIDE: case SID_STYLE_FAMILY: case SID_STYLE_NEW_BY_EXAMPLE: { @@ -225,6 +226,12 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) } break; + case SID_STYLE_HIDE: + pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily); + pStyleSheet->SetHidden( true ); + nRetMask = sal_True; + break; + case SID_STYLE_APPLY: // Anwenden der Vorlage auf das Dokument pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily); @@ -666,7 +673,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) break; } - if( nRetMask != 0xffff ) + if( nRetMask != SFXSTYLEBIT_ALL ) rReq.SetReturnValue( SfxUInt16Item( nSId, nRetMask ) ); } diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx index cfecc20f072b..9074fc2fa502 100644 --- a/sd/source/ui/view/drviewsc.cxx +++ b/sd/source/ui/view/drviewsc.cxx @@ -539,6 +539,7 @@ void DrawViewShell::FuTemp03(SfxRequest& rReq) case SID_STYLE_APPLY: case SID_STYLE_EDIT: case SID_STYLE_DELETE: + case SID_STYLE_HIDE: case SID_STYLE_FAMILY: case SID_STYLE_WATERCAN: case SID_STYLE_UPDATE_BY_EXAMPLE: diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 2b52207e13fa..881722dbd3ee 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1518,6 +1518,7 @@ sal_Bool OutlineViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) Invalidate(SID_STYLE_EDIT); Invalidate(SID_STYLE_NEW); Invalidate(SID_STYLE_DELETE); + Invalidate(SID_STYLE_HIDE); Invalidate(SID_STYLE_UPDATE_BY_EXAMPLE); Invalidate(SID_STYLE_NEW_BY_EXAMPLE); Invalidate(SID_STYLE_WATERCAN); @@ -1710,6 +1711,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_NEW: case SID_STYLE_DELETE: + case SID_STYLE_HIDE: case SID_STYLE_NEW_BY_EXAMPLE: case SID_STYLE_WATERCAN: { @@ -1740,6 +1742,7 @@ void OutlineViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin Invalidate(SID_STYLE_EDIT); Invalidate(SID_STYLE_NEW); Invalidate(SID_STYLE_DELETE); + Invalidate(SID_STYLE_HIDE); Invalidate(SID_STYLE_UPDATE_BY_EXAMPLE); Invalidate(SID_STYLE_NEW_BY_EXAMPLE); Invalidate(SID_STYLE_WATERCAN); -- cgit v1.2.3