office-gobmx/filter/Library_textfd.mk
Miklos Vajna ada07f303e tdf#123476 filter: try to detect 0-byte files based on extension
A 0-byte ("empty") pptx file is obviously junk input, so it's not
surprising if the catch-all generic_Text filter is chosen to open it in
Writer at the end.

But we can do better: if we really get an empty file URL with an
extension we can recognize, that we can fake the filter type / filter
name, so the empty "presentation" opens in Impress, and also a re-save
works as expected.

This builds on top of commit 8a201be240
(fdo#68903 Import .tsv and .xls plain text files in Calc by default,
2013-10-27), just the new way works for all supported file extensions
and also with filters which would not handle empty input (e.g. pptx
refuses the import if the ZIP storage is broken).

Change-Id: Ie01650a5eb6ca42c35e090133965467b621bb526
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104939
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2020-10-28 19:34:45 +01:00

36 lines
982 B
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#*************************************************************************
$(eval $(call gb_Library_Library,textfd))
$(eval $(call gb_Library_set_componentfile,textfd,filter/source/textfilterdetect/textfd))
$(eval $(call gb_Library_use_external,textfd,boost_headers))
$(eval $(call gb_Library_use_sdk_api,textfd))
$(eval $(call gb_Library_use_libraries,textfd,\
comphelper \
ucbhelper \
cppuhelper \
cppu \
sal \
sfx \
tl \
utl \
svt \
))
$(eval $(call gb_Library_add_exception_objects,textfd,\
filter/source/textfilterdetect/filterdetect \
))
# vim: set noet sw=4 ts=4: