summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-04-27 14:32:25 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-04-27 14:32:32 +0200
commit7e9ba2e8c68f6904177272bee9453860224174ec (patch)
tree6ac1297a909a014ef062333ab4a82e58114b9fbb
parent27a4f70a555a7d8cb597c0c33fe37e8abab0a9ef (diff)
tdf#117077 kit: opt-in to embed images in HTML export
Changing the default in core.git has various up and downsides, so just opt in for embedding here. Change-Id: I3f8013800e3fdf759fcb09bce848e8754c8aa44c
-rw-r--r--kit/ChildSession.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 04ec7d93f..b6d5ee408 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -1176,8 +1176,19 @@ bool ChildSession::saveAs(const char* /*buffer*/, int /*length*/, const std::vec
getLOKitDocument()->setView(_viewId);
if (filterOptions.empty())
+ {
+ std::vector<std::string> filterOptionsVector;
+
// Save and no arguments, provide our default.
- filterOptions = "NoFileSync";
+ filterOptionsVector.push_back("NoFileSync");
+
+ if (format == "html")
+ // Opt-in to avoid linked images, those would not leave the
+ // chroot.
+ filterOptionsVector.push_back("EmbedImages");
+
+ filterOptions = Poco::cat(std::string(","), filterOptionsVector.begin(), filterOptionsVector.end());
+ }
LOG_DBG("Calling LOK's saveAs with: '" << url.c_str() << "', '" <<
(format.size() == 0 ? "(nullptr)" : format.c_str()) << "', '" <<