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

New commits:
commit 0c5adc7926c771fbed932e02df9d8aefebd02694
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Feb 10 20:37:41 2021 +0000
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Feb 15 11:15:52 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/+/110684
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 8f75270c237b..bab7684c2f31 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;
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to