diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-10-26 18:31:39 -0700 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-15 17:07:17 +0100 |
commit | dd2c566b29b74d025761df77f5744c5b21e97625 (patch) | |
tree | a3533275620da38206e5cc6ce11cbcd9dfbae767 /desktop | |
parent | 0968edb21c069c4c91836581a7c29f8e82d533bb (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.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
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<char*>(malloc(aTitleString.getLength() + 1)); + strcpy(*pDialogTitle, aTitleString.getStr()); + } comphelper::LibreOfficeKit::setDialogPainting(false); } |