sc/source/ui/view/gridwin4.cxx | 43 +++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-)
New commits: commit f250d0024bcb6ac8d7586c3f1a66606473aedb28 Author: Dennis Francis <[email protected]> AuthorDate: Tue Jun 2 21:57:48 2020 +0530 Commit: Dennis Francis <[email protected]> CommitDate: Mon Jul 6 17:39:22 2020 +0200 scPrintTwipsMsgs: No more view specific edit-cursor messages Change-Id: I2a07834568716ea1608a40613108d229699058b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98059 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Dennis Francis <[email protected]> diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index adf183b132f4..4d122af6d269 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 { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
