summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/view/gridwin4.cxx3
-rw-r--r--svx/source/sdr/contact/objectcontactofpageview.cxx28
-rw-r--r--vcl/source/outdev/bitmap.cxx14
3 files changed, 43 insertions, 2 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index a68871d034ed..99ff1ba4d807 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -823,6 +823,9 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
auto aOrigin = aOriginalMode.GetOrigin();
aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + nScrX);
aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + nScrY);
+ static const double twipFactor = 15 * 1.76388889; // 26.45833335
+ aOrigin = Point(aOrigin.getX() - aOrigin.getX() / twipFactor,
+ aOrigin.getY() - aOrigin.getY() / twipFactor);
aNew.SetOrigin(aOrigin);
pContentDev->SetMapMode(aNew);
}
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index b4d68733a87e..6238cadb2f51 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
#include <drawinglayer/processor2d/processor2dtools.hxx>
#include <svx/unoapi.hxx>
+#include <comphelper/lok.hxx>
#include "eventhandler.hxx"
#include <boost/scoped_ptr.hpp>
@@ -167,7 +168,7 @@ namespace sdr
bool bClipRegionPushed(false);
const vcl::Region& rRedrawArea(rDisplayInfo.GetRedrawArea());
- if(!rRedrawArea.IsEmpty())
+ if(!rRedrawArea.IsEmpty() && !comphelper::LibreOfficeKit::isActive())
{
bClipRegionPushed = true;
pOutDev->Push(PushFlags::CLIPREGION);
@@ -230,6 +231,14 @@ namespace sdr
// transform to world coordinates
aViewRange.transform(rTargetOutDev.GetInverseViewTransformation());
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ const int TWIPS_PER_PIXEL = 15;
+ aViewRange = basegfx::B2DRange(aViewRange.getMinimum().getX(),
+ aViewRange.getMinimum().getY(),
+ aViewRange.getMaximum().getX() * TWIPS_PER_PIXEL,
+ aViewRange.getMaximum().getY() * TWIPS_PER_PIXEL);
+ }
}
// update local ViewInformation2D
@@ -291,15 +300,32 @@ namespace sdr
rDisplayInfo.ClearGhostedDrawMode(); // reset, else the VCL-paint with the processor will not do the right thing
pOutDev->SetLayoutMode(TEXT_LAYOUT_DEFAULT); // reset, default is no BiDi/RTL
+ // Save the map-mode since creating the 2D processor will replace it.
+ const MapMode aOrigMapMode = pOutDev->GetMapMode();
+
// create renderer
boost::scoped_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
drawinglayer::processor2d::createProcessor2DFromOutputDevice(
rTargetOutDev, getViewInformation2D()));
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // Restore the origin.
+ MapMode aMapMode = pOutDev->GetMapMode();
+ aMapMode.SetOrigin(aOrigMapMode.GetOrigin());
+ pOutDev->SetMapMode(aMapMode);
+ }
+
if(pProcessor2D)
{
pProcessor2D->process(xPrimitiveSequence);
}
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // Restore the original map-mode.
+ pOutDev->SetMapMode(aOrigMapMode);
+ }
}
// #114359# restore old ClipReghion
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index e845562b27aa..ef81682480bd 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -35,6 +35,7 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <boost/scoped_array.hpp>
+#include <comphelper/lok.hxx>
void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap )
{
@@ -1191,12 +1192,23 @@ void OutputDevice::DrawTransformedBitmapEx(
// with no rotation, shear or mirroring it can be mapped to DrawBitmapEx
// do *not* execute the mirroring here, it's done in the fallback
// #i124580# the correct DestSize needs to be calculated based on MaxXY values
- const Point aDestPt(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY()));
+ Point aDestPt(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY()));
const Size aDestSize(
basegfx::fround(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
basegfx::fround(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
+ const Point aOrigin = GetMapMode().GetOrigin();
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ aDestPt.Move(aOrigin.getX(), aOrigin.getY());
+ EnableMapMode(false);
+ }
DrawBitmapEx(aDestPt, aDestSize, rBitmapEx);
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ EnableMapMode(true);
+ aDestPt.Move(-aOrigin.getX(), -aOrigin.getY());
+ }
return;
}