diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-05-18 14:35:00 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2021-01-07 16:32:55 +0100 |
commit | da25c0035e9d5d243249777de5333c6eb6c1771b (patch) | |
tree | 9451ddbab1787b0b98467623a65b82b2dcc1807a /sw | |
parent | 3d3609e3773470b23680f78ebf259ddf4ff756d5 (diff) |
tdf#102256 sw: ODF export: don't write table:table in shapes
... for strict ODF versions, only write loext:table in extended.
Since commit 62391c28fae5099dd1f67c322867933fcb05bc9f LO can read the
loext:table elements, LO 4.4 should be sufficiently long ago.
Actually with ODF 1.2, the export asserts because loext namespace was
exported but isn't declared.
Change-Id: I92318f78b3282989de1d9c2764c2ed7663cb50b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94438
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 6a4fa1c9902b..6b5d36afd6eb 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -1089,15 +1089,26 @@ void SwXMLExport::ExportTable( const SwTableNode& rTableNd ) if (!rTable.GetTableStyleName().isEmpty()) AddAttribute(XML_NAMESPACE_TABLE, XML_TEMPLATE_NAME, rTable.GetTableStyleName()); - sal_uInt16 nPrefix = XML_NAMESPACE_TABLE; + ::std::optional<sal_uInt16> oPrefix = XML_NAMESPACE_TABLE; if (const SwFrameFormat* pFlyFormat = rTableNd.GetFlyFormat()) { if (SwTextBoxHelper::isTextBox(pFlyFormat, RES_FLYFRMFMT)) - nPrefix = XML_NAMESPACE_LO_EXT; + { + // TODO ODF 1.4 OFFICE-3761 + if (getSaneDefaultVersion() & SvtSaveOptions::ODFSVER_EXTENDED) + { + oPrefix = XML_NAMESPACE_LO_EXT; + } + else + { + oPrefix.reset(); // no export to OASIS namespace yet + } + } } + if (oPrefix) { - SvXMLElementExport aElem( *this, nPrefix, XML_TABLE, true, true ); + SvXMLElementExport aElem(*this, *oPrefix, XML_TABLE, true, true); // export DDE source (if this is a DDE table) if ( dynamic_cast<const SwDDETable*>( &rTable) != nullptr ) @@ -1132,7 +1143,7 @@ void SwXMLExport::ExportTable( const SwTableNode& rTableNd ) XML_DDE_SOURCE, true, false); } - SwXMLTableInfo_Impl aTableInfo( &rTable, nPrefix ); + SwXMLTableInfo_Impl aTableInfo(&rTable, *oPrefix); ExportTableLines( rTable.GetTabLines(), aTableInfo, rTable.GetRowsToRepeat() ); for( SwTableLine *pLine : const_cast<SwTable &>(rTable).GetTabLines() ) |