summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-10-26 18:31:39 -0700
committerpranavk <pranavk@collabora.co.uk>2017-10-28 17:07:19 +0200
commitfdb56a741a66e152f0f120d00bf62049fe566a79 (patch)
tree8fca2c834d462d80a02de22c61f2be61107bb17b /desktop
parent79fa071767c7c6b88950b82143fa76df63b172e6 (diff)
lokdialog: Tunnel dialog title to lokclient as outparam
Change-Id: I1beb5ab3f06debdca7ebf999af7ac879a41ea47e Reviewed-on: https://gerrit.libreoffice.org/43959 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bd09ed1dd987..906e271f5c30 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, 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);
@@ -3089,7 +3089,7 @@ unsigned char* doc_renderFont(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pTh
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;
@@ -3103,7 +3103,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<char*>(malloc(aTitleString.getLength() + 1));
+ strcpy(*pDialogTitle, aTitleString.getStr());
+ }
comphelper::LibreOfficeKit::setDialogPainting(false);
}