[Libreoffice-commits] core.git: sw/source

Armin Le Grand Armin.Le.Grand at cib.de
Tue Aug 22 12:44:53 UTC 2017


 sw/source/core/doc/notxtfrm.cxx |   34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

New commits:
commit 302af8c2da58719844d22483b65a9fe5b3674684
Author: Armin Le Grand <Armin.Le.Grand at 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.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at 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 && (


More information about the Libreoffice-commits mailing list