diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-12-21 14:31:34 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-12-21 17:04:51 +0100 |
commit | e519d7465f38367205b37bc80f0244029e352306 (patch) | |
tree | 6f5021fd07509609db3afec1fa5ee5f1f5f6ed1b /sfx2 | |
parent | c35f81148fb18ba070516edcbb4d614444899235 (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".
Change-Id: I46e280beb5341213b0fe7a09a549b52c0c1ea3f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127219
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 8b3c8f6d3e9d..0dc1b0f7d452 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -754,7 +754,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(); } } |