From dd2c566b29b74d025761df77f5744c5b21e97625 Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Thu, 26 Oct 2017 18:31:39 -0700 Subject: lokdialog: Tunnel dialog title to lokclient as outparam Change-Id: I1beb5ab3f06debdca7ebf999af7ac879a41ea47e Reviewed-on: https://gerrit.libreoffice.org/43959 Tested-by: Jenkins Reviewed-by: pranavk --- desktop/source/lib/init.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'desktop') diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0e1a023b887f..6da4125ddf1d 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -631,7 +631,7 @@ static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis, int* pFontHeight); static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart); -static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); +static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, char** pDialogTitle, int* nWidth, int* nHeight); static void doc_paintActiveFloatingWindow(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); @@ -3112,7 +3112,7 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/, return nullptr; } -static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight) +static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, char** pDialogTitle, int* nWidth, int* nHeight) { SolarMutexGuard aGuard; @@ -3126,7 +3126,16 @@ static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId vcl::DialogID aDialogID = OUString::createFromAscii(pDialogId); comphelper::LibreOfficeKit::setDialogPainting(true); - pDialogRenderable->paintDialog(aDialogID, *pDevice.get(), *nWidth, *nHeight); + + // copy the title of the dialog to outparam + OUString aDialogTitle; + pDialogRenderable->paintDialog(aDialogID, *pDevice.get(), aDialogTitle, *nWidth, *nHeight); + if (!aDialogTitle.isEmpty()) + { + OString aTitleString = OUStringToOString(aDialogTitle, RTL_TEXTENCODING_UTF8); + *pDialogTitle = static_cast(malloc(aTitleString.getLength() + 1)); + strcpy(*pDialogTitle, aTitleString.getStr()); + } comphelper::LibreOfficeKit::setDialogPainting(false); } -- cgit v1.2.3