summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--comphelper/source/misc/lok.cxx12
-rw-r--r--include/comphelper/lok.hxx7
-rw-r--r--sc/source/ui/view/gridwin4.cxx1
-rw-r--r--svx/source/sdr/contact/objectcontactofpageview.cxx9
-rw-r--r--vcl/source/outdev/bitmap.cxx4
5 files changed, 28 insertions, 5 deletions
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx
index 279ec65c600c..d2467e75b324 100644
--- a/comphelper/source/misc/lok.cxx
+++ b/comphelper/source/misc/lok.cxx
@@ -39,6 +39,18 @@ bool isViewCallback()
return g_bViewCallback;
}
+static bool g_bLocalRendering(false);
+
+void setLocalRendering(bool bLocalRendering)
+{
+ g_bLocalRendering = bLocalRendering;
+}
+
+bool isLocalRendering()
+{
+ return g_bLocalRendering;
+}
+
static void (*pStatusIndicatorCallback)(void *data, statusIndicatorCallbackType type, int percent)(nullptr);
static void *pStatusIndicatorCallbackData(nullptr);
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index 2cc38c60e455..8afd3d82a77d 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -36,6 +36,13 @@ COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(void (*callback)(void *data
// Check whether the code is running as invoked through LibreOfficeKit.
COMPHELPER_DLLPUBLIC bool isActive();
+/// Shift the coordinates before rendering each bitmap.
+/// Used by Calc to render each tile separately.
+/// This should be unnecessary (and removed) once Calc
+/// moves to using 100MM Unit.
+COMPHELPER_DLLPUBLIC void setLocalRendering(bool bLocalRendering = true);
+COMPHELPER_DLLPUBLIC bool isLocalRendering();
+
/// Check whether clients register a callback for each view.
COMPHELPER_DLLPUBLIC bool isViewCallback();
/// Set whether clients register a callback for each view.
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index dc6d66b12631..cc6c733694a9 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -828,6 +828,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
aOrigin.getY() - aOrigin.getY() / twipFactor);
aNew.SetOrigin(aOrigin);
pContentDev->SetMapMode(aNew);
+ comphelper::LibreOfficeKit::setLocalRendering();
}
DrawRedraw( aOutputData, eMode, SC_LAYER_FRONT );
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 6238cadb2f51..1f6fcecd618a 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -231,7 +231,8 @@ namespace sdr
// transform to world coordinates
aViewRange.transform(rTargetOutDev.GetInverseViewTransformation());
- if (comphelper::LibreOfficeKit::isActive())
+ if (comphelper::LibreOfficeKit::isActive() &&
+ comphelper::LibreOfficeKit::isLocalRendering())
{
const int TWIPS_PER_PIXEL = 15;
aViewRange = basegfx::B2DRange(aViewRange.getMinimum().getX(),
@@ -308,7 +309,8 @@ namespace sdr
drawinglayer::processor2d::createProcessor2DFromOutputDevice(
rTargetOutDev, getViewInformation2D()));
- if (comphelper::LibreOfficeKit::isActive())
+ if (comphelper::LibreOfficeKit::isActive() &&
+ comphelper::LibreOfficeKit::isLocalRendering())
{
// Restore the origin.
MapMode aMapMode = pOutDev->GetMapMode();
@@ -321,7 +323,8 @@ namespace sdr
pProcessor2D->process(xPrimitiveSequence);
}
- if (comphelper::LibreOfficeKit::isActive())
+ if (comphelper::LibreOfficeKit::isActive() &&
+ comphelper::LibreOfficeKit::isLocalRendering())
{
// Restore the original map-mode.
pOutDev->SetMapMode(aOrigMapMode);
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index ef81682480bd..2db0cc8f90b5 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -1197,14 +1197,14 @@ void OutputDevice::DrawTransformedBitmapEx(
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())
+ if (comphelper::LibreOfficeKit::isActive() && GetMapMode().GetMapUnit() != MAP_PIXEL)
{
aDestPt.Move(aOrigin.getX(), aOrigin.getY());
EnableMapMode(false);
}
DrawBitmapEx(aDestPt, aDestSize, rBitmapEx);
- if (comphelper::LibreOfficeKit::isActive())
+ if (comphelper::LibreOfficeKit::isActive() && GetMapMode().GetMapUnit() != MAP_PIXEL)
{
EnableMapMode(true);
aDestPt.Move(-aOrigin.getX(), -aOrigin.getY());