tdf#170261: introduce XLSM 2010 (VBA) filters

This patch primarily allows exporting as an XLSM file
without forcing lowestEdited = 4 (2007)
Other than that, I don't think there will be any other impact
(and at this point we don't even know of lowestEdited impacts).

With this patch, the Excel 2010-365 (macro-enabled) filter
will be the default for:
- --convert-to (command line) xlsm
- GUI (save-as) xlsm
- LOKit download as xlsm
- TestFilter::XLSM unit tests

Change-Id: I5c5fac221b6a454a98df9034f59aba0a7d97880d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196788
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
This commit is contained in:
Justin Luth
2026-01-10 16:33:57 +01:00
parent e0380553b4
commit b5b2413db6
7 changed files with 72 additions and 4 deletions
+1 -1
View File
@@ -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 },
};
+2
View File
@@ -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 \
@@ -0,0 +1,30 @@
<!--
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<node oor:name="Calc Office Open XML VBA" oor:op="replace">
<prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER PREFERRED ENCRYPTION PASSWORDTOMODIFY SUPPORTSSIGNING</value></prop>
<prop oor:name="UIComponent"/>
<prop oor:name="FilterService"><value>com.sun.star.comp.oox.xls.ExcelFilter</value></prop>
<prop oor:name="UserData"><value>OOXML macro-enabled</value></prop>
<prop oor:name="FileFormatVersion"><value>1</value></prop>
<prop oor:name="Type"><value>Office Open XML Spreadsheet VBA</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">Excel 2010–365 (macro-enabled)</value>
</prop>
</node>
@@ -0,0 +1,27 @@
<!--
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<node oor:name="Office Open XML Spreadsheet VBA" oor:op="replace" >
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlsm</value></prop>
<prop oor:name="MediaType"><value>application/vnd.ms-excel.sheet.macroEnabled.12</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>Calc Office Open XML VBA</value></prop>
<prop oor:name="UIName"><value xml:lang="en-US">Excel XML VBA</value></prop>
<prop oor:name="ClipboardFormat"/>
</node>
+1 -1
View File
@@ -108,7 +108,7 @@ const std::unordered_map<TestFilter, OUString> 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 },
@@ -21,7 +21,7 @@
<node oor:name="ModuleDependendFilterOrder">
<node oor:name="com.sun.star.sheet.SpreadsheetDocument" oor:op="replace" install:module="calc">
<prop oor:name="SortedFilterList">
<value oor:separator=";">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</value>
<value oor:separator=";">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</value>
</prop>
</node>
<node oor:name="com.sun.star.drawing.DrawingDocument" oor:op="replace" install:module="draw">
+10 -1
View File
@@ -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" )