diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-03-10 11:13:17 +0000 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2023-03-12 18:51:28 +0000 |
commit | c5460594c21bab12db2d5a6601db84ea9726c416 (patch) | |
tree | 9c83db3889aa0c331c82968f70643b9c31e0c7eb /svx | |
parent | 1bc139baf020ac840010d5d0dab6ce1452eb36d7 (diff) |
Resolves: tdf#154087 update scrollbar range when search criteria change
Change-Id: Iaf5f20c8952b15f3dcccb65277dadb171a705605
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148607
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/searchcharmap.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx index 034ebd317a5a..2d8eeaab8967 100644 --- a/svx/source/dialog/searchcharmap.cxx +++ b/svx/source/dialog/searchcharmap.cxx @@ -307,9 +307,7 @@ void SvxSearchCharSet::RecalculateFont(vcl::RenderContext& rRenderContext) nX = aSize.Width() / COLUMN_COUNT; nY = aSize.Height() / ROW_COUNT; - //scrollbar settings -- error - int nLastRow = (nCount - 1 + COLUMN_COUNT) / COLUMN_COUNT; - mxScrollArea->vadjustment_configure(mxScrollArea->vadjustment_get_value(), 0, nLastRow, 1, ROW_COUNT - 1, ROW_COUNT); + UpdateScrollRange(); // rearrange CharSet element in sync with nX- and nY-multiples Size aDrawSize(nX * COLUMN_COUNT, nY * ROW_COUNT); @@ -319,6 +317,13 @@ void SvxSearchCharSet::RecalculateFont(vcl::RenderContext& rRenderContext) mbRecalculateFont = false; } +void SvxSearchCharSet::UpdateScrollRange() +{ + //scrollbar settings + int nLastRow = (nCount - 1 + COLUMN_COUNT) / COLUMN_COUNT; + mxScrollArea->vadjustment_configure(mxScrollArea->vadjustment_get_value(), 0, nLastRow, 1, ROW_COUNT - 1, ROW_COUNT); +} + void SvxSearchCharSet::SelectIndex(int nNewIndex, bool bFocus) { if (!mxFontCharMap.is()) |