summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/oox/export/vmlexport.hxx7
-rw-r--r--oox/source/export/vmlexport.cxx14
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx7
3 files changed, 23 insertions, 5 deletions
diff --git a/include/oox/export/vmlexport.hxx b/include/oox/export/vmlexport.hxx
index 31f5241b5ab6..57f888996d50 100644
--- a/include/oox/export/vmlexport.hxx
+++ b/include/oox/export/vmlexport.hxx
@@ -53,6 +53,9 @@ class OOX_DLLPUBLIC VMLExport : public EscherEx
/// Anchoring.
sal_Int16 m_eHOri, m_eVOri, m_eHRel, m_eVRel;
+ /// Parent position.
+ const Point* m_pNdTopLeft;
+
/// The object we're exporting.
const SdrObject* m_pSdrObject;
@@ -83,7 +86,9 @@ public:
/// Export the sdr object as VML.
///
/// Call this when you need to export the object as VML.
- sal_uInt32 AddSdrObject( const SdrObject& rObj, const sal_Int16 eHOri = -1, const sal_Int16 eVOri = -1, const sal_Int16 eHRel = -1, const sal_Int16 eVRel = -1 );
+ sal_uInt32 AddSdrObject( const SdrObject& rObj, const sal_Int16 eHOri = -1,
+ const sal_Int16 eVOri = -1, const sal_Int16 eHRel = -1, const
+ sal_Int16 eVRel = -1, const Point* pNdTopLeft = 0 );
protected:
/// Add an attribute to the generated <v:shape/> element.
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);
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b2aa7f3ff7ad..d2049fc4def9 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2689,7 +2689,7 @@ void DocxAttributeOutput::WritePostponedMath()
m_postponedMath = NULL;
}
-void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Point& /*rNdTopLeft*/ )
+void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Point& rNdTopLeft )
{
m_pSerializer->mark();
@@ -2735,7 +2735,10 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
const SwFrmFmt& rFrmFmt = rFrame.GetFrmFmt();
SwFmtHoriOrient rHoriOri = rFrmFmt.GetHoriOrient();
SwFmtVertOrient rVertOri = rFrmFmt.GetVertOrient();
- m_rExport.VMLExporter().AddSdrObject( *pSdrObj, rHoriOri.GetHoriOrient(), rVertOri.GetVertOrient(), rHoriOri.GetRelationOrient(), rVertOri.GetRelationOrient() );
+ m_rExport.VMLExporter().AddSdrObject( *pSdrObj,
+ rHoriOri.GetHoriOrient(), rVertOri.GetVertOrient(),
+ rHoriOri.GetRelationOrient(),
+ rVertOri.GetRelationOrient(), &rNdTopLeft );
m_pSerializer->endElementNS( XML_w, XML_pict );