diff options
author | Armin Le Grand <alg@apache.org> | 2013-04-11 13:09:19 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2013-04-11 13:09:19 +0000 |
commit | 436b901a3b195a7e5089d1a03a46ed9442239610 (patch) | |
tree | 4bdee5423dd718112e55e7ad79df00ccaf70ecdc | |
parent | f45335265ec5597510bf7a17cf521906c0288b9d (diff) |
i122039 Take GraphicAttr into account for SVGs in Writer GraphicObjects
Notes
merged as: 721255a3c07a513c8ddecd01eba2531d8d612459
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 2c5b258c8a54..c76520fdb49f 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -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( OutputDevice* pOut, const SwRect &rGrfArea ) cons 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, |