summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-21 16:57:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-04-21 20:43:46 +0200
commit12ea51ba8bfbc1d22feb2e4d498360eec015859e (patch)
tree5ef7f0ab5461a5254be89e8ea8d50e6bca26fa57
parentd7673fe5128a8b9b4ae49782e817d4c8b56706e4 (diff)
Related: tdf#140659 off by one indexes because scrollbar is now outside
and not inside the control so it doesn't need to be accounted for as a child Change-Id: I77b55ec8d9b515850817417664df8944b4e44204 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114448 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--starmath/source/ElementsDockingWindow.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 5c43b4f7f8bb..aef1d2598d60 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -285,7 +285,7 @@ SmElementsControl::SmElementsControl(std::unique_ptr<weld::ScrolledWindow> xScro
: mpDocShell(new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT))
, m_nCurrentElement(SAL_MAX_UINT16)
, m_nCurrentRolloverElement(SAL_MAX_UINT16)
- , m_nCurrentOffset(1) // Default offset of 1 due to the ScrollBar child
+ , m_nCurrentOffset(0)
, m_nSmSyntaxVersion(SM_MOD()->GetConfig()->GetDefaultSmSyntaxVersion())
, mbVerticalMode(true)
, mxScroll(std::move(xScrolledWindow))
@@ -1014,7 +1014,7 @@ void SmElementsControl::addElements(const SmElementDescr aElementsArray[], sal_u
void SmElementsControl::build()
{
// The order is important!
- // 1. Ensure there are no items left, including the default scrollbar!
+ // 1. Ensure there are no items left
// 2. Release all the current accessible items.
// This will check for new items after releasing them!
// 3. Set the cursor element
@@ -1029,9 +1029,7 @@ void SmElementsControl::build()
setCurrentElement(SAL_MAX_UINT16);
- // The first element is the scrollbar. We can't change its indexInParent
- // value, as this is set by being a child of the SmElementsControl.
- m_nCurrentOffset = 1;
+ m_nCurrentOffset = 0;
switch(m_nSmSyntaxVersion)
{