[Libreoffice-commits] core.git: sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jan 6 13:31:12 UTC 2020
sw/source/ui/chrdlg/numpara.cxx | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
New commits:
commit dcab1993ed29a408a704cfddbbd15dc7dd8ffc80
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jan 6 10:48:34 2020 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Jan 6 14:30:37 2020 +0100
Resolves: tdf#129527 enable/disable edit-style button at the right time
Change-Id: I70b14ad8d96a2564c06a47608e5cf2c438cf7d38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86264
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index fcabb9bb525b..8a43e389fb3a 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -66,12 +66,7 @@ SwParagraphNumTabPage::SwParagraphNumTabPage(weld::Container* pPage, weld::Dialo
m_xNewStartNumberCB->set_state(TRISTATE_FALSE);
m_xCountParaCB->set_state(TRISTATE_FALSE);
m_xRestartParaCountCB->set_state(TRISTATE_FALSE);
-
- int numSelectPos = m_xNumberStyleLB->get_active();
- if (numSelectPos == 0)
- m_xEditNumStyleBtn->set_sensitive(false);
- else
- m_xEditNumStyleBtn->set_sensitive(true);
+ m_xEditNumStyleBtn->set_sensitive(false);
const SfxPoolItem* pItem;
SfxObjectShell* pObjSh;
@@ -213,6 +208,8 @@ void SwParagraphNumTabPage::Reset(const SfxItemSet* rSet)
m_xNumberStyleLB->set_active(-1);
}
+ EditNumStyleSelectHdl_Impl(*m_xNumberStyleLB);
+
m_xNumberStyleLB->save_value();
eItemState = rSet->GetItemState( FN_NUMBER_NEWSTART );
@@ -301,7 +298,8 @@ IMPL_LINK_NOARG(SwParagraphNumTabPage, LineCountHdl_Impl, weld::ToggleButton&, v
IMPL_LINK_NOARG(SwParagraphNumTabPage, EditNumStyleSelectHdl_Impl, weld::ComboBox&, void)
{
int numSelectPos = m_xNumberStyleLB->get_active();
- if (numSelectPos == 0)
+ // 0 is "None" and -1 is unselected state
+ if (numSelectPos == 0 || numSelectPos == -1)
m_xEditNumStyleBtn->set_sensitive(false);
else
m_xEditNumStyleBtn->set_sensitive(true);
More information about the Libreoffice-commits
mailing list