diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlimp.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport4.cxx | 50 |
3 files changed, 35 insertions, 23 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/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index 9b44f4b19a..fbae1131c3 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -915,10 +915,12 @@ void SdXMLImport::SetViewSettings(const com::sun::star::uno::Sequence<com::sun:: { xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), uno::makeAny( aVisArea ) ); } - catch( com::sun::star::uno::Exception e ) + catch( com::sun::star::uno::Exception /*e*/ ) { +/* #i79978# since old documents may contain invalid view settings, this is nothing to worry the user about. uno::Sequence<OUString> aSeq(0); SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, aSeq, e.Message, NULL ); +*/ } } 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 { |