summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-09-22 20:18:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-09-23 09:51:41 +0200
commit5ff06d5e385a0ea30a427e3e6ebb7c605dbf984b (patch)
tree0e0c6e6b57afb4ea5103c1b77e8e6448d4060e68 /sc
parent672dce81178dc1b4b6ad54f2b5d922ee806acf91 (diff)
dbf filter needs a physical file
Change-Id: Ia522fee21edeafa419c173606ebaac0667d264fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122492 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/docsh.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index baf0903ca855..013c59f8adac 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -3409,10 +3409,17 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDBF(SvStream &rStream)
{
ScDLL::Init();
- utl::TempFile aTempInput;
+ // we need a real file for this filter
+
+ // put it in an empty dir
+ utl::TempFile aTmpDir(nullptr, true);
+ aTmpDir.EnableKillingFile();
+ OUString sTmpDir = aTmpDir.GetURL();
+
+ OUString sNoExtension;
+ utl::TempFile aTempInput(OUString(), true, &sNoExtension, &sTmpDir);
aTempInput.EnableKillingFile();
- // need a real file for this filter
SvStream* pInputStream = aTempInput.GetStream(StreamMode::WRITE);
sal_uInt8 aBuffer[8192];
while (auto nRead = rStream.ReadBytes(aBuffer, SAL_N_ELEMENTS(aBuffer)))