summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2020-06-02 21:57:48 +0530
committerDennis Francis <dennis.francis@collabora.com>2020-07-07 11:44:28 +0200
commit9aa33b25764cb199c916737ca334cd35c82350c2 (patch)
tree69193cd13817c3aba18f558e597f43faf999313e /sc
parentfada69d6ee05700fd57c8844591562608a900a9d (diff)
scPrintTwipsMsgs: No more view specific edit-cursor messages
Change-Id: I2a07834568716ea1608a40613108d229699058b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98123 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/gridwin4.cxx43
1 files changed, 25 insertions, 18 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 4c42d86f2de4..17f9b16a8ec9 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1120,28 +1120,35 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
pEditView->SetOutputArea(rDevice.PixelToLogic(aEditRect));
pEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice);
- // Now we need to get relative cursor position within the editview.
- // This is for sending the absolute twips position of the cursor to the specific views with
- // the same given zoom level.
- tools::Rectangle aCursorRect = pEditView->GetEditCursor();
- Point aCursPos = OutputDevice::LogicToLogic(aCursorRect.TopLeft(), MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+ // EditView will do the cursor notifications correctly if we're in
+ // print-twips messaging mode.
+ if (!comphelper::LibreOfficeKit::isCompatFlagSet(
+ comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs))
+ {
+ // Now we need to get relative cursor position within the editview.
+ // This is for sending the pixel-aligned twips position of the cursor to the specific views with
+ // the same given zoom level.
+ tools::Rectangle aCursorRect = pEditView->GetEditCursor();
+ Point aCursPos = OutputDevice::LogicToLogic(aCursorRect.TopLeft(),
+ MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+
+ const MapMode& rDevMM = rDevice.GetMapMode();
+ MapMode aMM(MapUnit::MapTwip);
+ aMM.SetScaleX(rDevMM.GetScaleX());
+ aMM.SetScaleY(rDevMM.GetScaleY());
+
+ aBGAbs.AdjustLeft(1);
+ aBGAbs.AdjustTop(1);
+ aCursorRect = OutputDevice::PixelToLogic(aBGAbs, aMM);
+ aCursorRect.setWidth(0);
+ aCursorRect.Move(aCursPos.getX(), 0);
+ // Sends view cursor position to views of all matching zooms if needed (avoids duplicates).
+ InvalidateLOKViewCursor(aCursorRect, aMM.GetScaleX(), aMM.GetScaleY());
+ }
// Rollback the mapmode and 'output area'.
SetMapMode(aOrigMapMode);
pEditView->SetOutputArea(aOrigOutputArea);
-
- const MapMode& rDevMM = rDevice.GetMapMode();
- MapMode aMM(MapUnit::MapTwip);
- aMM.SetScaleX(rDevMM.GetScaleX());
- aMM.SetScaleY(rDevMM.GetScaleY());
-
- aBGAbs.AdjustLeft(1);
- aBGAbs.AdjustTop(1);
- aCursorRect = OutputDevice::PixelToLogic(aBGAbs, aMM);
- aCursorRect.setWidth(0);
- aCursorRect.Move(aCursPos.getX(), 0);
- // Sends view cursor position to views of all matching zooms if needed (avoids duplicates).
- InvalidateLOKViewCursor(aCursorRect, aMM.GetScaleX(), aMM.GetScaleY());
}
else
{