diff options
author | Kohei Yoshida <kohei@libreoffice.org> | 2023-05-31 21:33:56 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei@libreoffice.org> | 2023-10-25 03:59:57 +0200 |
commit | b14583ba37a6d7ce398ccd3cf339f954785b03d8 (patch) | |
tree | cf48ebcb363c1f782b3f238f5a49dea367345b84 /filter | |
parent | b5d194d1d37131f921853b78d659c63178de2bc6 (diff) |
Support conditional loading of Apache Parquet files into Calc
Also, use orcus::create_filter() and simplify the logic a bit. This
requires orcus 0.19.1 or newer.
Note that this change makes it possible to load Apache Parquet files
if and only if orcus has been built with the parquet import filter
enabled. Using orcus without the parquet import filter enabled will
not break the build or run-time behavior; you just can't load parquet
files.
Change-Id: I9f8820998b7b0667d1e7cd532c32b1c7e55ca999
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158411
Tested-by: Jenkins
Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/Configuration_filter.mk | 2 | ||||
-rw-r--r-- | filter/source/config/cache/typedetection.cxx | 1 | ||||
-rw-r--r-- | filter/source/config/fragments/filters/calc_Parquet.xcu | 19 | ||||
-rw-r--r-- | filter/source/config/fragments/types/calc_Parquet.xcu | 17 |
4 files changed, 39 insertions, 0 deletions
diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk index bd3d3486234e..8a323e83fd54 100644 --- a/filter/Configuration_filter.mk +++ b/filter/Configuration_filter.mk @@ -477,6 +477,7 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_calc_types.xcu,f generic_Text \ calc_Gnumeric \ calc_Lotus \ + calc_Parquet \ calc_QPro \ calc_MS_Excel_40 \ calc_MS_Excel_40_VorlageTemplate \ @@ -535,6 +536,7 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_calc_filters.x calc_HTML_WebQuery \ calc_StarOffice_XML_Calc_Template \ calc_pdf_Export \ + calc_Parquet \ dBase \ calc8 \ calc8_template \ diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index 18d13a8f7796..a83a1406d0c1 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -211,6 +211,7 @@ int getFlatTypeRank(std::u16string_view rType) "calc_SYLK", "calc_DIF", "calc_dBase", + "Apache Parquet", // Binary (raster and vector image files) "emf_MS_Windows_Metafile", diff --git a/filter/source/config/fragments/filters/calc_Parquet.xcu b/filter/source/config/fragments/filters/calc_Parquet.xcu new file mode 100644 index 000000000000..5b0fea8257bb --- /dev/null +++ b/filter/source/config/fragments/filters/calc_Parquet.xcu @@ -0,0 +1,19 @@ +<!-- + * 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/. +--> +<node oor:name="Apache Parquet Spreadsheet" oor:op="replace"> + <prop oor:name="Flags"><value>IMPORT ALIEN PREFERRED</value></prop> + <prop oor:name="UIComponent"/> + <prop oor:name="FilterService"/> + <prop oor:name="UserData"/> + <prop oor:name="Type"><value>Apache Parquet</value></prop> + <prop oor:name="TemplateName"/> + <prop oor:name="DocumentService"><value>com.sun.star.sheet.SpreadsheetDocument</value></prop> + <prop oor:name="UIName"> + <value xml:lang="en-US">Apache Parquet Spreadsheet</value> + </prop> +</node> diff --git a/filter/source/config/fragments/types/calc_Parquet.xcu b/filter/source/config/fragments/types/calc_Parquet.xcu new file mode 100644 index 000000000000..6c29d886c92f --- /dev/null +++ b/filter/source/config/fragments/types/calc_Parquet.xcu @@ -0,0 +1,17 @@ +<!-- + * 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/. +--> +<node oor:name="Apache Parquet" oor:op="replace" > + <prop oor:name="DetectService"><value>com.sun.star.comp.sc.OrcusFilterDetect</value></prop> + <prop oor:name="URLPattern"/> + <prop oor:name="Extensions"><value>parquet</value></prop> + <prop oor:name="MediaType"/> + <prop oor:name="Preferred"><value>true</value></prop> + <prop oor:name="PreferredFilter"><value>Apache Parquet Spreadsheet</value></prop> + <prop oor:name="UIName"><value xml:lang="en-US">Apache Parquet</value></prop> + <prop oor:name="ClipboardFormat"/> +</node> |