diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-05-20 12:34:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-05-21 17:21:02 +0200 |
commit | 86618248683fa4048192d15356c7e6b430e8dbb9 (patch) | |
tree | 56e8bfbb202fc09539af38e2f273d56b24baecd5 /cui | |
parent | a703b4d8842261f55f489c28352df1f53a9b070a (diff) |
tdf#109158 short-circuit text width measuring with fixed width columns
Change-Id: Id050bfa8b4dae70e2a3a45b2501bb071d82d14e5
Reviewed-on: https://gerrit.libreoffice.org/72601
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/autocdlg.hxx | 1 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 17 | ||||
-rw-r--r-- | cui/uiconfig/ui/acorreplacepage.ui | 1 |
3 files changed, 11 insertions, 8 deletions
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index 346c6a1e556c..bcb283f154e6 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -180,6 +180,7 @@ private: bool bReplaceEditChanged:1; bool bSWriter:1; + std::vector<int> m_aReplaceFixedWidths; std::unique_ptr<weld::CheckButton> m_xTextOnlyCB; std::unique_ptr<weld::Entry> m_xShortED; std::unique_ptr<weld::Entry> m_xReplaceED; diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 9e65e501740d..00c409916d42 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -680,9 +680,9 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage(TabPageParent pParent, pCompareClass->loadDefaultCollator( aLanguageTag.getLocale(), 0 ); pCharClass.reset( new CharClass( aLanguageTag ) ); - std::vector<int> aWidths; - aWidths.push_back(m_xReplaceTLB->get_approximate_digit_width() * 32); - m_xReplaceTLB->set_column_fixed_widths(aWidths); + auto nColWidth = m_xReplaceTLB->get_approximate_digit_width() * 32; + m_aReplaceFixedWidths.push_back(nColWidth); + m_aReplaceFixedWidths.push_back(nColWidth); m_xReplaceTLB->connect_changed( LINK(this, OfaAutocorrReplacePage, SelectHdl) ); m_xNewReplacePB->connect_clicked( LINK(this, OfaAutocorrReplacePage, NewDelButtonHdl) ); @@ -827,7 +827,7 @@ void OfaAutocorrReplacePage::RefillReplaceBox(bool bFromReset, { aFormatText.insert(rDouble.sShort); } - }); + }, &m_aReplaceFixedWidths); } else { @@ -853,7 +853,7 @@ void OfaAutocorrReplacePage::RefillReplaceBox(bool bFromReset, { aFormatText.insert(elem->GetShort()); } - }); + }, &m_aReplaceFixedWidths); m_xNewReplacePB->set_sensitive(false); m_xDeleteReplacePB->set_sensitive(false); } @@ -999,12 +999,13 @@ IMPL_LINK(OfaAutocorrReplacePage, NewDelActionHdl, weld::Entry&, rEdit, bool) IMPL_LINK_NOARG(OfaAutocorrReplacePage, EntrySizeAllocHdl, const Size&, void) { - std::vector<int> aWidths; + m_aReplaceFixedWidths.clear(); int x, y, width, height; if (m_xReplaceED->get_extents_relative_to(*m_xReplaceTLB, x, y, width, height)) { - aWidths.push_back(x); - m_xReplaceTLB->set_column_fixed_widths(aWidths); + m_aReplaceFixedWidths.push_back(x); + m_aReplaceFixedWidths.push_back(width - 1); + m_xReplaceTLB->set_column_fixed_widths(m_aReplaceFixedWidths); } } diff --git a/cui/uiconfig/ui/acorreplacepage.ui b/cui/uiconfig/ui/acorreplacepage.ui index 326152eb2ca8..36808eb4ec4d 100644 --- a/cui/uiconfig/ui/acorreplacepage.ui +++ b/cui/uiconfig/ui/acorreplacepage.ui @@ -85,6 +85,7 @@ <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="hscrollbar_policy">never</property> <property name="shadow_type">in</property> <child> <object class="GtkTreeView" id="tabview"> |