diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-06-14 11:23:13 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-06-15 10:45:11 +0200 |
commit | 559d194d80a20b17ba6aa6f94a7749bcc59c871e (patch) | |
tree | 7213ad3b6ab2201d4274d82164eab60c4db3088b /oox/source/export/vmlexport.cxx | |
parent | 4f4bc1ffc02ea1e0a18942322fdb0ade597c392c (diff) |
fdo#58819 DOCX VML export: fix shape size for rotated shapes
The problem is that we wrote the size of the shape itself, while VML wants the
bounding box here. The WW8 export ignores the rectangle given in
EscherEx::Commit(), uses SdrObject::GetSnapRect() instead and later refines the
position by using the point got in WW8AttributeOutput::OutputFlyFrame_Impl(),
see PlcDrawObj::WritePlc().
Do the same in the VML export, i.e. ignore the Rectangle we get in
VMLExport::Commit() and use SdrObject::GetSnapRect() + the point given
in DocxAttributeOutput::OutputFlyFrame_Impl() instead.
Change-Id: I5adbdf205792c87f92c1ddf1cf674f87e11eb54e
Diffstat (limited to 'oox/source/export/vmlexport.cxx')
-rw-r--r-- | oox/source/export/vmlexport.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 63f27a324e20..88065538d6dd 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -48,6 +48,7 @@ VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr pSerializer, VMLTextExport* , m_eVOri( 0 ) , m_eHRel( 0 ) , m_eVRel( 0 ) + , m_pNdTopLeft( 0 ) , m_pSdrObject( 0 ) , m_pShapeAttrList( NULL ) , m_nShapeType( ESCHER_ShpInst_Nil ) @@ -324,7 +325,15 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect if ( m_nShapeType == ESCHER_ShpInst_Line ) AddLineDimensions( rRect ); else - AddRectangleDimensions( *m_pShapeStyle, rRect ); + { + Rectangle aRect(rRect); + if (m_pNdTopLeft) + { + aRect = m_pSdrObject->GetSnapRect(); + aRect -= *m_pNdTopLeft; + } + AddRectangleDimensions( *m_pShapeStyle, aRect ); + } // properties bool bAlreadyWritten[ 0xFFF ]; @@ -1000,13 +1009,14 @@ void VMLExport::EndShape( sal_Int32 nShapeElement ) } } -sal_uInt32 VMLExport::AddSdrObject( const SdrObject& rObj, const sal_Int16 eHOri, const sal_Int16 eVOri, const sal_Int16 eHRel, const sal_Int16 eVRel ) +sal_uInt32 VMLExport::AddSdrObject( const SdrObject& rObj, const sal_Int16 eHOri, const sal_Int16 eVOri, const sal_Int16 eHRel, const sal_Int16 eVRel, const Point* pNdTopLeft ) { m_pSdrObject = &rObj; m_eHOri = eHOri; m_eVOri = eVOri; m_eHRel = eHRel; m_eVRel = eVRel; + m_pNdTopLeft = pNdTopLeft; return EscherEx::AddSdrObject(rObj); } |