[Libreoffice-commits] core.git: vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 14 20:25:43 UTC 2018


 vcl/source/window/dialog.cxx |    8 ++++++--
 vcl/source/window/layout.cxx |    4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 20b2903354138f8ab19261fab74658fcf6af70e3
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 14 09:19:57 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Nov 14 21:25:19 2018 +0100

    Resolves: tdf#121229 ignore internal children of VclScrolledWindow
    
    Change-Id: Iecc474db8093520ba2d90aedfc5da66507f3033b
    Reviewed-on: https://gerrit.libreoffice.org/63357
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index e7acc9e530cf..b426ad39a613 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -130,7 +130,9 @@ vcl::Window * nextLogicalChildOfParent(const vcl::Window *pTopLevel, const vcl::
 {
     const vcl::Window *pLastChild = pChild;
 
-    if (isContainerWindow(*pChild))
+    if (pChild->GetType() == WindowType::SCROLLWINDOW)
+        pChild = static_cast<const VclScrolledWindow*>(pChild)->get_child();
+    else if (isContainerWindow(*pChild))
         pChild = pChild->GetWindow(GetWindowType::FirstChild);
     else
         pChild = pChild->GetWindow(GetWindowType::Next);
@@ -156,7 +158,9 @@ vcl::Window * prevLogicalChildOfParent(const vcl::Window *pTopLevel, const vcl::
 {
     const vcl::Window *pLastChild = pChild;
 
-    if (isContainerWindow(*pChild))
+    if (pChild->GetType() == WindowType::SCROLLWINDOW)
+        pChild = static_cast<const VclScrolledWindow*>(pChild)->get_child();
+    else if (isContainerWindow(*pChild))
         pChild = pChild->GetWindow(GetWindowType::LastChild);
     else
         pChild = pChild->GetWindow(GetWindowType::Prev);
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 9c5a8c89dc0e..837d429c82b5 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1578,9 +1578,9 @@ vcl::Window *VclFrame::get_label_widget()
 
 const vcl::Window *VclFrame::get_child() const
 {
-    assert(GetChildCount() == 2);
     //The child widget is the normally the last (of two) children
     const WindowImpl* pWindowImpl = ImplGetWindowImpl();
+    assert(GetChildCount() == 2 || pWindowImpl->mbInDispose);
     if (!m_pLabel)
         return pWindowImpl->mpLastChild;
     if (pWindowImpl->mpFirstChild == pWindowImpl->mpLastChild) //only label exists
@@ -1858,8 +1858,8 @@ IMPL_LINK_NOARG(VclScrolledWindow, ScrollBarHdl, ScrollBar*, void)
 
 const vcl::Window *VclScrolledWindow::get_child() const
 {
-    assert(GetChildCount() == 4);
     const WindowImpl* pWindowImpl = ImplGetWindowImpl();
+    assert(GetChildCount() == 4 || pWindowImpl->mbInDispose);
     return pWindowImpl->mpLastChild;
 }
 


More information about the Libreoffice-commits mailing list