diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-15 16:55:49 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-15 16:55:49 -0500 |
commit | 3b1e88a8eb6b3f9da7c899a791e491db21d1bbdc (patch) | |
tree | 41708b78fae9e937d3fcb406b59ebd400092d2ec /sc | |
parent | 5fc37762b68c9b94734b84546fce2309ff7bb2c0 (diff) |
Reset formula cell's changed flag only for those within visible range.
Especially avoid marking all cells in all sheets which would cause a
performance problem.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen2.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/documen8.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 16 | ||||
-rw-r--r-- | sc/source/core/tool/addinlis.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/tool/adiasync.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh3.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 3 |
8 files changed, 10 insertions, 21 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index de903d0d8476..02cc60d7ff71 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -864,7 +864,7 @@ public: const ::editeng::SvxBorderLine** ppRight, const ::editeng::SvxBorderLine** ppBottom ) const; - void ResetChanged( const ScRangeList& rRanges ); + void ResetChanged( const ScRange& rRange ); void SetDirty(); void SetDirty( const ScRange& ); diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 223c50582a0c..5798f4d0b98d 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -336,7 +336,6 @@ IMPL_LINK( ScDocument, TrackTimeHdl, Timer*, EMPTYARG ) { TrackFormulas(); pShell->Broadcast( SfxSimpleHint( FID_DATACHANGED ) ); - ResetChanged( ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB) ); // modified... diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 914cfef6083f..1a439a73483d 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -1056,7 +1056,6 @@ void ScDocument::UpdateExternalRefLinks(Window* pWin) { TrackFormulas(); pShell->Broadcast( SfxSimpleHint(FID_DATACHANGED) ); - ResetChanged( ScRange(0, 0, 0, MAXCOL, MAXROW, MAXTAB) ); // #i101960# set document modified, as in TrackTimeHdl for DDE links if (!pShell->IsModified()) @@ -1117,7 +1116,6 @@ void ScDocument::UpdateDdeLinks(Window* pWin) // Formeln berechnen und painten wie im TrackTimeHdl TrackFormulas(); pShell->Broadcast( SfxSimpleHint( FID_DATACHANGED ) ); - ResetChanged( ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB) ); // wenn FID_DATACHANGED irgendwann mal asynchron werden sollte // (z.B. mit Invalidate am Window), muss hier ein Update erzwungen werden. diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 9f44829e504d..40e85d742d19 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3504,18 +3504,14 @@ sal_uInt16 ScDocument::GetErrCode( const ScAddress& rPos ) const } -void ScDocument::ResetChanged( const ScRangeList& rRanges ) +void ScDocument::ResetChanged( const ScRange& 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); - } + 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/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx index 267d006cf55c..292824a1e50c 100644 --- a/sc/source/core/tool/addinlis.cxx +++ b/sc/source/core/tool/addinlis.cxx @@ -135,7 +135,6 @@ void SAL_CALL ScAddInListener::modified( const ::com::sun::star::sheet::ResultEv ScDocument* pDoc = (ScDocument*)*ppDoc; pDoc->TrackFormulas(); pDoc->GetDocumentShell()->Broadcast( SfxSimpleHint( FID_DATACHANGED ) ); - pDoc->ResetChanged( ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB) ); } } diff --git a/sc/source/core/tool/adiasync.cxx b/sc/source/core/tool/adiasync.cxx index 341aee188fd0..208305f6bd4d 100644 --- a/sc/source/core/tool/adiasync.cxx +++ b/sc/source/core/tool/adiasync.cxx @@ -151,7 +151,6 @@ void ScAddInAsync::CallBack( sal_uLong nHandleP, void* pData ) ScDocument* pDoc = (ScDocument*)*ppDoc; pDoc->TrackFormulas(); pDoc->GetDocumentShell()->Broadcast( SfxSimpleHint( FID_DATACHANGED ) ); - pDoc->ResetChanged( ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB) ); } } diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index b392c2dc170e..b7a139fb00d0 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -105,8 +105,6 @@ void ScDocShell::PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddre void ScDocShell::PostDataChanged() { Broadcast( SfxSimpleHint( FID_DATACHANGED ) ); - aDocument.ResetChanged( ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB) ); - SFX_APP()->Broadcast(SfxSimpleHint( FID_ANYDATACHANGED )); // Navigator //! Navigator direkt benachrichtigen! } @@ -184,9 +182,6 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, sal_uInt16 nPart, sal_uI } Broadcast(ScPaintHint(aPaintRanges.Combine(), nPart)); - - if (nPart & PAINT_GRID) - aDocument.ResetChanged(aPaintRanges); } void ScDocShell::PostPaintGridAll() diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 1db7cd9b6205..1ee84cf3a0d7 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -885,6 +885,9 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod --nPaintCount; if (!nPaintCount) CheckNeedsRepaint(); + + // Flag drawn formula cells "unchanged". + pDoc->ResetChanged(ScRange(nX1,nY1,nTab,nX2,nY2,nTab)); } void ScGridWindow::CheckNeedsRepaint() |