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).
This commit is contained in:
Miklos Vajna 2018-01-16 09:06:49 +01:00
parent f7fc3f494c
commit d0d87401c1

View file

@ -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);
}