summaryrefslogtreecommitdiff
path: root/desktop/source/lib/init.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/lib/init.cxx')
-rw-r--r--desktop/source/lib/init.cxx29
1 files changed, 23 insertions, 6 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2d8f7290a05d..8f05cc487672 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -905,6 +905,11 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* pThis, unsigned nLOKWindo
const int nWidth, const int nHeight,
const double fDPIScale);
+static void doc_paintWindowForView(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId, unsigned char* pBuffer,
+ const int nX, const int nY,
+ const int nWidth, const int nHeight,
+ const double fDPIScale, int viewId);
+
static void doc_postWindow(LibreOfficeKitDocument* pThis, unsigned
nLOKWindowId, int nAction, const char* pData);
@@ -1022,6 +1027,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone
m_pDocumentClass->paintWindow = doc_paintWindow;
m_pDocumentClass->paintWindowDPI = doc_paintWindowDPI;
+ m_pDocumentClass->paintWindowForView = doc_paintWindowForView;
m_pDocumentClass->postWindow = doc_postWindow;
m_pDocumentClass->resizeWindow = doc_resizeWindow;
@@ -4850,12 +4856,20 @@ static void doc_paintWindow(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId
doc_paintWindowDPI(pThis, nLOKWindowId, pBuffer, nX, nY, nWidth, nHeight, 1.0);
}
-static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId,
+static void doc_paintWindowDPI(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId,
unsigned char* pBuffer,
const int nX, const int nY,
const int nWidth, const int nHeight,
const double fDPIScale)
{
+ doc_paintWindowForView(pThis, nLOKWindowId, pBuffer, nX, nY, nWidth, nHeight, fDPIScale, -1);
+}
+
+static void doc_paintWindowForView(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId,
+ unsigned char* pBuffer, const int nX, const int nY,
+ const int nWidth, const int nHeight,
+ const double fDPIScale, int viewId)
+{
comphelper::ProfileZone aZone("doc_paintWindowDPI");
SolarMutexGuard aGuard;
@@ -4868,6 +4882,12 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW
return;
}
+ // Used to avoid work in setView if set.
+ comphelper::LibreOfficeKit::setDialogPainting(true);
+
+ if (viewId >= 0)
+ doc_setView(pThis, viewId);
+
// Setup cairo (or CoreGraphics, in the iOS case) to draw with the changed DPI scale (and return
// back to 1.0 when the painting finishes)
comphelper::ScopeGuard dpiScaleGuard([]() { comphelper::LibreOfficeKit::setDPIScale(1.0); });
@@ -4892,9 +4912,7 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW
aMapMode.SetOrigin(Point(-(nX / fDPIScale), -(nY / fDPIScale)));
pDevice->SetMapMode(aMapMode);
- comphelper::LibreOfficeKit::setDialogPainting(true);
pWindow->PaintToDevice(pDevice.get(), Point(0, 0), Size());
- comphelper::LibreOfficeKit::setDialogPainting(false);
CGContextRelease(cgc);
@@ -4909,11 +4927,10 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW
aMapMode.SetOrigin(Point(-(nX / fDPIScale), -(nY / fDPIScale)));
pDevice->SetMapMode(aMapMode);
- comphelper::LibreOfficeKit::setDialogPainting(true);
pWindow->PaintToDevice(pDevice.get(), Point(0, 0), Size());
- comphelper::LibreOfficeKit::setDialogPainting(false);
-
#endif
+
+ comphelper::LibreOfficeKit::setDialogPainting(false);
}
static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nAction, const char* pData)