summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-03 11:26:59 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2014-02-05 11:37:40 +0000
commit94ae67fb31360343241010598d517b8c378bcf82 (patch)
treee89cfea6e14e1d43fdb4f2f160da4e892c0f06ac
parent9cb9d32c7a64bf5789eabe47d901237d78b44a4d (diff)
fdo#63433 fdo#74435: SdrPageView::DrawLayer(): avoid spuriously visible images
In the TestBook2.odt of fdo#73300 it happens that at some particular points when scrolling down, the ViewObjectContactOfPageHierarchy::getPrimitive2DSequenceHierarchy() will determine that > 200 images are visible; most likely this is due to an empty ObjectContactOfPageView::maViewInformation2D::getViewport(). Loading this many images may need more RAM than is available on 32bit platforms. That appears to happen only (but not always) if somehow (not sure how exactly) the rectangle passed to SdrPageView::DrawLayer() and the existing GetRedrawRegion() do not overlap at all. (regression from commit 8af09bf33291df2fb2bfbbd6e42f9bf074fcc4fc) (cherry picked from commit 66f8b54931f193bdc844c6bca388d9bde98779cd) Change-Id: Iafc595241df05204bccec1f2336014fc471b6602 Reviewed-on: https://gerrit.libreoffice.org/7813 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 5200d19a541b59141d15e3780f5197569b6b135e) Reviewed-on: https://gerrit.libreoffice.org/7846 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--svx/source/svdraw/svdpagv.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index cd133583dc24..bbd94bf4bb4e 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -350,7 +350,16 @@ void SdrPageView::DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget, sdr::con
// Copy existing paint region to use the same as prepared in BeginDrawLayer
SdrPaintWindow& rExistingPaintWindow = pPreparedTarget->GetPaintWindow();
const Region& rExistingRegion = rExistingPaintWindow.GetRedrawRegion();
- if ( rRect.IsEmpty() )
+ bool bUseRect(false);
+ if (!rRect.IsEmpty())
+ {
+ Region r(rExistingRegion);
+ r.Intersect(rRect);
+ // fdo#74435: FIXME: visibility check broken if empty
+ if (!r.IsEmpty())
+ bUseRect = true;
+ }
+ if (!bUseRect)
aTemporaryPaintWindow.SetRedrawRegion(rExistingRegion);
else
aTemporaryPaintWindow.SetRedrawRegion(Region(rRect));