diff options
author | Armin Le Grand <alg@apache.org> | 2013-08-13 15:10:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-14 11:32:19 +0100 |
commit | b5c9668d34acdbce500609725760d6578debb95a (patch) | |
tree | 0e61d3bb269c40fb010b86684637a9be9cb13c1b /sc | |
parent | b74a2e6ee80e30ed42ef99e24f85eb1d2df346ca (diff) |
Resolves: #i122149# Corrected stuff around polygon-based clip regions
do not use them where not needed
(cherry picked from commit 4ccb1eb7d58005ab3b501b7c6ff128fadbcd5066)
Conflicts:
basegfx/inc/basegfx/matrix/b2dhommatrixtools.hxx
basegfx/inc/basegfx/polygon/b2dpolygontools.hxx
basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx
basegfx/inc/basegfx/tuple/b2dtuple.hxx
basegfx/inc/basegfx/tuple/b3dtuple.hxx
sc/source/ui/inc/output.hxx
sc/source/ui/view/gridwin.cxx
sc/source/ui/view/output.cxx
vcl/win/source/gdi/salgdi.cxx
Change-Id: Ie265814a51180bffe3c821a3f2148cb3bb54ecad
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/output.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 34 |
3 files changed, 25 insertions, 19 deletions
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index 7e9af7f45a8e..cefeca8ec542 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -312,7 +312,7 @@ public: void DrawSelectiveObjects(const sal_uInt16 nLayer); sal_Bool SetChangedClip(); // sal_False = not - PolyPolygon GetChangedArea(); + Region GetChangedAreaRegion(); void FindChanged(); void SetPagebreakMode( ScPageBreakData* pPageData ); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 29016c2f4140..2b4e65784d61 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -4609,10 +4609,12 @@ void ScGridWindow::UpdateFormulas() aOutputData.FindChanged(); - PolyPolygon aChangedPoly( aOutputData.GetChangedArea() ); // logic (PixelToLogic) - if ( aChangedPoly.Count() ) + // #i122149# do not use old GetChangedArea() which used polygon-based Regions, but use + // the region-band based new version; anyways, only rectangles are added + Region aChangedRegion( aOutputData.GetChangedAreaRegion() ); // logic (PixelToLogic) + if(!aChangedRegion.IsEmpty()) { - Invalidate(Region(aChangedPoly)); + Invalidate(aChangedRegion); } CheckNeedsRepaint(); // #i90362# used to be called via Draw() - still needed here diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 6a5c8e65f28f..37b8c3166c03 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1867,42 +1867,46 @@ drawinglayer::processor2d::BaseProcessor2D* ScOutputData::CreateProcessor2D( ) // Drucker -PolyPolygon ScOutputData::GetChangedArea() +Region ScOutputData::GetChangedAreaRegion() { - PolyPolygon aPoly; - + Region aRegion; Rectangle aDrawingRect; + bool bHad(false); + long nPosY = nScrY; + SCSIZE nArrY; + aDrawingRect.Left() = nScrX; aDrawingRect.Right() = nScrX+nScrW-1; - sal_Bool bHad = false; - long nPosY = nScrY; - SCSIZE nArrY; - for (nArrY=1; nArrY+1<nArrCount; nArrY++) + for(nArrY=1; nArrY+1<nArrCount; nArrY++) { RowInfo* pThisRowInfo = &pRowInfo[nArrY]; - if ( pThisRowInfo->bChanged ) + if(pThisRowInfo->bChanged) { - if (!bHad) + if(!bHad) { aDrawingRect.Top() = nPosY; - bHad = sal_True; + bHad = true; } + aDrawingRect.Bottom() = nPosY + pRowInfo[nArrY].nHeight - 1; } - else if (bHad) + else if(bHad) { - aPoly.Insert( Polygon( mpDev->PixelToLogic(aDrawingRect) ) ); + aRegion.Union(mpDev->PixelToLogic(aDrawingRect)); bHad = false; } + nPosY += pRowInfo[nArrY].nHeight; } - if (bHad) - aPoly.Insert( Polygon( mpDev->PixelToLogic(aDrawingRect) ) ); + if(bHad) + { + aRegion.Union(mpDev->PixelToLogic(aDrawingRect)); + } - return aPoly; + return aRegion; } sal_Bool ScOutputData::SetChangedClip() |