sc/source/ui/view/gridwin2.cxx |   26 ++++++++++++++++----------
 sc/source/ui/view/tabview.cxx  |    1 +
 2 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit 8ae1c4b6408d6601d73fa7b688b52e1f01513e4f
Author:     Marco Cecchetti <marco.cecche...@collabora.com>
AuthorDate: Sun Oct 20 13:38:56 2019 +0200
Commit:     Marco Cecchetti <marco.cecche...@collabora.com>
CommitDate: Fri Mar 6 10:39:51 2020 +0100

    lok: on calc spelling context menu didn't pop up
    
    The problem has been fixed by making visible cell range syncronized
    with client visible area
    
    Change-Id: I632f8ef4d5e8fa227b55fcb0459ed89d10798134
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89856
    Tested-by: Jenkins
    Reviewed-by: Marco Cecchetti <marco.cecche...@collabora.com>

diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 83143de0c18b..3f99c3d193bb 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -596,6 +596,17 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
     aFunc.UpdatePivotTable(*pDPObj, true, false);
 }
 
+namespace {
+
+template <typename T>
+inline
+T lcl_getValidValue(T value, T defvalue)
+{
+    return (value <0) ? defvalue : value;
+}
+
+} // anonymous namespace
+
 bool ScGridWindow::UpdateVisibleRange()
 {
     ScDocument const& rDoc = *pViewData->GetDocument();
@@ -606,16 +617,11 @@ bool ScGridWindow::UpdateVisibleRange()
 
     if (comphelper::LibreOfficeKit::isActive())
     {
-        // entire table in the tiled rendering case
-        SCTAB nTab = pViewData->GetTabNo();
-        SCCOL nEndCol = 0;
-        SCROW nEndRow = 0;
-
-        if (rDoc.GetPrintArea(nTab, nEndCol, nEndRow, false))
-        {
-            nXRight = nEndCol;
-            nYBottom = nEndRow;
-        }
+        ScTabViewShell* pViewShell = pViewData->GetViewShell();
+        nPosX = lcl_getValidValue(pViewShell->GetLOKStartHeaderCol(), nPosX);
+        nPosY = lcl_getValidValue(pViewShell->GetLOKStartHeaderRow(), nPosY);
+        nXRight = lcl_getValidValue(pViewShell->GetLOKEndHeaderCol(), nXRight);
+        nYBottom = lcl_getValidValue(pViewShell->GetLOKEndHeaderRow(), 
nYBottom);
     }
     else
     {
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index f45a575ec461..7cbce3567ccf 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2750,6 +2750,7 @@ OUString ScTabView::getRowColumnHeaders(const 
tools::Rectangle& rRectangle)
     tools::Rectangle aChangedArea = aNewVisArea.GetBoundRect();
     if (!aChangedArea.IsEmpty())
     {
+        UpdateVisibleRange();
         UpdateFormulas(aChangedArea.Left(), aChangedArea.Top(), 
aChangedArea.Right(), aChangedArea.Bottom());
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to