Kaydet (Commit) 302af8c2 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Thorsten Behrens

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/41411Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst cc2cb012
...@@ -1027,23 +1027,45 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr ...@@ -1027,23 +1027,45 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr
if(!bDone && pOLENd) if(!bDone && pOLENd)
{ {
Point aPosition(aAlignedGrfArea.Pos()); // SwOLENode does not have a known GraphicObject, need to
Size aSize(aAlignedGrfArea.SSize()); // work with Graphic instead
const Graphic* pGraphic = pOLENd->GetGraphic(); const Graphic* pGraphic = pOLENd->GetGraphic();
if ( pGraphic && pGraphic->GetType() != GraphicType::NONE ) 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 // shade the representation if the object is activated outplace
uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef(); uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef();
if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE ) 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 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() ); sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() );
if ( !bPrn && dynamic_cast< const SwCursorShell *>( pShell ) != nullptr && ( if ( !bPrn && dynamic_cast< const SwCursorShell *>( pShell ) != nullptr && (
......
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