[Libreoffice-commits] core.git: starmath/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 21 18:44:33 UTC 2021
starmath/source/ElementsDockingWindow.cxx | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
New commits:
commit 12ea51ba8bfbc1d22feb2e4d498360eec015859e
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Apr 21 16:57:32 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Apr 21 20:43:46 2021 +0200
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 at redhat.com>
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)
{
More information about the Libreoffice-commits
mailing list