include/LibreOfficeKit/LibreOfficeKitEnums.h | 8 ++++++++ sfx2/source/sidebar/Deck.cxx | 13 +++++++++++++ 2 files changed, 21 insertions(+)
New commits: commit 6301b0ca1132f88c14627fae68ee3460ddf546d2 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Sep 24 17:29:53 2019 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Sep 24 17:29:53 2019 +0200 jsdialogs: send JSON to the client Change-Id: If43a774e1e3a4bff4a8ec862f0091d60477090d4 diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 44bf83eab205..9a282a2e5a27 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -685,6 +685,12 @@ typedef enum * cell. */ LOK_CALLBACK_TABLE_SELECTED = 44, + + /** + * Callback related to native dialogs generated in JavaScript from + * the description. + */ + LOK_CALLBACK_JSDIALOG = 45, } LibreOfficeKitCallbackType; @@ -803,6 +809,8 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_CELL_AUTO_FILL_AREA"; case LOK_CALLBACK_TABLE_SELECTED: return "LOK_CALLBACK_TABLE_SELECTED"; + case LOK_CALLBACK_JSDIALOG: + return "LOK_CALLBACK_JSDIALOG"; } assert(!"Unknown LibreOfficeKitCallbackType type."); diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index d00a214e0fed..5bc09fdfc2f5 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -38,6 +38,8 @@ #include <vcl/IDialogRenderable.hxx> #include <tools/svborder.hxx> #include <sal/log.hxx> +#include <boost/property_tree/json_parser.hpp> +#include <LibreOfficeKit/LibreOfficeKitEnums.h> using namespace css; using namespace css::uno; @@ -201,6 +203,17 @@ void Deck::Resize() aItems.emplace_back(std::make_pair("position", Point(GetOutOffXPixel(), GetOutOffYPixel()).toString())); aItems.emplace_back(std::make_pair("size", GetSizePixel().toString())); pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems); + + try + { + std::stringstream aStream; + boost::property_tree::write_json(aStream, DumpAsPropertyTree()); + pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, aStream.str().c_str()); + } + catch(boost::property_tree::json_parser::json_parser_error& rError) + { + SAL_WARN("sfx.sidebar", rError.message()); + } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits