[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - svx/source

Michael Stahl mstahl at redhat.com
Tue Feb 4 04:36:10 PST 2014


 svx/source/svdraw/svdpagv.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 9c2c06e3fbe990316577c6f001683d7ce130ad40
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Feb 3 11:26:59 2014 +0100

    fdo#74435: SdrPageView::DrawLayer(): hack to 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)
    
    Change-Id: Iafc595241df05204bccec1f2336014fc471b6602
    (cherry picked from commit 66f8b54931f193bdc844c6bca388d9bde98779cd)
    Reviewed-on: https://gerrit.libreoffice.org/7811
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index 310897d..43efb35 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));


More information about the Libreoffice-commits mailing list