diff options
author | Heena Gupta <heena.h.gupta@ericsson.com> | 2015-02-17 15:56:55 +0530 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-09 09:36:19 +0000 |
commit | 704d946cdc56b6d3188b2ae49d20778b78aac8b2 (patch) | |
tree | c20e9fc891741c8fe70cd48551223b55fbbecafb /sw | |
parent | fecdbcab90c0373e0c172835f237d86baed6d1bb (diff) |
Relate: tdf#88045 Edit Numbering Style Button is nonclickable for None Entry
Conflicts:
sw/source/ui/chrdlg/numpara.cxx
Change-Id: I3e2c493d412c8e7974e7cb314eb0ba8f13edb6b6
Reviewed-on: https://gerrit.libreoffice.org/14518
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/chrdlg/numpara.cxx | 21 | ||||
-rw-r--r-- | sw/source/uibase/inc/numpara.hxx | 1 |
2 files changed, 20 insertions, 2 deletions
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index 4156186396a3..29429aa16da0 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -72,6 +72,12 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(vcl::Window* pParent, const SfxItem get(m_pRestartBX, "boxRESTART_NO"); get(m_pRestartNF, "spinNF_RESTART_PARA"); + sal_Int32 numSelectPos = m_pNumberStyleLB->GetSelectEntryPos(); + if ( numSelectPos == 0 ) + m_pEditNumStyleBtn->Disable(); + else + m_pEditNumStyleBtn->Enable(); + const SfxPoolItem* pItem; SfxObjectShell* pObjSh; if(SfxItemState::SET == rAttr.GetItemState(SID_HTML_MODE, false, &pItem) || @@ -89,6 +95,7 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(vcl::Window* pParent, const SfxItem m_pNumberStyleLB->SetSelectHdl(LINK(this, SwParagraphNumTabPage, StyleHdl_Impl)); m_pCountParaCB->SetClickHdl(LINK(this, SwParagraphNumTabPage, LineCountHdl_Impl)); m_pRestartParaCountCB->SetClickHdl( LINK(this, SwParagraphNumTabPage, LineCountHdl_Impl)); + m_pNumberStyleLB->SetSelectHdl( LINK( this, SwParagraphNumTabPage, EditNumStyleSelectHdl_Impl ) ); m_pEditNumStyleBtn->SetClickHdl( LINK(this, SwParagraphNumTabPage, EditNumStyleHdl_Impl)); } @@ -294,11 +301,21 @@ IMPL_LINK_NOARG(SwParagraphNumTabPage, LineCountHdl_Impl) return 0; } +IMPL_LINK_NOARG( SwParagraphNumTabPage, EditNumStyleSelectHdl_Impl ) +{ + sal_Int32 numSelectPos = m_pNumberStyleLB->GetSelectEntryPos(); + if ( numSelectPos == 0 ) + m_pEditNumStyleBtn->Disable(); + else + m_pEditNumStyleBtn->Enable(); + + return 0; +} + IMPL_LINK_NOARG(SwParagraphNumTabPage, EditNumStyleHdl_Impl) { OUString aTemplName(m_pNumberStyleLB->GetSelectEntry()); - if (aTemplName != "None") - ExecuteEditNumStyle_Impl( SID_STYLE_EDIT, aTemplName, OUString(),SFX_STYLE_FAMILY_PARA, 0 ); + ExecuteEditNumStyle_Impl( SID_STYLE_EDIT, aTemplName, OUString(),SFX_STYLE_FAMILY_PARA, 0 ); return 0; } diff --git a/sw/source/uibase/inc/numpara.hxx b/sw/source/uibase/inc/numpara.hxx index 8ddd0fc945d1..ab84db3e5cda 100644 --- a/sw/source/uibase/inc/numpara.hxx +++ b/sw/source/uibase/inc/numpara.hxx @@ -57,6 +57,7 @@ class SwParagraphNumTabPage : public SfxTabPage DECL_LINK( StyleHdl_Impl, ListBox* ); DECL_LINK(LineCountHdl_Impl, void *); DECL_LINK(EditNumStyleHdl_Impl, void *); + DECL_LINK(EditNumStyleSelectHdl_Impl, void *); static const sal_uInt16 aPageRg[]; |