sw/source/core/doc/notxtfrm.cxx | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-)
New commits: commit 302af8c2da58719844d22483b65a9fe5b3674684 Author: Armin Le Grand <armin.le.gr...@cib.de> Date: Tue Aug 22 10:05:15 2017 +0200 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.behr...@cib.de> Tested-by: Thorsten Behrens <thorsten.behr...@cib.de> 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 && ( _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits