summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lippka <christian.lippka@oracle.com>2010-10-04 15:39:07 +0200
committerChristian Lippka <christian.lippka@oracle.com>2010-10-04 15:39:07 +0200
commita806b5fefaf35380e521e3d4d9e2cbf85655633e (patch)
tree2fa861c01c044455a365d605009cd4bae3f71523
parent28b346ce5685616eac3bdcafdf4a94874bbe65e3 (diff)
impress201: #i97198# do not export draw tables and table/cell styles for impress/draw if SvtSaveOptions older than ODFVER_012
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx4
-rw-r--r--xmloff/source/draw/shapeexport4.cxx50
2 files changed, 32 insertions, 22 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index e8074759de..de6d7510f3 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -2282,7 +2282,9 @@ void SdXMLExport::_ExportStyles(BOOL bUsed)
// write draw:style-name for object graphic-styles
GetShapeExport()->ExportGraphicDefaults();
- GetShapeExport()->GetShapeTableExport()->exportTableStyles();
+ // do not export in ODF 1.1 or older
+ if( getDefaultVersion() >= SvtSaveOptions::ODFVER_012 )
+ GetShapeExport()->GetShapeTableExport()->exportTableStyles();
// write presentation styles
ImpWritePresentationStyles();
diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx
index 8d122d6f45..191caccac7 100644
--- a/xmloff/source/draw/shapeexport4.cxx
+++ b/xmloff/source/draw/shapeexport4.cxx
@@ -1117,38 +1117,46 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
SvXMLElementExport aElement( mrExport, XML_NAMESPACE_DRAW, XML_FRAME, bCreateNewline, sal_True );
- if( !bIsEmptyPresObj )
+ // do not export in ODF 1.1 or older
+ if( mrExport.getDefaultVersion() >= SvtSaveOptions::ODFVER_012 )
{
- uno::Reference< container::XNamed > xTemplate( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TableTemplate" ) ) ), uno::UNO_QUERY );
- if( xTemplate.is() )
+ if( !bIsEmptyPresObj )
{
- const OUString sTemplate( xTemplate->getName() );
- if( sTemplate.getLength() )
+ uno::Reference< container::XNamed > xTemplate( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TableTemplate" ) ) ), uno::UNO_QUERY );
+ if( xTemplate.is() )
{
- mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TEMPLATE_NAME, sTemplate );
-
- for( const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0]; pEntry->msApiName; pEntry++ )
+ const OUString sTemplate( xTemplate->getName() );
+ if( sTemplate.getLength() )
{
- try
- {
- sal_Bool bBool = sal_False;
- const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) );
+ mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TEMPLATE_NAME, sTemplate );
- xPropSet->getPropertyValue( sAPIPropertyName ) >>= bBool;
- if( bBool )
- mrExport.AddAttribute(pEntry->mnNameSpace, pEntry->meXMLName, XML_TRUE );
- }
- catch( uno::Exception& )
+ for( const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0]; pEntry->msApiName; pEntry++ )
{
- DBG_ERROR("XMLShapeExport::ImpExportTableShape(), exception caught!");
+ try
+ {
+ sal_Bool bBool = sal_False;
+ const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) );
+
+ xPropSet->getPropertyValue( sAPIPropertyName ) >>= bBool;
+ if( bBool )
+ mrExport.AddAttribute(pEntry->mnNameSpace, pEntry->meXMLName, XML_TRUE );
+ }
+ catch( uno::Exception& )
+ {
+ DBG_ERROR("XMLShapeExport::ImpExportTableShape(), exception caught!");
+ }
}
}
}
+
+
+ uno::Reference< table::XColumnRowRange > xRange( xPropSet->getPropertyValue( msModel ), uno::UNO_QUERY_THROW );
+ GetShapeTableExport()->exportTable( xRange );
}
- uno::Reference< table::XColumnRowRange > xRange( xPropSet->getPropertyValue( msModel ), uno::UNO_QUERY_THROW );
-
- GetShapeTableExport()->exportTable( xRange );
+ }
+ if( !bIsEmptyPresObj )
+ {
uno::Reference< graphic::XGraphic > xGraphic( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReplacementGraphic" ) ) ), uno::UNO_QUERY );
if( xGraphic.is() ) try
{