diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-08-22 10:05:15 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-08-22 14:42:28 +0200 |
commit | 302af8c2da58719844d22483b65a9fe5b3674684 (patch) | |
tree | 9a0d81cb81e1130e9467f1e4de2077cea78c38f5 /sw | |
parent | cc2cb0123ac599bf25c5e17b97b5d7bf93d3e487 (diff) |
sw: Use primitive renderer for graphics
To allow using the prepared VectorData of imported
Metafiles (and EMF+), let Writer use a Primitive
Renderer for Graphic output. For now, use a temp
PrimitiveRenderer (until sw is fully adapted to
primitives).
Change-Id: Iaa39111c5ef35a052394be6e4d1b86a5a8e33068
Reviewed-on: https://gerrit.libreoffice.org/41411
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 5baaef5e68da..c2c4cfae843a 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -1027,23 +1027,45 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr if(!bDone && pOLENd) { - Point aPosition(aAlignedGrfArea.Pos()); - Size aSize(aAlignedGrfArea.SSize()); - + // SwOLENode does not have a known GraphicObject, need to + // work with Graphic instead const Graphic* pGraphic = pOLENd->GetGraphic(); + if ( pGraphic && pGraphic->GetType() != GraphicType::NONE ) { - pGraphic->Draw( pOut, aPosition, aSize ); + GraphicObject aTempGraphicObject(*pGraphic); + GraphicAttr aGrfAttr; + + paintGraphicUsingPrimitivesHelper( + *pOut, + aTempGraphicObject, + aGrfAttr, + aAlignedGrfArea); // shade the representation if the object is activated outplace uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef(); if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE ) { - ::svt::EmbeddedObjectRef::DrawShading( tools::Rectangle( aPosition, aSize ), pOut ); + const Point aPosition(aAlignedGrfArea.Pos()); + const Size aSize(aAlignedGrfArea.SSize()); + + ::svt::EmbeddedObjectRef::DrawShading( + tools::Rectangle( + aPosition, + aSize), + pOut); } } else - ::svt::EmbeddedObjectRef::DrawPaintReplacement( tools::Rectangle( aPosition, aSize ), pOLENd->GetOLEObj().GetCurrentPersistName(), pOut ); + { + const Point aPosition(aAlignedGrfArea.Pos()); + const Size aSize(aAlignedGrfArea.SSize()); + + ::svt::EmbeddedObjectRef::DrawPaintReplacement( + tools::Rectangle(aPosition, aSize), + pOLENd->GetOLEObj().GetCurrentPersistName(), + pOut); + } sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() ); if ( !bPrn && dynamic_cast< const SwCursorShell *>( pShell ) != nullptr && ( |