Author: alg
Date: Thu Apr 11 14:09:19 2013
New Revision: 1466896
URL: http://svn.apache.org/r1466896
Log:
i122039 Take GraphicAttr into account for SVGs in Writer GraphicObjects
Modified:
openoffice/trunk/main/sw/source/core/doc/notxtfrm.cxx
Modified: openoffice/trunk/main/sw/source/core/doc/notxtfrm.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/doc/notxtfrm.cxx?rev=1466896&r1=1466895&r2=1466896&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/core/doc/notxtfrm.cxx (original)
+++ openoffice/trunk/main/sw/source/core/doc/notxtfrm.cxx Thu Apr 11 14:09:19
2013
@@ -75,6 +75,8 @@
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/processor2d/processor2dtools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
using namespace com::sun::star;
@@ -1036,10 +1038,43 @@ void SwNoTxtFrm::PaintPicture( OutputDev
aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom());
const bool bCropped(aGrfAttr.IsCropped());
+ drawinglayer::primitive2d::Primitive2DSequence
aContent;
+ GraphicAttr aSuppressGraphicAttr(aGrfAttr);
+
+ aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
+ aSuppressGraphicAttr.SetRotation(0);
+ aSuppressGraphicAttr.SetMirrorFlags(0);
+
+ const bool bNeedTransformedGraphic(
+ aSuppressGraphicAttr.IsSpecialDrawMode() ||
+ aSuppressGraphicAttr.IsAdjusted() ||
+ aSuppressGraphicAttr.IsMirrored() ||
+ aSuppressGraphicAttr.IsRotated() ||
+ aSuppressGraphicAttr.IsTransparent());
+
+ if(bNeedTransformedGraphic)
+ {
+ // #122039# need to apply graphic transformation
if GraphicAttr are used qwhich need this
+ const Graphic
aTransformedGraphic(rGrfObj.GetTransformedGraphic(&aSuppressGraphicAttr));
+ const basegfx::B2DRange
aRange(rSvgDataPtr->getRange());
+ const basegfx::B2DHomMatrix aTransform(
+
basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aRange.getRange(),
+ aRange.getMinimum()));
+
+ aContent.realloc(1);
+ aContent[0] = new
drawinglayer::primitive2d::BitmapPrimitive2D(
+ aTransformedGraphic.GetBitmapEx(),
+ aTransform);
+ }
+ else
+ {
+ aContent = rSvgDataPtr->getPrimitive2DSequence();
+ }
bDone = paintUsingPrimitivesHelper(
*pOut,
- rSvgDataPtr->getPrimitive2DSequence(),
+ aContent,
rSvgDataPtr->getRange(),
aTargetRange,
bCropped ? aGrfAttr.GetLeftCrop() : 0,