diff options
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/dialog/dialog.hrc | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/dialog.src | 7 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 23 | ||||
-rw-r--r-- | sfx2/source/dialog/tplcitem.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/inc/templdgi.hxx | 4 |
5 files changed, 37 insertions, 1 deletions
diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc index 80e04d87adf2..2cc86dad63c6 100644 --- a/sfx2/source/dialog/dialog.hrc +++ b/sfx2/source/dialog/dialog.hrc @@ -27,6 +27,7 @@ #define ID_EDIT 2 #define ID_DELETE 3 #define ID_HIDE 4 +#define ID_SHOW 5 #define RC_DIALOG_BEGIN RID_SFX_DIALOG_START diff --git a/sfx2/source/dialog/dialog.src b/sfx2/source/dialog/dialog.src index 4bcd140ce007..27f50e0bfd08 100644 --- a/sfx2/source/dialog/dialog.src +++ b/sfx2/source/dialog/dialog.src @@ -82,7 +82,12 @@ Menu MN_CONTEXT_TEMPLDLG MenuItem { Identifier = ID_HIDE ; - Text [ en-US ] = "Hide..." ; + Text [ en-US ] = "Hide" ; + }; + MenuItem + { + Identifier = ID_SHOW ; + Text [ en-US ] = "Show" ; }; MenuItem { diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index cb19f5017f1d..d497711dac72 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -764,6 +764,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx bCanDel ( sal_False ), bCanNew ( sal_True ), bCanHide ( sal_True ), + bCanShow ( sal_False ), bWaterDisabled ( sal_False ), bNewByExampleDisabled ( sal_False ), bUpdateByExampleDisabled( sal_False ), @@ -810,6 +811,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Mod bCanDel ( sal_False ), bCanNew ( sal_True ), bCanHide ( sal_True ), + bCanShow ( sal_False ), bWaterDisabled ( sal_False ), bNewByExampleDisabled ( sal_False ), bUpdateByExampleDisabled( sal_False ), @@ -1070,11 +1072,13 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const String &rStr) bool bReadWrite = !(pStyle->GetMask() & SFXSTYLEBIT_READONLY); EnableEdit( bReadWrite ); EnableHide( bReadWrite && !pStyle->IsHidden( ) && !pStyle->IsUsed( ) ); + EnableShow( bReadWrite && pStyle->IsHidden( ) ); } else { EnableEdit( sal_False ); EnableHide( sal_False ); + EnableShow( sal_False ); } if ( pTreeBox ) @@ -1120,6 +1124,7 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const String &rStr) aFmtLb.SelectAll( sal_False ); EnableEdit(sal_False); EnableHide( sal_False ); + EnableShow( sal_False ); } } } @@ -1595,11 +1600,13 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint bool bReadWrite = !(pStyle->GetMask() & SFXSTYLEBIT_READONLY); EnableEdit( bReadWrite ); EnableHide( bReadWrite && !pStyle->IsUsed( ) && !pStyle->IsHidden( ) ); + EnableShow( bReadWrite && pStyle->IsHidden( ) ); } else { EnableEdit(sal_False); EnableHide(sal_False); + EnableShow(sal_False); } } } @@ -2074,6 +2081,20 @@ void SfxCommonTemplateDialog_Impl::HideHdl(void *) } } +void SfxCommonTemplateDialog_Impl::ShowHdl(void *) +{ + if ( IsInitialized() && HasSelectedStyle() ) + { + const String aTemplName( GetSelectedEntry() ); + SfxStyleSheetBase* pStyle = GetSelectedStyle(); + if ( pStyle ) + { + Execute_Impl( SID_STYLE_SHOW, aTemplName, + String(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() ); + } + } +} + //------------------------------------------------------------------------- void SfxCommonTemplateDialog_Impl::EnableDelete() @@ -2191,6 +2212,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, MenuSelectHdl, Menu *, pMenu ) case ID_EDIT: EditHdl(0); break; case ID_DELETE: DeleteHdl(0); break; case ID_HIDE: HideHdl(0); break; + case ID_SHOW: ShowHdl(0); break; default: return sal_False; } return sal_True; @@ -2250,6 +2272,7 @@ PopupMenu* SfxCommonTemplateDialog_Impl::CreateContextMenu( void ) pMenu->EnableItem( ID_DELETE, bCanDel ); pMenu->EnableItem( ID_NEW, bCanNew ); pMenu->EnableItem( ID_HIDE, bCanHide ); + pMenu->EnableItem( ID_SHOW, bCanShow ); return pMenu; } diff --git a/sfx2/source/dialog/tplcitem.cxx b/sfx2/source/dialog/tplcitem.cxx index 314a39a09c33..064435e2166f 100644 --- a/sfx2/source/dialog/tplcitem.cxx +++ b/sfx2/source/dialog/tplcitem.cxx @@ -121,6 +121,9 @@ void SfxTemplateControllerItem::StateChanged( sal_uInt16 nSID, SfxItemState eSta case SID_STYLE_HIDE: rTemplateDlg.EnableHide( SFX_ITEM_DISABLED != eState ); break; + case SID_STYLE_SHOW: + rTemplateDlg.EnableShow( SFX_ITEM_DISABLED != eState ); + break; case SID_STYLE_NEW_BY_EXAMPLE: rTemplateDlg.EnableExample_Impl( diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index 821695a1db81..3363e58ed4c7 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -159,6 +159,7 @@ protected: bCanDel :1, bCanNew :1, bCanHide :1, + bCanShow :1, bWaterDisabled :1, bNewByExampleDisabled :1, bUpdateByExampleDisabled:1, @@ -188,6 +189,7 @@ protected: void EditHdl( void* ); void DeleteHdl( void* ); void HideHdl( void* ); + void ShowHdl( void* ); sal_Bool Execute_Impl( sal_uInt16 nId, const String& rStr, const String& rRefStr, sal_uInt16 nFamily, sal_uInt16 nMask = 0, @@ -237,6 +239,7 @@ public: virtual void EnableDel( sal_Bool b = sal_True ) { bCanDel = b; } virtual void EnableNew( sal_Bool b = sal_True ) { bCanNew = b; } virtual void EnableHide( sal_Bool b = sal_True ) { bCanHide = b; } + virtual void EnableShow( sal_Bool b = sal_True ) { bCanShow = b; } ISfxTemplateCommon* GetISfxTemplateCommon() { return &aISfxTemplateCommon; } Window* GetWindow() { return pWindow; } @@ -254,6 +257,7 @@ public: inline sal_Bool CanDel( void ) const { return bCanDel; } inline sal_Bool CanNew( void ) const { return bCanNew; } inline sal_Bool CanHide( void ) const { return bCanHide; } + inline sal_Bool CanShow( void ) const { return bCanShow; } // normaly for derivates from SvTreeListBoxes, but in this case the dialog handles context menus virtual PopupMenu* CreateContextMenu( void ); |