sc/source/ui/view/gridwin.cxx |   21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

New commits:
commit 98e92c15855d2faf3021c0e3b3987997f49b9b85
Author:     Rafael Lima <rafael.palma.l...@gmail.com>
AuthorDate: Thu Aug 22 16:26:55 2024 +0200
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Sat Aug 31 08:06:08 2024 +0200

    tdf#161709 Remove extra space between cursor and cell edges
    
    Change-Id: Icfdb88928b0d9f076a3c6190c241825ef918d5a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172266
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>
    Tested-by: Jenkins
    Reviewed-by: Rafael Lima <rafael.palma.l...@gmail.com>
    Tested-by: Heiko Tietze <heiko.tie...@documentfoundation.org>
    (cherry picked from commit 3b4a8406c2e7f4f6a7ac43e192fdb8ef266d4b6d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172566
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 6766aae5d0d615445eda55077c0e94514b4c25d4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172571
    Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 272ed144cff9..239b014cd5c9 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -6623,17 +6623,11 @@ void ScGridWindow::UpdateCursorOverlay()
             tools::Long nSizeYPix;
             mrViewData.GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
 
-            // tdf#143733 Make cell outline wider than the cell
-            const double fZoom(mrViewData.GetZoomX());
-            const sal_uInt16 nAdjustBorder(2 + fZoom / 2);
-            aScrPos.AdjustX(-nAdjustBorder);
-            aScrPos.AdjustY(-nAdjustBorder);
-
             if (bLayoutRTL)
                 aScrPos.AdjustX( -(nSizeXPix - 2) );       // move instead of 
mirroring
 
             // show the cursor as 4 (thin) rectangles
-            tools::Rectangle aRect(aScrPos, Size(nSizeXPix + 2*nAdjustBorder, 
nSizeYPix + 2*nAdjustBorder));
+            tools::Rectangle aRect(aScrPos, Size(nSizeXPix, nSizeYPix));
 
             float fScaleFactor = GetDPIScaleFactor();
 
@@ -6957,10 +6951,7 @@ void ScGridWindow::UpdateAutoFillOverlay()
     tools::Long nSizeYPix;
     mrViewData.GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
 
-    // tdf#161234 Make AutoFill handle follow cell outline. This happens only 
when the
-    // autofill handle is in the same cell as the outline. Note that 
nAdjustBorder needs
-    // to be calculated the same way as in ScGridWindow::UpdateCursorOverlay()
-    double nAdjustBorder(0);
+    // Consider the case of merged cells to determine where to place the 
AutoFill handle
     SCCOL nX2 = mrViewData.GetCurX();
     SCCOL nY2 = mrViewData.GetCurY();
     const ScMergeAttr* pMerge = rDoc.GetAttr(nX2, nY2, nTab, ATTR_MERGE);
@@ -6969,15 +6960,13 @@ void ScGridWindow::UpdateAutoFillOverlay()
         nX2 += pMerge->GetColMerge() - 1;
         nY2 += pMerge->GetRowMerge() - 1;
     }
-    if (nX == nX2 && nY == nY2)
-        nAdjustBorder = std::round(2 + 
static_cast<double>(mrViewData.GetZoomX()) / 2);
 
     if (bLayoutRTL && !comphelper::LibreOfficeKit::isActive())
-        aFillPos.AdjustX( -(nSizeXPix + nAdjustBorder + 
(aFillHandleSize.Width() / 2)) );
+        aFillPos.AdjustX( -(nSizeXPix + (aFillHandleSize.Width() / 2)) );
     else
-        aFillPos.AdjustX(nSizeXPix + nAdjustBorder - (aFillHandleSize.Width() 
/ 2) );
+        aFillPos.AdjustX(nSizeXPix - (aFillHandleSize.Width() / 2) );
 
-    aFillPos.AdjustY(nSizeYPix + nAdjustBorder);
+    aFillPos.AdjustY(nSizeYPix);
     aFillPos.AdjustY( -(aFillHandleSize.Height() / 2) );
 
     tools::Rectangle aFillRect(aFillPos, aFillHandleSize);

Reply via email to