summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2019-10-20 13:38:56 +0200
committerMarco Cecchetti <marco.cecchetti@collabora.com>2020-03-06 10:39:51 +0100
commit8ae1c4b6408d6601d73fa7b688b52e1f01513e4f (patch)
tree973d8c1f1644d2ced4e6bc6d5178bf4b88e223a9 /sc
parentbaadefe9cb8e6745493b0c383e1d66ff3905d153 (diff)
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.cecchetti@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/gridwin2.cxx26
-rw-r--r--sc/source/ui/view/tabview.cxx1
2 files changed, 17 insertions, 10 deletions
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());
}