sc/source/ui/view/tabview4.cxx |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

New commits:
commit a9d1324b1dbf4a74ee0b02859eb3197005df1bb2
Author:     Bayram Çiçek <bayram.ci...@collabora.com>
AuthorDate: Fri Oct 4 20:19:33 2024 +0300
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Nov 2 20:04:50 2024 +0100

    use row&column address for autofill preview popup
    
    Signed-off-by: Bayram Çiçek <bayram.ci...@collabora.com>
    Change-Id: I2206f13210f57db27d962f931ec9b1ced5ec8cf7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174502
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit 2a3053921ee67e305130fc3dee6278c00f737e92)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175917
    Tested-by: Jenkins

diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 8d1f1c871110..2352f732befd 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -315,23 +315,17 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, 
SCTAB nCurZ )
 
         if (comphelper::LibreOfficeKit::isActive())
         {
-            double nPPTX = aViewData.GetPPTX();
-            double nPPTY = aViewData.GetPPTY();
+            // we need to use nAddX and nAddX here because we need the next 
row&column address
+            OUString sCol = OUString::number(nEndX + nAddX);
+            OUString sRow = OUString::number(nEndY + nAddY);
 
-            OString sRectangleString = "EMPTY"_ostr;
-            if (!aTipRectangle.IsEmpty())
-            {
-                // selection start handle
-                tools::Rectangle aLogicRectangle(
-                    aTipRectangle.Left() / nPPTX, aTipRectangle.Top() / nPPTY,
-                    aTipRectangle.Right() / nPPTX, aTipRectangle.Bottom() / 
nPPTY);
-                sRectangleString = aLogicRectangle.toString();
-            }
+            // since start and end cells are the same, duplicate them
+            OUString sCellAddress = OUString::Concat(sCol + " " + sRow + " " + 
sCol + " " + sRow);
 
             tools::JsonWriter writer;
             writer.put("type", "autofillpreviewtooltip");
             writer.put("text", sTipString);
-            writer.put("location", sRectangleString);
+            writer.put("celladdress", sCellAddress);
             OString sPayloadString = writer.finishAndGetAsOString();
             ScTabViewShell* pViewShell = aViewData.GetViewShell();
             pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, 
sPayloadString);

Reply via email to