diff options
author | Heena Gupta <heena.h.gupta@ericsson.com> | 2015-01-08 17:53:28 +0530 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-02-06 23:57:31 +0000 |
commit | 4be6e7becec9413cfd22c06376031b02486145b2 (patch) | |
tree | 6c3bd6fc38107f8ff6a1a26a8c02a40557c85563 /sfx2/source/dialog | |
parent | de896f74c805e77706cce10f4d79117af1811ee9 (diff) |
fdo#87675: Disable 'edit' when next style is same as current one.
Change-Id: Ifd149890460c44dc3eececc06a36f1b76d46929b
Reviewed-on: https://gerrit.libreoffice.org/13811
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/mgetempl.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index c9c83704073e..06e531afd637 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -82,6 +82,11 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx // this Page needs ExchangeSupport SetExchangeSupport(); + if ( aFollow == aName ) + m_pEditStyleBtn->Disable(); + else + m_pEditStyleBtn->Enable(); + ResMgr* pResMgr = SfxGetpApp()->GetModule_Impl()->GetResMgr(); OSL_ENSURE( pResMgr, "No ResMgr in Module" ); pFamilies = new SfxStyleFamilies( ResId( DLG_STYLE_DESIGNER, *pResMgr ) ); @@ -228,6 +233,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx // It is a style with auto update? (SW only) if(SfxItemState::SET == rAttrSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE)) m_pAutoCB->Show(); + m_pFollowLb->SetSelectHdl( LINK( this, SfxManageStyleSheetPage, EditStyleSelectHdl_Impl ) ); m_pEditStyleBtn->SetClickHdl( LINK( this, SfxManageStyleSheetPage, EditStyleHdl_Impl ) ); } @@ -315,6 +321,17 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl() m_pDescFt->SetText( pStyle->GetDescription( eUnit ) ); } +IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleSelectHdl_Impl ) +{ + OUString aTemplName(m_pFollowLb->GetSelectEntry()); + OUString aEditTemplName(m_pNameRo->GetText()); + if (!( aTemplName == aEditTemplName)) + m_pEditStyleBtn->Enable(); + else + m_pEditStyleBtn->Disable(); + return 0; +} + IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleHdl_Impl ) { |