diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-12-21 14:31:34 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-02-14 11:25:41 +0100 |
commit | 47f91e2bec84659a79e3e1b612b2fb842767807f (patch) | |
tree | a6f75d6fe8b85298cc87004dfe291bb4e4877e96 /sfx2 | |
parent | 21e3d1d965cfc81480e13b88f3e9d2f4fd2367fb (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 89e458705efe..06602206cfe9 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(); } } |