summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-04-24 21:14:38 +0200
committerAndras Timar <andras.timar@collabora.com>2017-04-24 22:11:17 +0200
commitf62d14ea33d9b936d58820300a5bee58b6cfa08a (patch)
treecaf02292d7fe8712783c7450f3af12ed1600820e
parentadd66aab0c9b0fb709fea7710ab74653b3601272 (diff)
lok: When we actually have the OutputDevice, prefer that.cp-5.3-7
Writer invalidation functionality depends on this actually. Change-Id: I0933c56ff3999a09118112ccf49bf00062c42444 Reviewed-on: https://gerrit.libreoffice.org/36914 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--svx/source/svdraw/sdrpagewindow.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx
index fcd8cbc678a1..9b7e9b1b8ad5 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -406,23 +406,7 @@ void SdrPageWindow::RedrawLayer( const SdrLayerID* pId, sdr::contact::ViewObject
// Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...)
void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange)
{
- if (comphelper::LibreOfficeKit::isActive())
- {
- // we don't really have a paint window with LOK; OTOH we know that the
- // drawinglayer units are 100ths of mm, so they are easy to convert to
- // twips
- const Rectangle aRect100thMM(
- static_cast<long>(floor(rRange.getMinX())),
- static_cast<long>(floor(rRange.getMinY())),
- static_cast<long>(ceil(rRange.getMaxX())),
- static_cast<long>(ceil(rRange.getMaxY())));
-
- const Rectangle aRectTwips = OutputDevice::LogicToLogic(aRect100thMM, MapUnit::Map100thMM, MapUnit::MapTwip);
-
- if (SfxViewShell* pViewShell = SfxViewShell::Current())
- SfxLokHelper::notifyInvalidation(pViewShell, aRectTwips.toString());
- }
- else if (GetPageView().IsVisible() && GetPaintWindow().OutputToWindow())
+ if (GetPageView().IsVisible() && GetPaintWindow().OutputToWindow())
{
const SvtOptionsDrawinglayer aDrawinglayerOpt;
vcl::Window& rWindow(static_cast< vcl::Window& >(GetPaintWindow().GetOutputDevice()));
@@ -447,6 +431,22 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange)
rWindow.Invalidate(aVCLDiscreteRectangle, InvalidateFlags::NoErase);
rWindow.EnableMapMode(bWasMapModeEnabled);
}
+ else if (comphelper::LibreOfficeKit::isActive())
+ {
+ // we don't really have to have a paint window with LOK; OTOH we know
+ // that the drawinglayer units are 100ths of mm, so they are easy to
+ // convert to twips
+ const Rectangle aRect100thMM(
+ static_cast<long>(floor(rRange.getMinX())),
+ static_cast<long>(floor(rRange.getMinY())),
+ static_cast<long>(ceil(rRange.getMaxX())),
+ static_cast<long>(ceil(rRange.getMaxY())));
+
+ const Rectangle aRectTwips = OutputDevice::LogicToLogic(aRect100thMM, MapUnit::Map100thMM, MapUnit::MapTwip);
+
+ if (SfxViewShell* pViewShell = SfxViewShell::Current())
+ SfxLokHelper::notifyInvalidation(pViewShell, aRectTwips.toString());
+ }
}
// ObjectContact section