summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-05-19 11:06:33 +0200
committerMichael Stahl <mstahl@redhat.com>2014-05-19 11:08:52 +0200
commit6dc48ef517b60adb7cfe09a65773d4ff7d69489c (patch)
tree281aa5125409940717cdabacb9a05d8ac5a2d1b9 /sw
parent638b808646976ae4c39da84ee88fbcfd22730b67 (diff)
fdo#78149: assert if SwVirtFlyDrawObj is being painted with no ViewPort set
Change-Id: I2f94a28d85fa31c5623ff0c6067edc7060998d9e
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/draw/dflyobj.cxx10
-rw-r--r--sw/source/core/inc/dflyobj.hxx3
2 files changed, 9 insertions, 4 deletions
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index c7b57fe5f519..80f09d7b42b6 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 f7b5da9a112b..a839716e42f4 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;