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

Michael Stahl mstahl at redhat.com
Mon May 19 02:14:13 PDT 2014


 sw/source/core/draw/dflyobj.cxx |   10 +++++++---
 sw/source/core/inc/dflyobj.hxx  |    3 ++-
 2 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 6dc48ef517b60adb7cfe09a65773d4ff7d69489c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon May 19 11:06:33 2014 +0200

    fdo#78149: assert if SwVirtFlyDrawObj is being painted with no ViewPort set
    
    Change-Id: I2f94a28d85fa31c5623ff0c6067edc7060998d9e

diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index c7b57fe..80f09d7 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -168,7 +168,7 @@ namespace drawinglayer
 
             virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
 
-            // overloaded to allow callbacks to wrap_DoPaintObject
+            // override to allow callbacks to wrap_DoPaintObject
             virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const SAL_OVERRIDE;
 
             // data read access
@@ -233,7 +233,7 @@ namespace drawinglayer
             // when they do not know this primitive (and they do not). Inside wrap_DoPaintObject
             // there needs to be a test that paint is only done during SW repaints (see there).
             // Using this mechanism guarantees the correct Z-Order of the VirtualObject-based FlyFrames.
-            getSwVirtFlyDrawObj().wrap_DoPaintObject();
+            getSwVirtFlyDrawObj().wrap_DoPaintObject(rViewInformation);
 
             // call parent
             return BufferedDecompositionPrimitive2D::get2DDecomposition(rViewInformation);
@@ -445,7 +445,8 @@ namespace
 }
 // <--
 
-void SwVirtFlyDrawObj::wrap_DoPaintObject() const
+void SwVirtFlyDrawObj::wrap_DoPaintObject(
+    drawinglayer::geometry::ViewInformation2D const& rViewInformation) const
 {
     SwViewShell* pShell = pFlyFrm->getRootFrm()->GetCurrShell();
 
@@ -465,6 +466,9 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const
 
         if ( bDrawObject )
         {
+            // if there's no viewport set, all fly-frames will be painted,
+            // which is slow, wastes memory, and can cause other trouble.
+            assert(!rViewInformation.getViewport().isEmpty());
             if ( !pFlyFrm->IsFlyInCntFrm() )
             {
                 // it is also necessary to restore the VCL MapMode from ViewInformation since e.g.
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index f7b5da9..a839716 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -70,7 +70,8 @@ protected:
 
 public:
     // for paints triggered form ExecutePrimitive
-    void wrap_DoPaintObject() const;
+    void wrap_DoPaintObject(
+            drawinglayer::geometry::ViewInformation2D const&) const;
 
     // for simple access to inner and outer bounds
     basegfx::B2DRange getOuterBound() const;


More information about the Libreoffice-commits mailing list