summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorAbhishek Shrivastava <x.abhishek.flyhigh@gmail.com>2018-01-23 12:49:10 +0530
committerAndras Timar <andras.timar@collabora.com>2018-03-06 21:38:00 +0100
commita34bf71bb491d749990426adfe1aea1c5cfbc456 (patch)
tree79a7b5475a47dd3d5dbd35cffe2a63f853a92160 /xmloff
parent050f68f5c1a1fc5e1d0502ff45ec5ddf7aa0df70 (diff)
tdf#106780 Fix for invalid attribute in impress ODF
This patch fixes the invalid ODF generated in impress. In tables now the attribute is shown as table:name="default" instead of "text:style-name". For strict XML version we only set table:name="default" For Extended/Compatibility XML we set both text:style-name and table:name Change-Id: I894fd31f5f0eed3f77b216b3114b5da53acf1f9f Reviewed-on: https://gerrit.libreoffice.org/48373 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit e3e2f6911d6231c706ce8c77e5cd6733335d6342) Reviewed-on: https://gerrit.libreoffice.org/48812 (cherry picked from commit 5563f111d5700bb03884cd469288b09281e37dd1) Reviewed-on: https://gerrit.libreoffice.org/48825 (cherry picked from commit fa3b7206f1b6f11dc3d133d06289aaaad3e422fd)
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/table/XMLTableExport.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 12d75906e471..1f8bf0e4f2bd 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -581,6 +581,8 @@ void XMLTableExport::exportTableTemplates()
for( sal_Int32 nIndex = 0; nIndex < xTableFamily->getCount(); nIndex++ ) try
{
+ SvtSaveOptions::ODFSaneDefaultVersion eVersion = mrExport.getSaneDefaultVersion();
+
Reference< XStyle > xTableStyle( xTableFamily->getByIndex( nIndex ), UNO_QUERY_THROW );
if( !xTableStyle->isInUse() )
continue;
@@ -607,7 +609,20 @@ void XMLTableExport::exportTableTemplates()
}
}
else
- mrExport.AddAttribute(XML_NAMESPACE_TEXT, XML_STYLE_NAME, GetExport().EncodeStyleName( xTableStyle->getName() ) );
+ {
+ // Below condition checks if any of the extended version of
+ // XML are set
+ if ((eVersion & SvtSaveOptions::ODFSVER_EXTENDED) != 0)
+ {
+ mrExport.AddAttribute(XML_NAMESPACE_TEXT, XML_STYLE_NAME, GetExport().EncodeStyleName( xTableStyle->getName() ) );
+ mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, GetExport().EncodeStyleName( xTableStyle->getName() ) );
+ }
+ else
+ {
+ mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, GetExport().EncodeStyleName( xTableStyle->getName() ) );
+ }
+
+ }
SvXMLElementExport tableTemplate( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_TEMPLATE, true, true );
@@ -632,7 +647,6 @@ void XMLTableExport::exportTableTemplates()
pElements++;
}
- SvtSaveOptions::ODFSaneDefaultVersion eVersion = mrExport.getSaneDefaultVersion();
if (mbWriter && ((eVersion & SvtSaveOptions::ODFSVER_EXTENDED) != 0))
{
pElements = getWriterSpecificTableStyleMap();