[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - kit/ChildSession.cpp
mert (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 18 12:13:00 UTC 2020
kit/ChildSession.cpp | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 1efdc09c628a37da4ac1c3c03a449922622d8baf
Author: mert <mert.tumer at collabora.com>
AuthorDate: Wed Jun 17 18:13:22 2020 +0300
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Jun 18 14:12:41 2020 +0200
online: fix io error on saveas
Change-Id: Icd91eacf2945c803660aaacb1d46d169b1f9bd86
Signed-off-by: mert <mert.tumer at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96570
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index d9bf41631..7e2a84e0d 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -2022,8 +2022,16 @@ bool ChildSession::saveAs(const char* /*buffer*/, int /*length*/, const StringVe
return false;
}
- // TODO do we need a tempdir here?
- url = std::string("file://") + JAILED_DOCUMENT_ROOT + pathSegments[pathSegments.size() - 1];
+ std::string jailDoc = JAILED_DOCUMENT_ROOT;
+ if (NoCapsForKit)
+ {
+ jailDoc = Poco::URI(getJailedFilePath()).getPath();
+ jailDoc = jailDoc.substr(0, jailDoc.find(JAILED_DOCUMENT_ROOT)) + JAILED_DOCUMENT_ROOT;
+ }
+
+ const std::string tmpDir = FileUtil::createRandomDir(jailDoc);
+ const Poco::Path filenameParam(pathSegments[pathSegments.size() - 1]);
+ url = std::string("file://") + jailDoc + tmpDir + "/" + filenameParam.getFileName();
wopiFilename = wopiURL.getPath();
}
More information about the Libreoffice-commits
mailing list