diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-02-24 16:06:48 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2020-02-25 08:15:56 +0100 |
commit | 0a35eafca9f74d2858bd3323d74d64813fa9107a (patch) | |
tree | f16bf7a55f1875a27954cddfa659f7b2ca7dac5a | |
parent | 9dba074405b3db3a0bd2b09a15c98abf4a2cd646 (diff) |
jsdialog: Refresh dialog after action
Change-Id: I83e5750f91789fcd01ba41cab616c5e768492bc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89369
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | desktop/source/lib/init.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0869b3a92ab7..8c7ac75e6b80 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3582,7 +3582,24 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin } catch(...) {} // force resend - pWindow->Resize(); + const vcl::ILibreOfficeKitNotifier* pNotifier = pWindow->GetLOKNotifier(); + if (!pNotifier) + { + pWindow->Resize(); + return; + } + + try + { + // Mobile. + std::stringstream aStream; + boost::property_tree::ptree aTree = pWindow->DumpAsPropertyTree(); + aTree.put("id", pWindow->GetLOKWindowId()); + boost::property_tree::write_json(aStream, aTree); + const std::string message = aStream.str(); + pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str()); + } + catch (boost::property_tree::json_parser::json_parser_error&) {} } } |