diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-09-12 20:07:10 -0400 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2019-11-06 03:43:02 +0100 |
commit | 887ecdb8d3e8301b67e249c88d8aab734c76fed1 (patch) | |
tree | 4d85d848d1e43f9b37a3bcc4e5378c3926c1beba /kit | |
parent | f86a1cb016d896903d6222dd886666bdeb80a7b0 (diff) |
wsd: leaflet: Insert background
This adds support for .uno:SelectBackground
which inserts slide background image.
(cherry picked from commit 30a77e7e490e4e83bb6423f41388ee9adbccfae3)
Change-Id: I587b31f67d518aba348ae7e8d058ada23a61e858
Reviewed-on: https://gerrit.libreoffice.org/67500
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'kit')
-rw-r--r-- | kit/ChildSession.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index f67e3a1c1..c2fc39a77 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -1156,12 +1156,12 @@ bool ChildSession::insertFile(const char* /*buffer*/, int /*length*/, const std: } #endif - if (type == "graphic" || type == "graphicurl") + if (type == "graphic" || type == "graphicurl" || type == "selectbackground") { std::string url; #if !MOBILEAPP - if (type == "graphic") + if (type == "graphic" || type == "selectbackground") url = "file://" + std::string(JAILED_DOCUMENT_ROOT) + "insertfile/" + name; else if (type == "graphicurl") URI::decode(name, url); @@ -1176,8 +1176,8 @@ bool ChildSession::insertFile(const char* /*buffer*/, int /*length*/, const std: url = "file://" + tempFile; #endif - std::string command = ".uno:InsertGraphic"; - std::string arguments = "{" + const std::string command = (type == "selectbackground" ? ".uno:SelectBackground" : ".uno:InsertGraphic"); + const std::string arguments = "{" "\"FileName\":{" "\"type\":\"string\"," "\"value\":\"" + url + "\"" @@ -1185,7 +1185,7 @@ bool ChildSession::insertFile(const char* /*buffer*/, int /*length*/, const std: getLOKitDocument()->setView(_viewId); - LOG_TRC("Inserting graphic: '" << arguments.c_str() << "', '"); + LOG_TRC("Inserting " << type << ": " << command << ' ' << arguments.c_str()); getLOKitDocument()->postUnoCommand(command.c_str(), arguments.c_str(), false); } |