diff options
author | Rohit Deshmukh <rohit.deshmukh@synerzip.com> | 2014-01-06 11:26:46 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-01-24 08:43:08 +0000 |
commit | f1ec5dcfca45e9623d3da05503353df63e8dba4f (patch) | |
tree | 31b45d048744ef616c9f331fa311ea5b0ff690f8 /oox | |
parent | 93a2279c267e8c017550c4fe435d8c2718405aa2 (diff) |
fdo#69616: Fix for VML part missing for group.
Cause:
- In altenrate content, Fallback contains only group tag.
Implementation:
- Added export logic in Vml export.
- Added unit test case for vml group.
Change-Id: Ia1c9834950528dc892caea1cb675a7f42165d9ba
Reviewed-on: https://gerrit.libreoffice.org/7276
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/vmlexport.cxx | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 85003b7d5445..09600294042b 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -175,7 +175,7 @@ void VMLExport::AddShape( sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_uIn { m_nShapeType = nShapeType; m_nShapeFlags = nShapeFlags; - + m_pShapeAttrList->add( XML_name, ShapeIdString( nShapeId ) ); m_pShapeAttrList->add( XML_id, ShapeIdString( nShapeId ) ); } @@ -322,6 +322,10 @@ inline sal_Int32 impl_GetPointComponent( const sal_uInt8* &pVal, sal_uInt16 nPoi return nRet; } +void VMLExport::AddSdrObjectVMLObject( const SdrObject& rObj) +{ + m_pSdrObject = &rObj; +} void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect ) { if ( m_nShapeType == ESCHER_ShpInst_Nil ) @@ -385,11 +389,11 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect nTop = it->nPropValue; rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft ); } - - m_pShapeAttrList->add( XML_coordorigin, - OStringBuffer( 20 ).append( sal_Int32( nLeft ) ) - .append( "," ).append( sal_Int32( nTop ) ) - .makeStringAndClear() ); + if(nTop!=0 && nLeft!=0) + m_pShapeAttrList->add( XML_coordorigin, + OStringBuffer( 20 ).append( sal_Int32( nLeft ) ) + .append( "," ).append( sal_Int32( nTop ) ) + .makeStringAndClear() ); } bAlreadyWritten[ ESCHER_Prop_geoLeft ] = true; bAlreadyWritten[ ESCHER_Prop_geoTop ] = true; @@ -414,10 +418,11 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect rProps.GetOpt( ESCHER_Prop_geoRight, nRight ); } - m_pShapeAttrList->add( XML_coordsize, - OStringBuffer( 20 ).append( sal_Int32( nRight ) - sal_Int32( nLeft ) ) - .append( "," ).append( sal_Int32( nBottom ) - sal_Int32( nTop ) ) - .makeStringAndClear() ); + if(nTop!=0 && nLeft!=0 && nBottom!=0 && nRight!=0 ) + m_pShapeAttrList->add( XML_coordsize, + OStringBuffer( 20 ).append( sal_Int32( nRight ) - sal_Int32( nLeft ) ) + .append( "," ).append( sal_Int32( nBottom ) - sal_Int32( nTop ) ) + .makeStringAndClear() ); } bAlreadyWritten[ ESCHER_Prop_geoRight ] = true; bAlreadyWritten[ ESCHER_Prop_geoBottom ] = true; @@ -451,7 +456,8 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect { sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize ); sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize ); - aPath.append( "m" ).append( nX ).append( "," ).append( nY ); + if (nX >= 0 && nY >= 0 ) + aPath.append( "m" ).append( nX ).append( "," ).append( nY ); } break; case 0xb300: @@ -495,14 +501,15 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect { sal_Int32 nX = impl_GetPointComponent(pVerticesIt, nPointSize); sal_Int32 nY = impl_GetPointComponent(pVerticesIt, nPointSize); - aPath.append("l").append(nX).append(",").append(nY); + if (nX >= 0 && nY >= 0 ) + aPath.append("l").append(nX).append(",").append(nY); } break; } } - - if ( !aPath.isEmpty() ) - m_pShapeAttrList->add( XML_path, aPath.getStr() ); + OString pathString = aPath.makeStringAndClear(); + if ( !aPath.isEmpty() && pathString != "xe" ) + m_pShapeAttrList->add( XML_path, pathString ); } #if OSL_DEBUG_LEVEL > 0 else @@ -774,6 +781,17 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect bAlreadyWritten[ESCHER_Prop_fNoLineDrawDash] = true; } break; + case ESCHER_Prop_wzName: + { + SvMemoryStream aStream; + aStream.Write(it->pBuf, it->nPropSize); + aStream.Seek(0); + OUString idStr = SvxMSDffManager::MSDFFReadZString(aStream, it->nPropSize, true); + aStream.Seek(0); + m_pShapeAttrList->add(XML_ID, OUStringToOString(idStr, RTL_TEXTENCODING_UTF8)); + bAlreadyWritten[ESCHER_Prop_wzName] = true; + } + break; default: #if OSL_DEBUG_LEVEL > 0 fprintf( stderr, "TODO VMLExport::Commit(), unimplemented id: %d, value: %" SAL_PRIuUINT32 ", data: [%" SAL_PRIuUINT32 ", %p]\n", |