Author: alg
Date: Tue Aug 13 15:06:58 2013
New Revision: 1513538
URL: http://svn.apache.org/r1513538
Log:
i122149 Do use RegionBand Regions in Calc after recalculation
Modified:
openoffice/branches/AOO401/main/sc/source/ui/inc/output.hxx
openoffice/branches/AOO401/main/sc/source/ui/view/gridwin.cxx
openoffice/branches/AOO401/main/sc/source/ui/view/output.cxx
Modified: openoffice/branches/AOO401/main/sc/source/ui/inc/output.hxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/sc/source/ui/inc/output.hxx?rev=1513538&r1=1513537&r2=1513538&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/sc/source/ui/inc/output.hxx (original)
+++ openoffice/branches/AOO401/main/sc/source/ui/inc/output.hxx Tue Aug 13
15:06:58 2013
@@ -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 );
Modified: openoffice/branches/AOO401/main/sc/source/ui/view/gridwin.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/sc/source/ui/view/gridwin.cxx?rev=1513538&r1=1513537&r2=1513538&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/sc/source/ui/view/gridwin.cxx (original)
+++ openoffice/branches/AOO401/main/sc/source/ui/view/gridwin.cxx Tue Aug 13
15:06:58 2013
@@ -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
Modified: openoffice/branches/AOO401/main/sc/source/ui/view/output.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/sc/source/ui/view/output.cxx?rev=1513538&r1=1513537&r2=1513538&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/sc/source/ui/view/output.cxx (original)
+++ openoffice/branches/AOO401/main/sc/source/ui/view/output.cxx Tue Aug 13
15:06:58 2013
@@ -1685,42 +1685,46 @@ void ScOutputData::DrawRotatedFrame( con
// Drucker
-PolyPolygon ScOutputData::GetChangedArea()
+Region ScOutputData::GetChangedAreaRegion()
{
- PolyPolygon aPoly;
+ Region aRegion;
+ Rectangle aDrawingRect;
+ bool bHad(false);
+ long nPosY = nScrY;
+ SCSIZE nArrY;
- Rectangle aDrawingRect;
- aDrawingRect.Left() = nScrX;
- aDrawingRect.Right() = nScrX+nScrW-1;
+ 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++)
- {
- RowInfo* pThisRowInfo = &pRowInfo[nArrY];
+ for(nArrY=1; nArrY+1<nArrCount; nArrY++)
+ {
+ RowInfo* pThisRowInfo = &pRowInfo[nArrY];
- if ( pThisRowInfo->bChanged )
- {
- if (!bHad)
- {
- aDrawingRect.Top() = nPosY;
- bHad = sal_True;
- }
- aDrawingRect.Bottom() = nPosY + pRowInfo[nArrY].nHeight
- 1;
- }
- else if (bHad)
- {
- aPoly.Insert( Polygon( pDev->PixelToLogic(aDrawingRect)
) );
- bHad = sal_False;
- }
- nPosY += pRowInfo[nArrY].nHeight;
- }
+ if(pThisRowInfo->bChanged)
+ {
+ if(!bHad)
+ {
+ aDrawingRect.Top() = nPosY;
+ bHad = true;
+ }
- if (bHad)
- aPoly.Insert( Polygon( pDev->PixelToLogic(aDrawingRect) ) );
+ aDrawingRect.Bottom() = nPosY + pRowInfo[nArrY].nHeight - 1;
+ }
+ else if(bHad)
+ {
+ aRegion.Union(pDev->PixelToLogic(aDrawingRect));
+ bHad = false;
+ }
+
+ nPosY += pRowInfo[nArrY].nHeight;
+ }
+
+ if(bHad)
+ {
+ aRegion.Union(pDev->PixelToLogic(aDrawingRect));
+ }
- return aPoly;
+ return aRegion;
}
sal_Bool ScOutputData::SetChangedClip()