summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-09-09 23:23:24 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-09-12 13:22:06 -0400
commita6d2e1ef128b375a76997f6fcc9b9c29a9dedc24 (patch)
treea7ca26d0725ccdbae1219174c3642fef2556c372 /sc
parentbc0afba780200f61462d7aeba40ca82ebb4bb21f (diff)
ResetChanged() now takes range list.
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/document.hxx2
-rw-r--r--sc/source/core/data/document.cxx17
-rw-r--r--sc/source/ui/docshell/docsh3.cxx10
3 files changed, 15 insertions, 14 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 53d796d3d80b..64ceab9ff86d 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -863,7 +863,7 @@ public:
const ::editeng::SvxBorderLine** ppRight,
const ::editeng::SvxBorderLine** ppBottom ) const;
- void ResetChanged( const ScRange& rRange );
+ void ResetChanged( const ScRangeList& rRanges );
void SetDirty();
void SetDirty( const ScRange& );
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()