summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-07-28 18:05:20 +0530
committerJan Holesovsky <kendy@collabora.com>2017-11-15 17:07:05 +0100
commit2cf317089657c36d0fd1050a54f80e650c64f8c0 (patch)
tree3a9df089db6e9fe5d035acd287ef36e5ac1a342e /desktop/source
parentcea322065785903d2342177816db698e62dec89b (diff)
lokdialog: Better dialog rendering API
After painting the dialog, also write width and height of the rendered dialog. The dialog is rendered always on the top left of the given canvas, so client can crop the canvas accordingly. Change-Id: If052058a6db8a85d4e28ec88cffcca05564b17f0
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e8ca8ff999c2..a94af9bd825c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -610,7 +610,7 @@ static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis,
int* pFontHeight);
static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart);
-static void doc_paintDialog(LibreOfficeKitDocument* pThis, unsigned char* pBuffer, int nWidth, int nHeight);
+static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight);
LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent)
: mxComponent(xComponent)
@@ -3040,7 +3040,7 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/,
return nullptr;
}
-static void doc_paintDialog(LibreOfficeKitDocument* pThis, unsigned char* pBuffer, int nWidth, int nHeight)
+static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight)
{
SolarMutexGuard aGuard;
@@ -3049,11 +3049,11 @@ static void doc_paintDialog(LibreOfficeKitDocument* pThis, unsigned char* pBuffe
ScopedVclPtrInstance<VirtualDevice> pDevice(nullptr, Size(1, 1), DeviceFormat::DEFAULT);
pDevice->SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
- pDevice->SetOutputSizePixelScaleOffsetAndBuffer(Size(nWidth, nHeight), Fraction(1.0), Point(), pBuffer);
+ pDevice->SetOutputSizePixelScaleOffsetAndBuffer(Size(*nWidth, *nHeight), Fraction(1.0), Point(), pBuffer);
- vcl::DialogID aDialogID(pDialogRenderable->findDialog());
+ vcl::DialogID aDialogID = OUString::createFromAscii(pDialogId);
- pDialogRenderable->paintDialog(aDialogID, *pDevice.get(), nWidth, nHeight);
+ pDialogRenderable->paintDialog(aDialogID, *pDevice.get(), *nWidth, *nHeight);
}
static char* lo_getError (LibreOfficeKit *pThis)