diff options
author | Joren De Cuyper <jorendc@libreoffice.org> | 2015-05-07 21:39:49 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-05-09 20:00:45 +0000 |
commit | 101cc7a8a471b50947ccca0711417b2c0f3ef574 (patch) | |
tree | 15c8bf146a0717e3339dde12c04918a02bc32324 /oox | |
parent | 8d74795e6e777cef0b1df64a56ea886208c87bc0 (diff) |
Do not write v:fill properties on export of imagedata
See validation log of fdo73214:
ERROR cvc-complex-type.3.2.2: Attribute 'type' is not allowed to appear in element 'v:imagedata'.
ERROR cvc-complex-type.3.2.2: Attribute 'color2' is not allowed to appear in element 'v:imagedata'.
http://dev-builds.libreoffice.org/crashtest/d879d5346b525c478e93363b7ec06e797ce01461/validation/docx/fdo73214-1.docx.log
Change-Id: I99eacc05ed28c3cd848326fd08f3668a1ce0f4fb
Reviewed-on: https://gerrit.libreoffice.org/15668
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/vmlexport.cxx | 77 |
1 files changed, 40 insertions, 37 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 570416d7c28d..a7ed878b59c8 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -562,39 +562,6 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect sal_uInt32 nValue; sax_fastparser::FastAttributeList *pAttrList = FastSerializerHelper::createAttrList(); - if ( rProps.GetOpt( ESCHER_Prop_fillType, nValue ) ) - { - const char *pFillType = NULL; - switch ( nValue ) - { - case ESCHER_FillSolid: pFillType = "solid"; break; - // TODO case ESCHER_FillPattern: pFillType = ""; break; - case ESCHER_FillTexture: pFillType = "tile"; break; - // TODO case ESCHER_FillPicture: pFillType = ""; break; - // TODO case ESCHER_FillShade: pFillType = ""; break; - // TODO case ESCHER_FillShadeCenter: pFillType = ""; break; - // TODO case ESCHER_FillShadeShape: pFillType = ""; break; - // TODO case ESCHER_FillShadeScale: pFillType = ""; break; - // TODO case ESCHER_FillShadeTitle: pFillType = ""; break; - // TODO case ESCHER_FillBackground: pFillType = ""; break; - default: -#if OSL_DEBUG_LEVEL > 0 - fprintf( stderr, "TODO: unhandled fill type\n" ); -#endif - break; - } - if ( pFillType ) - pAttrList->add( XML_type, pFillType ); - } - else if (!rProps.GetOpt(ESCHER_Prop_fillColor, nValue)) - pAttrList->add( XML_on, "false" ); - - if ( rProps.GetOpt( ESCHER_Prop_fillColor, nValue ) ) - impl_AddColor( m_pShapeAttrList, XML_fillcolor, nValue ); - - if ( rProps.GetOpt( ESCHER_Prop_fillBackColor, nValue ) ) - impl_AddColor( pAttrList, XML_color2, nValue ); - bool imageData = false; EscherPropSortStruct aStruct; if ( rProps.GetOpt( ESCHER_Prop_fillBlip, aStruct ) && m_pTextExport) @@ -613,14 +580,50 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect if ( rProps.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue ) ) impl_AddBool( pAttrList, FSNS(XML_o, XML_detectmouseclick), nValue != 0 ); - if (rProps.GetOpt(ESCHER_Prop_fillOpacity, nValue)) - // Partly undo the transformation at the end of EscherPropertyContainer::CreateFillProperties(): VML opacity is 0..1. - pAttrList->add(XML_opacity, OString::number(double((nValue * 100) >> 16) / 100)); - if (imageData) m_pSerializer->singleElementNS( XML_v, XML_imagedata, XFastAttributeListRef( pAttrList ) ); else + { + if ( rProps.GetOpt( ESCHER_Prop_fillType, nValue ) ) + { + const char *pFillType = NULL; + switch ( nValue ) + { + case ESCHER_FillSolid: pFillType = "solid"; break; + // TODO case ESCHER_FillPattern: pFillType = ""; break; + case ESCHER_FillTexture: pFillType = "tile"; break; + // TODO case ESCHER_FillPicture: pFillType = ""; break; + // TODO case ESCHER_FillShade: pFillType = ""; break; + // TODO case ESCHER_FillShadeCenter: pFillType = ""; break; + // TODO case ESCHER_FillShadeShape: pFillType = ""; break; + // TODO case ESCHER_FillShadeScale: pFillType = ""; break; + // TODO case ESCHER_FillShadeTitle: pFillType = ""; break; + // TODO case ESCHER_FillBackground: pFillType = ""; break; + default: + #if OSL_DEBUG_LEVEL > 0 + fprintf( stderr, "TODO: unhandled fill type\n" ); + #endif + break; + } + if ( pFillType ) + pAttrList->add( XML_type, pFillType ); + } + else if (!rProps.GetOpt(ESCHER_Prop_fillColor, nValue)) + pAttrList->add( XML_on, "false" ); + + if ( rProps.GetOpt( ESCHER_Prop_fillColor, nValue ) ) + impl_AddColor( m_pShapeAttrList, XML_fillcolor, nValue ); + + if ( rProps.GetOpt( ESCHER_Prop_fillBackColor, nValue ) ) + impl_AddColor( pAttrList, XML_color2, nValue ); + + + if (rProps.GetOpt(ESCHER_Prop_fillOpacity, nValue)) + // Partly undo the transformation at the end of EscherPropertyContainer::CreateFillProperties(): VML opacity is 0..1. + pAttrList->add(XML_opacity, OString::number(double((nValue * 100) >> 16) / 100)); m_pSerializer->singleElementNS( XML_v, XML_fill, XFastAttributeListRef( pAttrList ) ); + + } } bAlreadyWritten[ ESCHER_Prop_fillType ] = true; bAlreadyWritten[ ESCHER_Prop_fillColor ] = true; |