sc/source/ui/view/gridwin.cxx  |    8 +++++---
 sc/source/ui/view/gridwin2.cxx |    3 ++-
 sc/source/ui/view/tabview3.cxx |    4 +++-
 vcl/source/window/dockwin.cxx  |    5 ++++-
 vcl/source/window/floatwin.cxx |    2 +-
 vcl/source/window/window.cxx   |    7 +++++--
 6 files changed, 20 insertions(+), 9 deletions(-)

New commits:
commit 851560310f93f87d923f39cd0cd01aa18db03ce3
Author:     Szymon Kłos <[email protected]>
AuthorDate: Thu Mar 3 11:53:49 2022 +0100
Commit:     Szymon Kłos <[email protected]>
CommitDate: Mon Mar 14 13:21:48 2022 +0100

    lok: fix position og autofilter in RTL mode
    
    Change-Id: I73f2b003185c326f4d66c974a2e5aaecb4e0199a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130916
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Mert Tumer <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131513
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <[email protected]>

diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 80ab426aa98d..094a3ef184a2 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -509,7 +509,7 @@ tools::Rectangle 
FloatingWindow::ImplConvertToAbsPos(vcl::Window* pReference, co
 
     // compare coordinates in absolute screen coordinates
     // Keep in sync with FloatingWindow::ImplFloatHitTest, e.g. fdo#33509
-    if( pParentWinOutDev->HasMirroredGraphics()  )
+    if( pParentWinOutDev->HasMirroredGraphics() && 
!comphelper::LibreOfficeKit::isActive() )
     {
         if(!pReference->IsRTLEnabled() )
             pParentWinOutDev->ReMirror(aFloatRect);
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 152d163f3399..453bf8e2ca14 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2712,11 +2712,14 @@ void Window::setPosSizePixel( tools::Long nX, 
tools::Long nY,
             {
                 tools::Rectangle aRect( Point ( nX, nY ), Size( nWidth, 
nHeight ) );
                 const OutputDevice *pParentOutDev = pParent->GetOutDev();
-                pParentOutDev->ReMirror( aRect );
+                if (!comphelper::LibreOfficeKit::isActive())
+                    pParentOutDev->ReMirror( aRect );
                 nX = aRect.Left();
             }
         }
-        if( !(nFlags & PosSizeFlags::X) && bHasValidSize && 
pWindow->mpWindowImpl->mpFrame->maGeometry.nWidth )
+        if( !comphelper::LibreOfficeKit::isActive() &&
+            !(nFlags & PosSizeFlags::X) && bHasValidSize &&
+            pWindow->mpWindowImpl->mpFrame->maGeometry.nWidth )
         {
             // RTL: make sure the old right aligned position is not changed
             // system windows will always grow to the right
commit 68ff5bf424fd2813cb08dfa7f165e0227cb6a703
Author:     Szymon Kłos <[email protected]>
AuthorDate: Fri Feb 25 13:22:36 2022 +0100
Commit:     Szymon Kłos <[email protected]>
CommitDate: Mon Mar 14 13:21:36 2022 +0100

    lok: send logic autofilter position
    
    we need to show popup relative to the grid window
    
    Change-Id: Ib0cf66d2c0422b765a3b8035d5499b45e83f768d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130528
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Mert Tumer <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131511
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <[email protected]>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index b5c6965cbcc1..da788bc9aa5b 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -909,7 +909,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW 
nRow)
         nSizeX = nSizeX / fZoomX;
         nSizeY = nSizeY / fZoomY;
     }
-    tools::Rectangle aCellRect(OutputToScreenPixel(aPos), Size(nSizeX, 
nSizeY));
+    tools::Rectangle aCellRect(bLOKActive ? aPos : OutputToScreenPixel(aPos), 
Size(nSizeX, nSizeY));
 
     ScDBData* pDBData = rDoc.GetDBAtCursor(nCol, nRow, nTab, 
ScDBDataPortion::AREA);
     if (!pDBData)
@@ -1229,7 +1229,8 @@ void ScGridWindow::LaunchPageFieldMenu( SCCOL nCol, SCROW 
nRow )
     Point aScrPos;
     Size aScrSize;
     getCellGeometry(aScrPos, aScrSize, mrViewData, nCol, nRow, eWhich);
-    DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, 
ScAddress(nCol-1, nRow, nTab), pDPObj);
+    bool bLOK = comphelper::LibreOfficeKit::isActive();
+    DPLaunchFieldPopupMenu(bLOK ? aScrPos : OutputToScreenPixel(aScrPos), 
aScrSize, ScAddress(nCol-1, nRow, nTab), pDPObj);
 }
 
 void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW nRow )
@@ -1242,7 +1243,8 @@ void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW 
nRow )
     Point aScrPos;
     Size aScrSize;
     getCellGeometry(aScrPos, aScrSize, mrViewData, nCol, nRow, eWhich);
-    DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, 
ScAddress(nCol, nRow, nTab), pDPObj);
+    bool bLOK = comphelper::LibreOfficeKit::isActive();
+    DPLaunchFieldPopupMenu(bLOK ? aScrPos : OutputToScreenPixel(aScrPos), 
aScrSize, ScAddress(nCol, nRow, nTab), pDPObj);
 }
 
 void ScGridWindow::ShowFilterMenu(weld::Window* pParent, const 
tools::Rectangle& rCellRect, bool bLayoutRTL)
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 7071bd384f4b..4e497e80d664 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -343,6 +343,7 @@ bool ScGridWindow::DPTestFieldPopupArrow(
     const MouseEvent& rMEvt, const ScAddress& rPos, const ScAddress& rDimPos, 
ScDPObject* pDPObj)
 {
     bool bLayoutRTL = mrViewData.GetDocument().IsLayoutRTL( 
mrViewData.GetTabNo() );
+    bool bLOK = comphelper::LibreOfficeKit::isActive();
 
     // Get the geometry of the cell.
     Point aScrPos = mrViewData.GetScrPos(rPos.Col(), rPos.Row(), eWhich);
@@ -361,7 +362,7 @@ bool ScGridWindow::DPTestFieldPopupArrow(
     if (aRect.Contains(rMEvt.GetPosPixel()))
     {
         // Mouse cursor inside the popup arrow box.  Launch the field menu.
-        DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, 
rDimPos, pDPObj);
+        DPLaunchFieldPopupMenu(bLOK ? aScrPos : OutputToScreenPixel(aScrPos), 
aScrSize, rDimPos, pDPObj);
         return true;
     }
 
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 2133abda414e..98d28453aca1 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2615,7 +2615,9 @@ void ScTabView::DoDPFieldPopup(std::u16string_view 
rPivotTableName, sal_Int32 nD
 
     pDPObject->BuildAllDimensionMembers();
 
-    Point aScreenPoint = pWin->OutputToScreenPixel(pWin->LogicToPixel(aPoint));
+    Point aPos = pWin->LogicToPixel(aPoint);
+    bool bLOK = comphelper::LibreOfficeKit::isActive();
+    Point aScreenPoint = bLOK ? aPos : pWin->OutputToScreenPixel(aPos);
     Size aScreenSize = pWin->LogicToPixel(aSize);
 
     pWin->DPLaunchFieldPopupMenu(aScreenPoint, aScreenSize, nDimensionIndex, 
pDPObject);
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 99c4f1bba398..f94a04cbb1d8 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -27,6 +27,7 @@
 #include <vcl/timer.hxx>
 #include <vcl/idle.hxx>
 #include <vcl/settings.hxx>
+#include <comphelper/lok.hxx>
 
 #include <accel.hxx>
 #include <svdata.hxx>
@@ -923,7 +924,9 @@ Point DockingWindow::GetFloatingPos() const
             aData.SetMask( WindowStateMask::Pos );
             pWrapper->mpFloatWin->GetWindowStateData( aData );
             Point aPos( aData.GetX(), aData.GetY() );
-            aPos = 
pWrapper->mpFloatWin->GetParent()->ImplGetFrameWindow()->AbsoluteScreenToOutputPixel(
 aPos );
+            // LOK needs logic coordinates not absolute screen position for 
autofilter menu
+            if (!comphelper::LibreOfficeKit::isActive() || get_id() != 
"check_list_menu")
+                aPos = 
pWrapper->mpFloatWin->GetParent()->ImplGetFrameWindow()->AbsoluteScreenToOutputPixel(
 aPos );
             return aPos;
         }
         else

Reply via email to