diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-02-14 12:36:29 +0000 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2019-03-04 16:43:45 +0100 |
commit | a5a6e9c8021d547943ad8085873b82ec68136c18 (patch) | |
tree | b96ed2fef3186e509b290f8f7c9f25ba58f37462 /cui | |
parent | 233c9a12fd578e9a518cf6841d186f2f884d594d (diff) |
Resolves: tdf#123426 don't reformat tabstop pos while editing
we want to know what it would format as, but we don't want to do
the formatting during typing
Change-Id: I817798adf5b3f9325682f43b92fe107659803b4f
Reviewed-on: https://gerrit.libreoffice.org/67820
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/tabstpge.hxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/tabstpge.cxx | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx index d244064b5c67..e79cfc767949 100644 --- a/cui/source/inc/tabstpge.hxx +++ b/cui/source/inc/tabstpge.hxx @@ -130,6 +130,8 @@ private: void SetFillAndTabType_Impl(); void NewHdl_Impl(weld::Button*); + OUString FormatTab(); + // Handler DECL_LINK(NewHdl_Impl, weld::Button&, void); DECL_LINK(DelHdl_Impl, weld::Button&, void); diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index 8220e0b19d04..d47645ee4801 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -434,6 +434,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(weld::Button* pBtn) { // Add a new one and select it // Get the value from the display + ReformatHdl_Impl(*m_xTabBox); m_xTabSpin->set_text(m_xTabBox->get_active_text()); auto nVal = m_xTabSpin->denormalize(m_xTabSpin->get_value(eDefUnit)); @@ -488,8 +489,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(weld::Button* pBtn) int SvxTabulatorTabPage::FindCurrentTab() { - ReformatHdl_Impl(*m_xTabBox); - return m_xTabBox->find_text(m_xTabBox->get_active_text()); + return m_xTabBox->find_text(FormatTab()); } IMPL_LINK_NOARG(SvxTabulatorTabPage, DelHdl_Impl, weld::Button&, void) @@ -632,11 +632,16 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, SelectHdl_Impl, weld::TreeView&, void) } } -IMPL_LINK_NOARG(SvxTabulatorTabPage, ReformatHdl_Impl, weld::Widget&, void) +OUString SvxTabulatorTabPage::FormatTab() { m_xTabSpin->set_text(m_xTabBox->get_active_text()); - m_xTabSpin->set_value(m_xTabSpin->get_value(FieldUnit::NONE), FieldUnit::NONE); - m_xTabBox->set_entry_text(m_xTabSpin->get_text()); + m_xTabSpin->reformat(); + return m_xTabSpin->get_text(); +} + +IMPL_LINK_NOARG(SvxTabulatorTabPage, ReformatHdl_Impl, weld::Widget&, void) +{ + m_xTabBox->set_entry_text(FormatTab()); } IMPL_LINK_NOARG(SvxTabulatorTabPage, ModifyHdl_Impl, weld::ComboBox&, void) @@ -649,7 +654,6 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, ModifyHdl_Impl, weld::ComboBox&, void) m_xTabSpin->set_text(m_xTabBox->get_active_text()); aCurrentTab.GetTabPos() = m_xTabSpin->denormalize(m_xTabSpin->get_value(eDefUnit)); - m_xNewBtn->set_sensitive(false); m_xDelBtn->set_sensitive(true); return; |