diff options
author | Armin Le Grand <alg@apache.org> | 2013-08-13 15:10:34 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2013-08-13 15:10:34 +0000 |
commit | 4ccb1eb7d58005ab3b501b7c6ff128fadbcd5066 (patch) | |
tree | 92e6bcbbec01c609ba3ab29151fb83e1f5a94101 /sc | |
parent | 0d29fb1f9e0ec97d7036d10fd10e91d6253f2b1a (diff) |
i122149 Corrected stuff around polygon-based clip regions, do not use them where nt needed
Notes
Notes:
merged as: b5c9668d34acdbce500609725760d6578debb95a
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 | 36 |
3 files changed, 26 insertions, 20 deletions
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index 9a1f1444ab47..8934fe82dcf9 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -245,7 +245,7 @@ public: void DrawSelectiveObjects(const sal_uInt16 nLayer); sal_Bool SetChangedClip(); // sal_False = nix - 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 e397dfa21560..73417791184f 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -4449,10 +4449,12 @@ void ScGridWindow::UpdateFormulas() aOutputData.FindChanged(); - PolyPolygon aChangedPoly( aOutputData.GetChangedArea() ); // logic (PixelToLogic) - if ( aChangedPoly.Count() ) + // #122149# 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( 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 3cc4797aa375..de3bb3a49b26 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1685,42 +1685,46 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor ) // 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 = sal_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( pDev->PixelToLogic(aDrawingRect) ) ); - bHad = sal_False; + aRegion.Union(pDev->PixelToLogic(aDrawingRect)); + bHad = false; } + nPosY += pRowInfo[nArrY].nHeight; } - if (bHad) - aPoly.Insert( Polygon( pDev->PixelToLogic(aDrawingRect) ) ); + if(bHad) + { + aRegion.Union(pDev->PixelToLogic(aDrawingRect)); + } - return aPoly; + return aRegion; } sal_Bool ScOutputData::SetChangedClip() |