diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-09-09 23:23:24 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-09-12 13:22:06 -0400 |
commit | a6d2e1ef128b375a76997f6fcc9b9c29a9dedc24 (patch) | |
tree | a7ca26d0725ccdbae1219174c3642fef2556c372 /sc/source | |
parent | bc0afba780200f61462d7aeba40ca82ebb4bb21f (diff) |
ResetChanged() now takes range list.
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/document.cxx | 17 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh3.cxx | 10 |
2 files changed, 14 insertions, 13 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 5522ac169e67..0b561ab8b7df 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3490,13 +3490,18 @@ sal_uInt16 ScDocument::GetErrCode( const ScAddress& rPos ) const } -void ScDocument::ResetChanged( const ScRange& rRange ) +void ScDocument::ResetChanged( const ScRangeList& rRanges ) { - SCTAB nStartTab = rRange.aStart.Tab(); - SCTAB nEndTab = rRange.aEnd.Tab(); - for (SCTAB nTab=nStartTab; nTab<=nEndTab && nTab < static_cast<SCTAB>(maTabs.size()); nTab++) - if (maTabs[nTab]) - maTabs[nTab]->ResetChanged( rRange ); + SCTAB nTabSize = static_cast<SCTAB>(maTabs.size()); + for (size_t i = 0, n = rRanges.size(); i < n; ++i) + { + const ScRange& rRange = *rRanges[i]; + SCTAB nTab1 = rRange.aStart.Tab(); + SCTAB nTab2 = rRange.aEnd.Tab(); + for (SCTAB nTab = nTab1; nTab1 <= nTab2 && nTab < nTabSize; ++nTab) + if (maTabs[nTab]) + maTabs[nTab]->ResetChanged(rRange); + } } // diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 3b71f726eeff..49b5f459efd2 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -182,14 +182,10 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, sal_uInt16 nPart, sal_uI aPaintRanges.Append(ScRange(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2)); } - for (size_t i = 0, n = aPaintRanges.size(); i < n; ++i) - { - const ScRange& r = *aPaintRanges[i]; - Broadcast(ScPaintHint(r, nPart)); + Broadcast(ScPaintHint(aPaintRanges.Combine(), nPart)); - if (nPart & PAINT_GRID) - aDocument.ResetChanged(r); - } + if (nPart & PAINT_GRID) + aDocument.ResetChanged(aPaintRanges); } void ScDocShell::PostPaintGridAll() |