summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-12-21 14:31:34 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2021-12-22 10:51:32 +0100
commit13ceaa008e25873bbcc0cf28487ec9e2f18ea399 (patch)
tree562865d77b67b97077b72c3ac63aae826e4e6528 /sfx2
parentde18a4ee448cf393a69592a75201eca05b90cb5f (diff)
filter: try to detect 0-byte DOC files based on extension
Commit ae1f51b4888a3aa14837ac6e4083f33b2176ca45 (tdf#123476 filter: try to detect 0-byte files based on extension, 2020-10-28), already implemented this UNO-based import filters, do the same for built-in filters as well. Another problem in filter/ was to pick the WW6 filter for .doc -- require export+preferred support in the filter to get WW8 instead. An additional filter that may kick in is MS Word 2003 XML: this is avoided by requiring "preferred". (cherry picked from commit e519d7465f38367205b37bc80f0244029e352306) Conflicts: filter/qa/unit/textfilterdetect.cxx Change-Id: I46e280beb5341213b0fe7a09a549b52c0c1ea3f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127296 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objstor.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index fd85ce09aabb..9b696bdc0bcb 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -753,7 +753,15 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
}
else
{
- bOk = ConvertFrom(*pMedium);
+ if (tools::isEmptyFileUrl(pMedium->GetName()))
+ {
+ // The import filter would fail with empty input.
+ bOk = true;
+ }
+ else
+ {
+ bOk = ConvertFrom(*pMedium);
+ }
InitOwnModel_Impl();
}
}