summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-07-28 18:05:20 +0530
committerPranav Kant <pranavk@collabora.co.uk>2017-10-02 10:54:52 +0530
commit0f58e974a7d6a88491a97ea3d0f30755ec330253 (patch)
tree8c3a15974009324443e042c5f6916cd435d93da5 /desktop
parent1325fabbdd2e52169a7d1a1b9a6b9b59d908e8bb (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')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx2
-rw-r--r--desktop/source/lib/init.cxx10
2 files changed, 7 insertions, 5 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 88b9df5a34fb..cd60aec267ee 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -18,6 +18,8 @@
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <boost/property_tree/json_parser.hpp>
+
+#include <vcl/scheduler.hxx>
#include <comphelper/processfactory.hxx>
#include <rtl/uri.hxx>
#include <sfx2/objsh.hxx>
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 476b283c9104..3b8982553dfb 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -591,7 +591,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)
@@ -3012,7 +3012,7 @@ unsigned char* doc_renderFont(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pTh
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;
@@ -3021,11 +3021,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)