sc/source/ui/view/gridwin.cxx | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-)
New commits: commit 7fb88645d20c1b1ec4aca41d0d96c457333282a7 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Wed Dec 18 22:32:07 2019 +0100 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Thu Dec 19 03:04:06 2019 +0100 lok: send "EMPTY" if the rect is empty for cell selection or fill It can happen that the selection or auto-fill rectangles are empty and if that's the case then we need to send "EMPTY" string and not the content of an empty rectangle (0, 0, -32768, -32768). This can happen for CELL_SELECTION_AREA or CELL_AUTO_FILL_AREA in calc. Change-Id: I9a60e3907a2ab8b0e0fd1a2ff81137fba6c8e9a3 Reviewed-on: https://gerrit.libreoffice.org/85441 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.me...@collabora.com> diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 28fbef5fb1f7..c6833d7fe2aa 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5930,7 +5930,10 @@ void ScGridWindow::UpdateKitSelection(const std::vector<tools::Rectangle>& rRect } ScTabViewShell* pViewShell = pViewData->GetViewShell(); - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_SELECTION_AREA, aBoundingBox.toString().getStr()); + OString sBoundingBoxString = "EMPTY"; + if (!aBoundingBox.IsEmpty()) + sBoundingBoxString = aBoundingBox.toString(); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_SELECTION_AREA, sBoundingBoxString.getStr()); pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, rectanglesToString(aLogicRects).getStr()); for (SfxViewShell* it = SfxViewShell::GetFirst(); it; @@ -5980,7 +5983,11 @@ void ScGridWindow::updateOtherKitSelections() const OString aRectsString = rectanglesToString(aOtherLogicRects); if (it == pViewShell) { - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_SELECTION_AREA, aBoundingBox.toString().getStr()); + OString sBoundingBoxString = "EMPTY"; + if (!aBoundingBox.IsEmpty()) + sBoundingBoxString = aBoundingBox.toString(); + + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_SELECTION_AREA, sBoundingBoxString.getStr()); pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, aRectsString.getStr()); } else @@ -6000,13 +6007,18 @@ void updateLibreOfficeKitAutoFill(const ScViewData* pViewData, tools::Rectangle double nPPTX = pViewData->GetPPTX(); double nPPTY = pViewData->GetPPTY(); - // selection start handle - tools::Rectangle aLogicRectangle( - rRectangle.Left() / nPPTX, rRectangle.Top() / nPPTY, - rRectangle.Right() / nPPTX, rRectangle.Bottom() / nPPTY); + OString sRectangleString = "EMPTY"; + if (!rRectangle.IsEmpty()) + { + // selection start handle + tools::Rectangle aLogicRectangle( + rRectangle.Left() / nPPTX, rRectangle.Top() / nPPTY, + rRectangle.Right() / nPPTX, rRectangle.Bottom() / nPPTY); + sRectangleString = aLogicRectangle.toString(); + } ScTabViewShell* pViewShell = pViewData->GetViewShell(); - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_AUTO_FILL_AREA, aLogicRectangle.toString().getStr()); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_AUTO_FILL_AREA, sRectangleString.getStr()); } } //end anonymous namespace _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits