Kaydet (Commit) bc0afba7 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

PostPaint() now takes range list.

üst 1920e462
...@@ -118,69 +118,78 @@ void ScDocShell::PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, ...@@ -118,69 +118,78 @@ void ScDocShell::PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
PostPaint(aRange, nPart, nExtFlags); PostPaint(aRange, nPart, nExtFlags);
} }
void ScDocShell::PostPaint( const ScRange& rRange, sal_uInt16 nPart, sal_uInt16 nExtFlags ) void ScDocShell::PostPaint( const ScRangeList& rRanges, sal_uInt16 nPart, sal_uInt16 nExtFlags )
{ {
SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col(); ScRangeList aPaintRanges;
SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row(); for (size_t i = 0, n = rRanges.size(); i < n; ++i)
SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab(); {
const ScRange& rRange = *rRanges[i];
SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col();
SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row();
SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab();
if (!ValidCol(nCol1)) nCol1 = MAXCOL; if (!ValidCol(nCol1)) nCol1 = MAXCOL;
if (!ValidRow(nRow1)) nRow1 = MAXROW; if (!ValidRow(nRow1)) nRow1 = MAXROW;
if (!ValidCol(nCol2)) nCol2 = MAXCOL; if (!ValidCol(nCol2)) nCol2 = MAXCOL;
if (!ValidRow(nRow2)) nRow2 = MAXROW; if (!ValidRow(nRow2)) nRow2 = MAXROW;
if ( pPaintLockData ) if ( pPaintLockData )
{
// #i54081# PAINT_EXTRAS still has to be brodcast because it changes the
// current sheet if it's invalid. All other flags added to pPaintLockData.
sal_uInt16 nLockPart = nPart & ~PAINT_EXTRAS;
if ( nLockPart )
{ {
//! nExtFlags ??? // #i54081# PAINT_EXTRAS still has to be brodcast because it changes the
pPaintLockData->AddRange( ScRange( nCol1, nRow1, nTab1, // current sheet if it's invalid. All other flags added to pPaintLockData.
nCol2, nRow2, nTab2 ), nLockPart ); sal_uInt16 nLockPart = nPart & ~PAINT_EXTRAS;
} if ( nLockPart )
{
//! nExtFlags ???
pPaintLockData->AddRange( ScRange( nCol1, nRow1, nTab1,
nCol2, nRow2, nTab2 ), nLockPart );
}
nPart &= PAINT_EXTRAS; // for broadcasting nPart &= PAINT_EXTRAS; // for broadcasting
if ( !nPart ) if (!nPart)
return; continue;
} }
if (nExtFlags & SC_PF_LINES) // Platz fuer Linien beruecksichtigen if (nExtFlags & SC_PF_LINES) // Platz fuer Linien beruecksichtigen
{ {
//! Abfrage auf versteckte Spalten/Zeilen! //! Abfrage auf versteckte Spalten/Zeilen!
if (nCol1>0) --nCol1; if (nCol1>0) --nCol1;
if (nCol2<MAXCOL) ++nCol2; if (nCol2<MAXCOL) ++nCol2;
if (nRow1>0) --nRow1; if (nRow1>0) --nRow1;
if (nRow2<MAXROW) ++nRow2; if (nRow2<MAXROW) ++nRow2;
} }
// um zusammengefasste erweitern // um zusammengefasste erweitern
if (nExtFlags & SC_PF_TESTMERGE) if (nExtFlags & SC_PF_TESTMERGE)
aDocument.ExtendMerge( nCol1, nRow1, nCol2, nRow2, nTab1 ); aDocument.ExtendMerge( nCol1, nRow1, nCol2, nRow2, nTab1 );
if ( nCol1 != 0 || nCol2 != MAXCOL ) if ( nCol1 != 0 || nCol2 != MAXCOL )
{
// Extend to whole rows if SC_PF_WHOLEROWS is set, or rotated or non-left
// aligned cells are contained (see UpdatePaintExt).
// Special handling for RTL text (#i9731#) is unnecessary now with full
// support of right-aligned text.
if ( ( nExtFlags & SC_PF_WHOLEROWS ) ||
aDocument.HasAttrib( nCol1,nRow1,nTab1,
MAXCOL,nRow2,nTab2, HASATTR_ROTATE | HASATTR_RIGHTORCENTER ) )
{ {
nCol1 = 0; // Extend to whole rows if SC_PF_WHOLEROWS is set, or rotated or non-left
nCol2 = MAXCOL; // aligned cells are contained (see UpdatePaintExt).
// Special handling for RTL text (#i9731#) is unnecessary now with full
// support of right-aligned text.
if ( ( nExtFlags & SC_PF_WHOLEROWS ) ||
aDocument.HasAttrib( nCol1,nRow1,nTab1,
MAXCOL,nRow2,nTab2, HASATTR_ROTATE | HASATTR_RIGHTORCENTER ) )
{
nCol1 = 0;
nCol2 = MAXCOL;
}
} }
aPaintRanges.Append(ScRange(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2));
} }
Broadcast( ScPaintHint( ScRange( nCol1, nRow1, nTab1, for (size_t i = 0, n = aPaintRanges.size(); i < n; ++i)
nCol2, nRow2, nTab2 ), nPart ) ); {
const ScRange& r = *aPaintRanges[i];
Broadcast(ScPaintHint(r, nPart));
if ( nPart & PAINT_GRID ) if (nPart & PAINT_GRID)
aDocument.ResetChanged( ScRange(nCol1,nRow1,nTab1,nCol2,nRow2,nTab2) ); aDocument.ResetChanged(r);
}
} }
void ScDocShell::PostPaintGridAll() void ScDocShell::PostPaintGridAll()
......
...@@ -334,7 +334,7 @@ public: ...@@ -334,7 +334,7 @@ public:
void PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, void PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, sal_uInt16 nPart, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, sal_uInt16 nPart,
sal_uInt16 nExtFlags = 0 ); sal_uInt16 nExtFlags = 0 );
void PostPaint( const ScRange& rRange, sal_uInt16 nPart, sal_uInt16 nExtFlags = 0 ); void PostPaint( const ScRangeList& rRanges, sal_uInt16 nPart, sal_uInt16 nExtFlags = 0 );
void PostPaintCell( SCCOL nCol, SCROW nRow, SCTAB nTab ); void PostPaintCell( SCCOL nCol, SCROW nRow, SCTAB nTab );
void PostPaintCell( const ScAddress& rPos ); void PostPaintCell( const ScAddress& rPos );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment