summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-05-18 14:35:00 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-05-19 17:02:38 +0200
commitd705a860936a58e40a2894a12d02be585a06e1c1 (patch)
treed7298148e7de4fb0e28cc749de42f26393fcdf25
parentc529dd9b964e4176fed67d3c1594978c7d26ad7b (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>
-rw-r--r--sw/source/filter/xml/xmltble.cxx19
1 files changed, 15 insertions, 4 deletions
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 46a1e74c5c31..ce5aaf56630d 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -1094,15 +1094,26 @@ void SwXMLExport::ExportTable( const SwTableNode& rTableNd )
AddAttribute(XML_NAMESPACE_TABLE, XML_TEMPLATE_NAME, sStyleName);
}
- 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 )
@@ -1137,7 +1148,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() )