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>
This commit is contained in:
committed by
Michael Stahl
parent
de896f74c8
commit
4be6e7bece
@@ -70,6 +70,7 @@ friend class SfxStyleDialog;
|
|||||||
|
|
||||||
DECL_LINK( GetFocusHdl, Edit * );
|
DECL_LINK( GetFocusHdl, Edit * );
|
||||||
DECL_LINK( LoseFocusHdl, Edit * );
|
DECL_LINK( LoseFocusHdl, Edit * );
|
||||||
|
DECL_LINK( EditStyleSelectHdl_Impl, void * );
|
||||||
DECL_LINK( EditStyleHdl_Impl, void * );
|
DECL_LINK( EditStyleHdl_Impl, void * );
|
||||||
|
|
||||||
void UpdateName_Impl(ListBox *, const OUString &rNew);
|
void UpdateName_Impl(ListBox *, const OUString &rNew);
|
||||||
|
@@ -82,6 +82,11 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
|
|||||||
// this Page needs ExchangeSupport
|
// this Page needs ExchangeSupport
|
||||||
SetExchangeSupport();
|
SetExchangeSupport();
|
||||||
|
|
||||||
|
if ( aFollow == aName )
|
||||||
|
m_pEditStyleBtn->Disable();
|
||||||
|
else
|
||||||
|
m_pEditStyleBtn->Enable();
|
||||||
|
|
||||||
ResMgr* pResMgr = SfxGetpApp()->GetModule_Impl()->GetResMgr();
|
ResMgr* pResMgr = SfxGetpApp()->GetModule_Impl()->GetResMgr();
|
||||||
OSL_ENSURE( pResMgr, "No ResMgr in Module" );
|
OSL_ENSURE( pResMgr, "No ResMgr in Module" );
|
||||||
pFamilies = new SfxStyleFamilies( ResId( DLG_STYLE_DESIGNER, *pResMgr ) );
|
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)
|
// It is a style with auto update? (SW only)
|
||||||
if(SfxItemState::SET == rAttrSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE))
|
if(SfxItemState::SET == rAttrSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE))
|
||||||
m_pAutoCB->Show();
|
m_pAutoCB->Show();
|
||||||
|
m_pFollowLb->SetSelectHdl( LINK( this, SfxManageStyleSheetPage, EditStyleSelectHdl_Impl ) );
|
||||||
m_pEditStyleBtn->SetClickHdl( LINK( this, SfxManageStyleSheetPage, EditStyleHdl_Impl ) );
|
m_pEditStyleBtn->SetClickHdl( LINK( this, SfxManageStyleSheetPage, EditStyleHdl_Impl ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,6 +321,17 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl()
|
|||||||
m_pDescFt->SetText( pStyle->GetDescription( eUnit ) );
|
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 )
|
IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditStyleHdl_Impl )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -102,11 +102,7 @@
|
|||||||
<object class="GtkButton" id="editstyle">
|
<object class="GtkButton" id="editstyle">
|
||||||
<property name="label" translatable="yes">Edit Style</property>
|
<property name="label" translatable="yes">Edit Style</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="can_default">True</property>
|
|
||||||
<property name="has_default">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">2</property>
|
<property name="left_attach">2</property>
|
||||||
|
Reference in New Issue
Block a user