[Libreoffice-commits] online.git: kit/ChildSession.cpp
Miklos Vajna
vmiklos at collabora.co.uk
Tue Jan 16 08:59:50 UTC 2018
kit/ChildSession.cpp | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
New commits:
commit d0d87401c14aeedcded192680f05080c3dc08591
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Jan 16 09:06:49 2018 +0100
kit: use NoFileSync flag for save
What LibreOffice sees as a save destination is just a temporary output
from the outside, so there is no point in doing fsync for that file.
This depends on core.git e90a16d71cdcfbd785401613a2e5a29cb1167acf (sfx2
store: handle NoFileSync for Save (not SaveAs), 2018-01-15).
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 6c7223bd..a6609d8c 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -917,8 +917,25 @@ bool ChildSession::unoCommand(const char* /*buffer*/, int /*length*/, const std:
}
else
{
+ std::string arguments;
+ if (tokens[1] == ".uno:Save" && tokens[2] == "{}")
+ {
+ // Save and no arguments, provide our default.
+ std::ostringstream oss;
+ oss << "{"
+ << "\"NoFileSync\":"
+ << "{"
+ << "\"type\":\"boolean\","
+ << "\"value\":true"
+ << "}"
+ << "}";
+ arguments = oss.str();
+ }
+ else
+ arguments = Poco::cat(std::string(" "), tokens.begin() + 2, tokens.end());
+
getLOKitDocument()->postUnoCommand(tokens[1].c_str(),
- Poco::cat(std::string(" "), tokens.begin() + 2, tokens.end()).c_str(),
+ arguments.c_str(),
bNotify);
}
More information about the Libreoffice-commits
mailing list