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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 11 11:39:19 UTC 2021


 vcl/source/control/tabctrl.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit bd5eedd14069fa859bad25d4e126c244074d5f94
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Feb 10 20:37:41 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Feb 11 12:38:34 2021 +0100

    ImplGetTabRect(ImplTabItem*) variant always returns 0 with default args
    
    so TabControl::GetPageId(const Point& rPos) doesn't work
    
    since...
    
    commit 6540912ae1a570fd8c2318f77b757e07b87c0707
    Date:   Sun Jun 16 21:41:31 2019 +0000
    
    VCL merge most of NotebookbarTabControlBase
    
    Change-Id: Ia99911e753dbe2bb22dc892c6bddc0392fab97a1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110728
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 6579613dbd62..c4cb34ef5fae 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -1787,9 +1787,10 @@ sal_uInt16 TabControl::GetPagePos( sal_uInt16 nPageId ) const
 
 sal_uInt16 TabControl::GetPageId( const Point& rPos ) const
 {
+    Size winSize = Control::GetOutputSizePixel();
     const auto &rList = mpTabCtrlData->maItemList;
-    const auto it = std::find_if(rList.begin(), rList.end(), [&rPos, this](const auto &item) {
-        return const_cast<TabControl*>(this)->ImplGetTabRect(&item).IsInside(rPos); });
+    const auto it = std::find_if(rList.begin(), rList.end(), [&rPos, &winSize, this](const auto &item) {
+        return const_cast<TabControl*>(this)->ImplGetTabRect(&item, winSize.Width(), winSize.Height()).IsInside(rPos); });
     return (it != rList.end()) ? it->id() : 0;
 }
 


More information about the Libreoffice-commits mailing list