diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 1e6f3cfb1ad5..bfe63048f913 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -355,7 +355,7 @@ constexpr ExtensionMap aCalcExtensionMap[] = { "pdf", u"calc_pdf_Export"_ustr }, { "xhtml", u"XHTML Calc File"_ustr }, { "xls", u"MS Excel 97"_ustr }, - { "xlsm", u"Calc MS Excel 2007 VBA XML"_ustr }, + { "xlsm", u"Calc Office Open XML VBA"_ustr }, { "xlsx", u"Calc Office Open XML"_ustr }, { "png", u"calc_png_Export"_ustr }, }; diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk index 7dcf7c7489d2..68848df382ba 100644 --- a/filter/Configuration_filter.mk +++ b/filter/Configuration_filter.mk @@ -497,6 +497,7 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_calc_types.xcu,f MS_Excel_2007_Binary \ calc_OOXML \ calc_OOXML_Template \ + calc_OOXML_VBA \ calc_MS_Works_Document \ calc_WPS_Lotus_Document \ calc_WPS_QPro_Document \ @@ -546,6 +547,7 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_calc_filters.x calc_MS_Excel_2007_Binary \ calc_OOXML \ calc_OOXML_Template \ + calc_OOXML_VBA \ MS_Works_Calc \ WPS_Lotus_Calc \ WPS_QPro_Calc \ diff --git a/filter/source/config/fragments/filters/calc_OOXML_VBA.xcu b/filter/source/config/fragments/filters/calc_OOXML_VBA.xcu new file mode 100644 index 000000000000..2c3238a9c12a --- /dev/null +++ b/filter/source/config/fragments/filters/calc_OOXML_VBA.xcu @@ -0,0 +1,30 @@ + + + IMPORT EXPORT ALIEN 3RDPARTYFILTER PREFERRED ENCRYPTION PASSWORDTOMODIFY SUPPORTSSIGNING + + com.sun.star.comp.oox.xls.ExcelFilter + OOXML macro-enabled + 1 + Office Open XML Spreadsheet VBA + + com.sun.star.sheet.SpreadsheetDocument + + Excel 2010–365 (macro-enabled) + + diff --git a/filter/source/config/fragments/types/calc_OOXML_VBA.xcu b/filter/source/config/fragments/types/calc_OOXML_VBA.xcu new file mode 100644 index 000000000000..3e2082248734 --- /dev/null +++ b/filter/source/config/fragments/types/calc_OOXML_VBA.xcu @@ -0,0 +1,27 @@ + + + com.sun.star.comp.oox.FormatDetector + + xlsm + application/vnd.ms-excel.sheet.macroEnabled.12 + true + Calc Office Open XML VBA + Excel XML VBA + + diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index dbf046cb4abb..058581649c00 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -108,7 +108,7 @@ const std::unordered_map TestFilterNames{ { TestFilter::XHTML_DRAW, u"XHTML Draw File"_ustr }, { TestFilter::XHTML_WRITER, u"XHTML Writer File"_ustr }, { TestFilter::XLS, u"MS Excel 97"_ustr }, - { TestFilter::XLSM, u"Calc MS Excel 2007 VBA XML"_ustr }, + { TestFilter::XLSM, u"Calc Office Open XML VBA"_ustr }, { TestFilter::XLST, u"Calc MS Excel 2007 XML Template"_ustr }, { TestFilter::XLSX, u"Calc Office Open XML"_ustr }, { TestFilter::XLSX_2007, u"Calc MS Excel 2007 XML"_ustr }, diff --git a/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu b/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu index f8dc51a005d0..3ed3136efec1 100644 --- a/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu +++ b/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu @@ -21,7 +21,7 @@ - calc8;calc8_template;StarOffice XML (Calc);calc_StarOffice_XML_Calc_Template;OpenDocument Spreadsheet Flat XML;UOF spreadsheet;Calc Office Open XML;Calc Office Open XML Template;;MS Excel 97;MS Excel 97 Vorlage/Template;MS Excel 95;MS Excel 95 Vorlage/Template;MS Excel 5.0/95;MS Excel 5.0/95 Vorlage/Template;MS Excel 4.0;MS Excel 4.0 Vorlage/Template;;DIF;dBase;HTML (StarCalc);Lotus;Pocket Excel;Quattro Pro 6.0;Rich Text Format (StarCalc);SYLK;Text - txt - csv (StarCalc);calc_HTML_WebQuery;ADO Rowset XML;Calc MS Excel 2007 XML;Calc MS Excel 2007 XML Template;Calc MS Excel 2007 Binary;Calc MS Excel 2007 VBA XML;MS Excel 2003 XML + calc8;calc8_template;StarOffice XML (Calc);calc_StarOffice_XML_Calc_Template;OpenDocument Spreadsheet Flat XML;UOF spreadsheet;Calc Office Open XML;Calc Office Open XML Template;Calc Office Open XML VBA;MS Excel 97;MS Excel 97 Vorlage/Template;MS Excel 95;MS Excel 95 Vorlage/Template;MS Excel 5.0/95;MS Excel 5.0/95 Vorlage/Template;MS Excel 4.0;MS Excel 4.0 Vorlage/Template;;DIF;dBase;HTML (StarCalc);Lotus;Pocket Excel;Quattro Pro 6.0;Rich Text Format (StarCalc);SYLK;Text - txt - csv (StarCalc);calc_HTML_WebQuery;ADO Rowset XML;Calc MS Excel 2007 XML;Calc MS Excel 2007 XML Template;Calc MS Excel 2007 Binary;Calc MS Excel 2007 VBA XML;MS Excel 2003 XML diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx index cad537f7d490..c13e3ed5df25 100644 --- a/oox/source/core/filterdetect.cxx +++ b/oox/source/core/filterdetect.cxx @@ -263,7 +263,16 @@ OUString FilterDetectDocHandler::getFilterNameFromContentType( std::u16string_vi } if (rContentType == u"application/vnd.ms-excel.sheet.macroEnabled.main+xml") - return u"MS Excel 2007 VBA XML"_ustr; + { + switch (maOOXMLVariant) + { + case OOXMLVariant::ISO_Transitional: + case OOXMLVariant::ISO_Strict: // Not supported, map to ISO transitional + return u"Office Open XML Spreadsheet VBA"_ustr; // Excel 2010+ + case OOXMLVariant::ECMA_Transitional: + return u"MS Excel 2007 VBA XML"_ustr; + } + } if( rContentType == u"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml" || rContentType == u"application/vnd.ms-excel.template.macroEnabled.main+xml" )