From 2661d7a5a1ce33f8cea9f9fb1132b49e08282a93 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 4 Feb 2011 16:18:43 +0100 Subject: vcl119: #i105133# tell fillFrameProps whether to apply transformation (thanks joekidd) --- sdext/source/pdfimport/tree/drawtreevisiting.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sdext/source/pdfimport/tree/drawtreevisiting.cxx') diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx index 5f1bb429ce8a..c68af3c37d86 100644 --- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx +++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx @@ -212,7 +212,9 @@ void DrawXmlEmitter::visit( ParagraphElement& elem, const std::list< Element* >: void DrawXmlEmitter::fillFrameProps( DrawElement& rElem, PropertyMap& rProps, - const EmitContext& rEmitContext ) + const EmitContext& rEmitContext, + bool bWasTransformed + ) { double rel_x = rElem.x, rel_y = rElem.y; @@ -223,7 +225,7 @@ void DrawXmlEmitter::fillFrameProps( DrawElement& rElem, const GraphicsContext& rGC = rEmitContext.rProcessor.getGraphicsContext( rElem.GCId ); - if( rGC.Transformation.isIdentity() ) + if( rGC.Transformation.isIdentity() || bWasTransformed ) { rProps[ USTR( "svg:x" ) ] = convertPixelToUnitString( rel_x ); rProps[ USTR( "svg:y" ) ] = convertPixelToUnitString( rel_y ); @@ -350,7 +352,10 @@ void DrawXmlEmitter::visit( PolyPolyElement& elem, const std::list< Element* >:: } PropertyMap aProps; - fillFrameProps( elem, aProps, m_rEmitContext ); + // PDFIProcessor transforms geometrical objects, not images and text + // so we need to tell fillFrameProps here that the transformation for + // a PolyPolyElement was already applied (aside form translation) + fillFrameProps( elem, aProps, m_rEmitContext, true ); rtl::OUStringBuffer aBuf( 64 ); aBuf.appendAscii( "0 0 " ); aBuf.append( convPx2mmPrec2(elem.w)*100.0 ); -- cgit