Kaydet (Commit) 436b901a authored tarafından Armin Le Grand's avatar Armin Le Grand

i122039 Take GraphicAttr into account for SVGs in Writer GraphicObjects

üst f4533526
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment