diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-24 16:17:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-25 12:13:00 +0100 |
commit | 02caa6e40cfa55d96befc82515b343045b5cfd7b (patch) | |
tree | 61238fd2407f4a0128cd24779ebc7c9e4cb3ef07 /unotools | |
parent | 612e7d52f8fda6ddb1c42fc51b123844810fdb9a (diff) |
renames in template manager creates xml file in wrong location
revert part of
commit dd42f133f604ee2f7e0ffbca6a8d94fb8f95dfe5
Author: Noel Grandin <noelgrandin@gmail.com>
Date: Mon Jan 10 19:37:05 2022 +0200
tdf#146375 Cannot rename user-defined categories in template manager
specifically, revert the
> Simplify the UCB usage to just write the contents of the tempfile
and also call SvStream::Flush() in utl::TempFile::GetURL(), so that
the data actually hits the disk, so that when UCB attempts to read
the data using a separate file handle, it sees the data.
(Otherwise the temporary file data only exists in the operating system
buffers, and can only be read by the same file handle that created it)
Change-Id: I17798c53e49d65484605f2dcd96b45babd70054d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130499
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/ucbhelper/tempfile.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 07889ffdab83..cccad1c367f0 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -413,6 +413,13 @@ OUString TempFile::GetFileName() const OUString const & TempFile::GetURL() const { + // if you request the URL, then you presumably want to access this via UCB, + // and UCB will want to open the file via a separate file handle, which means + // we have to make this file data actually hit disk. We do this here (and not + // elsewhere) to make the other (normal) paths fast. Flushing to disk + // really slows temp files down. + if (pStream) + pStream->Flush(); return aName; } |