Kaydet (Commit) 038634b6 authored tarafından Caolán McNamara's avatar Caolán McNamara

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/67819
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 465fb025
...@@ -130,6 +130,8 @@ private: ...@@ -130,6 +130,8 @@ private:
void SetFillAndTabType_Impl(); void SetFillAndTabType_Impl();
void NewHdl_Impl(const weld::Button*); void NewHdl_Impl(const weld::Button*);
OUString FormatTab();
// Handler // Handler
DECL_LINK(NewHdl_Impl, weld::Button&, void); DECL_LINK(NewHdl_Impl, weld::Button&, void);
DECL_LINK(DelHdl_Impl, weld::Button&, void); DECL_LINK(DelHdl_Impl, weld::Button&, void);
......
...@@ -434,6 +434,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(const weld::Button* pBtn) ...@@ -434,6 +434,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(const weld::Button* pBtn)
{ {
// Add a new one and select it // Add a new one and select it
// Get the value from the display // Get the value from the display
ReformatHdl_Impl(*m_xTabBox);
m_xTabSpin->set_text(m_xTabBox->get_active_text()); m_xTabSpin->set_text(m_xTabBox->get_active_text());
auto nVal = m_xTabSpin->denormalize(m_xTabSpin->get_value(eDefUnit)); auto nVal = m_xTabSpin->denormalize(m_xTabSpin->get_value(eDefUnit));
...@@ -488,8 +489,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(const weld::Button* pBtn) ...@@ -488,8 +489,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(const weld::Button* pBtn)
int SvxTabulatorTabPage::FindCurrentTab() int SvxTabulatorTabPage::FindCurrentTab()
{ {
ReformatHdl_Impl(*m_xTabBox); return m_xTabBox->find_text(FormatTab());
return m_xTabBox->find_text(m_xTabBox->get_active_text());
} }
IMPL_LINK_NOARG(SvxTabulatorTabPage, DelHdl_Impl, weld::Button&, void) IMPL_LINK_NOARG(SvxTabulatorTabPage, DelHdl_Impl, weld::Button&, void)
...@@ -632,11 +632,16 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, SelectHdl_Impl, weld::TreeView&, 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_text(m_xTabBox->get_active_text());
m_xTabSpin->set_value(m_xTabSpin->get_value(FieldUnit::NONE), FieldUnit::NONE); m_xTabSpin->reformat();
m_xTabBox->set_entry_text(m_xTabSpin->get_text()); 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) IMPL_LINK_NOARG(SvxTabulatorTabPage, ModifyHdl_Impl, weld::ComboBox&, void)
...@@ -649,7 +654,6 @@ 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()); m_xTabSpin->set_text(m_xTabBox->get_active_text());
aCurrentTab.GetTabPos() = m_xTabSpin->denormalize(m_xTabSpin->get_value(eDefUnit)); aCurrentTab.GetTabPos() = m_xTabSpin->denormalize(m_xTabSpin->get_value(eDefUnit));
m_xNewBtn->set_sensitive(false); m_xNewBtn->set_sensitive(false);
m_xDelBtn->set_sensitive(true); m_xDelBtn->set_sensitive(true);
return; return;
......
...@@ -1096,7 +1096,7 @@ public: ...@@ -1096,7 +1096,7 @@ public:
// typically you only need to call this if set_text (e.g. with "") was // typically you only need to call this if set_text (e.g. with "") was
// previously called to display some arbitrary text instead of the // previously called to display some arbitrary text instead of the
// formatted value and now you want to show it as formatted again // formatted value and now you want to show it as formatted again
void reformat() { set_value(get_value(m_eSrcUnit), m_eSrcUnit); } void reformat() { spin_button_output(*m_xSpinButton); }
void set_range(int min, int max, FieldUnit eValueUnit) void set_range(int min, int max, FieldUnit eValueUnit)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment