summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/mgetempl.hxx1
-rw-r--r--sfx2/source/dialog/mgetempl.cxx17
2 files changed, 18 insertions, 0 deletions
diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
index 818243b0999f..eded8ba18751 100644
--- a/include/sfx2/mgetempl.hxx
+++ b/include/sfx2/mgetempl.hxx
@@ -73,6 +73,7 @@ friend class SfxStyleDialog;
DECL_LINK( LoseFocusHdl, Edit * );
DECL_LINK( EditStyleSelectHdl_Impl, void * );
DECL_LINK( EditStyleHdl_Impl, void * );
+ DECL_LINK( EditLinkStyleSelectHdl_Impl, void * );
DECL_LINK( EditLinkStyleHdl_Impl, void * );
void UpdateName_Impl(ListBox *, const OUString &rNew);
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index fdd626da9f1f..fc1d7dbb9246 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -88,6 +88,12 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
else
m_pEditStyleBtn->Enable();
+ sal_Int32 linkSelectPos = m_pBaseLb->GetSelectEntryPos();
+ if ( linkSelectPos == 0 )
+ m_pEditLinkStyleBtn->Disable();
+ else
+ m_pEditLinkStyleBtn->Enable();
+
ResMgr* pResMgr = SfxGetpApp()->GetModule_Impl()->GetResMgr();
OSL_ENSURE( pResMgr, "No ResMgr in Module" );
pFamilies = new SfxStyleFamilies( ResId( DLG_STYLE_DESIGNER, *pResMgr ) );
@@ -235,6 +241,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
if(SfxItemState::SET == rAttrSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE))
m_pAutoCB->Show();
m_pFollowLb->SetSelectHdl( LINK( this, SfxManageStyleSheetPage, EditStyleSelectHdl_Impl ) );
+ m_pBaseLb->SetSelectHdl( LINK( this, SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl ) );
m_pEditStyleBtn->SetClickHdl( LINK( this, SfxManageStyleSheetPage, EditStyleHdl_Impl ) );
m_pEditLinkStyleBtn->SetClickHdl( LINK( this, SfxManageStyleSheetPage, EditLinkStyleHdl_Impl ) );
}
@@ -346,6 +353,16 @@ IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleHdl_Impl )
}
+IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl )
+{
+ sal_Int32 linkSelectPos = m_pBaseLb->GetSelectEntryPos();
+ if ( linkSelectPos == 0 )
+ m_pEditLinkStyleBtn->Disable();
+ else
+ m_pEditLinkStyleBtn->Enable();
+ return 0;
+}
+
IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditLinkStyleHdl_Impl )
{
OUString aTemplName(m_pBaseLb->GetSelectEntry());