diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-08-13 17:03:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-08-14 16:33:31 +0200 |
commit | bfd3f939325e53c9dc85d2486316927c2b34eaf8 (patch) | |
tree | 48ddf478fcf1e8b97ac2fe6c003e13675fcdc51e | |
parent | solenv: fix typo in CppunitTest (diff) | |
download | core-bfd3f939325e53c9dc85d2486316927c2b34eaf8.tar.gz core-bfd3f939325e53c9dc85d2486316927c2b34eaf8.zip |
tdf#135693 rerun the callbacks on inconsistency just once
Change-Id: I250cf11b816e91b521378c132e4ee8065956bb73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100679
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/ui/table/tabledlg.cxx | 9 | ||||
-rw-r--r-- | sw/source/uibase/table/tablepg.hxx | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 9e2259e6ad65..77cf26c43042 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -267,7 +267,7 @@ IMPL_LINK( SwFormatTablePage, ValueChangedHdl, weld::MetricSpinButton&, rEdit, v ModifyHdl(rEdit); } -void SwFormatTablePage::ModifyHdl(const weld::MetricSpinButton& rEdit) +void SwFormatTablePage::ModifyHdl(const weld::MetricSpinButton& rEdit, bool bAllowInconsistencies) { SwTwips nCurWidth = static_cast< SwTwips >(m_xWidthMF->DenormalizePercent(m_xWidthMF->get_value(FieldUnit::TWIP))); SwTwips nPrevWidth = nCurWidth; @@ -371,9 +371,10 @@ void SwFormatTablePage::ModifyHdl(const weld::MetricSpinButton& rEdit) // tdf#135021 if the user changed the width spinbutton, and in this // ModifyHdl we changed the value of that width spinbutton, then rerun // the ModifyHdl on the replaced value so the left/right/width value - // relationships are consistent - if (&rEdit == m_xWidthMF->get()) - ModifyHdl(rEdit); + // relationships are consistent. + // But (tdf#135693) only make one effort of rectifying the inconsistency + if (&rEdit == m_xWidthMF->get() && !bAllowInconsistencies) + ModifyHdl(rEdit, true); } bModified = true; diff --git a/sw/source/uibase/table/tablepg.hxx b/sw/source/uibase/table/tablepg.hxx index 60e8938e6b39..adfee146e03c 100644 --- a/sw/source/uibase/table/tablepg.hxx +++ b/sw/source/uibase/table/tablepg.hxx @@ -69,7 +69,7 @@ class SwFormatTablePage : public SfxTabPage int m_nOrigRightMax; void Init(); - void ModifyHdl(const weld::MetricSpinButton& rEdit); + void ModifyHdl(const weld::MetricSpinButton& rEdit, bool bAllowInconsistencies = false); DECL_LINK(AutoClickHdl, weld::ToggleButton&, void); DECL_LINK(RelWidthClickHdl, weld::ToggleButton&, void); |