diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-22 15:27:40 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-09-22 20:27:04 +0200 |
commit | ba3d6d8a39d31316923d2326059c07b0a7e3c05e (patch) | |
tree | bc247bdff9035fea03e9fb35546cb8abed8fed9f /sd/source/ui | |
parent | c6fc963c534bc9069ef975246e5d619777b9f570 (diff) |
sd lok: fix pixel-to-logic conversion in DrawViewShell::MakeVisible()
The problem, as seen by the user is that during shape text edit,
sometimes just traveling with the cursor causes invalidations, which is
unexpected.
What happens is sd::Window::KeyInput() invokes
sd::DrawViewShell::MakeVisible(), which does a pixel-to-logic
conversion, but because the map mode is in general disabled in the LOK
case, nothing happens. Then a bit later aVisArea.IsInside(rRect) fails,
as it compares pixel and logic units, which results in
sd::ViewOverlayManager::UpdateTags() scheduling an async call to
sd::ViewOverlayManager::UpdateTagsHdl(), which at the end causes a full
invalidation in sd::SmartTagSet::remove().
Fix the situation by temporarily enabling map mode, so we don't detect
a visible cursor area as a non-visible one.
Change-Id: I6d16f24d13143dc263a89317fbc38111e652c0ac
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/view/drviewsh.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sd/source/ui/view/drviewsh.cxx b/sd/source/ui/view/drviewsh.cxx index 5d40d0e4d2a4..2a3dd490dd6d 100644 --- a/sd/source/ui/view/drviewsh.cxx +++ b/sd/source/ui/view/drviewsh.cxx @@ -25,6 +25,7 @@ #include <svx/fmshell.hxx> #include <sfx2/dispatch.hxx> +#include <comphelper/lok.hxx> #include "app.hrc" #include "strings.hrc" @@ -80,7 +81,15 @@ void DrawViewShell::MakeVisible(const Rectangle& rRect, vcl::Window& rWin) // visible area Size aVisSizePixel(rWin.GetOutputSizePixel()); + bool bTiledRendering = comphelper::LibreOfficeKit::isActive() && !rWin.IsMapModeEnabled(); + if (bTiledRendering) + { + rWin.Push(PushFlags::MAPMODE); + rWin.EnableMapMode(); + } Rectangle aVisArea(rWin.PixelToLogic(Rectangle(Point(0,0), aVisSizePixel))); + if (bTiledRendering) + rWin.Pop(); Size aVisAreaSize(aVisArea.GetSize()); if (!aVisArea.IsInside(rRect) && !SlideShow::IsRunning( GetViewShellBase() ) ) |