summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-01-10 19:37:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-11 07:19:02 +0100
commitdd42f133f604ee2f7e0ffbca6a8d94fb8f95dfe5 (patch)
tree0d6dd54a8f6cb74ead327ee837389ea3f44ed91e /unotools
parent46b6ddc000a12795af361062bce471fa6e997d9a (diff)
tdf#146375 Cannot rename user-defined categories in template manager
Regression from commit 3624a703361b108d22448bd60a97733f05e37820 tdf#135316 remove OTempFileService pessimisation So fix two things here (1) make it so the tempfile service flushes the SvStream buffer and resets the file position, so we can read the data after writing it. (2) Simplify the UCB usage to just write the contents of the tempfile via the tempfile InputStream, which is simpler and safer Change-Id: I15ed3b02c2d6415d10a9579f66374e6268188d5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128195 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/ucbhelper/xtempfile.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx
index a8ace5da6725..a5772d8ba0c7 100644
--- a/unotools/source/ucbhelper/xtempfile.cxx
+++ b/unotools/source/ucbhelper/xtempfile.cxx
@@ -218,6 +218,12 @@ void SAL_CALL OTempFileService::closeOutput( )
throw css::io::NotConnectedException ( OUString(), static_cast < css::uno::XWeak * > (this ) );
mbOutClosed = true;
+ if (mpStream)
+ {
+ // so that if you then open the InputStream, you can read the content
+ mpStream->FlushBuffer();
+ mpStream->Seek(0);
+ }
if ( mbInClosed )
{