summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-03-10 11:13:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-03-10 15:18:34 +0000
commite6230bbfc9526af65e6618390593c3a3c90743d0 (patch)
treed12ea4607c257aad90061e3b71aee49c16b2a5b3 /svx
parent531a462f3110b70a6ba56db336dffbb270276013 (diff)
Resolves: tdf#154087 update scrollbar range when search criteria change
Change-Id: Iaf5f20c8952b15f3dcccb65277dadb171a705605 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148606 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/searchcharmap.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx
index e15ec15da2c7..c5ae90dbf052 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -329,9 +329,7 @@ void SvxSearchCharSet::RecalculateFont(vcl::RenderContext& rRenderContext)
nX = aSize.Width() / COLUMN_COUNT;
nY = aSize.Height() / ROW_COUNT;
- //scrollbar settings -- error
- int nLastRow = (getMaxCharCount() - 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);
@@ -341,6 +339,13 @@ void SvxSearchCharSet::RecalculateFont(vcl::RenderContext& rRenderContext)
mbRecalculateFont = false;
}
+void SvxSearchCharSet::UpdateScrollRange()
+{
+ //scrollbar settings
+ int nLastRow = (getMaxCharCount() - 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())