From 4d4ce886672194a76ef1de327c97c484f7a50e51 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Wed, 28 Nov 2012 15:11:55 +0100 Subject: prevent some nasty ScRangeList->ScRange->ScRangeList conversion Change-Id: I9dac82ffeed920ce39aab16d89a91e2f9083908b --- sc/inc/document.hxx | 1 + sc/inc/docuno.hxx | 1 + sc/source/core/data/colorscale.cxx | 15 ++------------- sc/source/core/data/conditio.cxx | 4 +--- sc/source/core/data/documen8.cxx | 10 ++++++++++ sc/source/ui/unoobj/docuno.cxx | 6 ++++++ 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index f114ecb32365..1612b2fc0b08 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1523,6 +1523,7 @@ public: bool ContinueOnlineSpelling(); // TRUE = found s.th. void RepaintRange( const ScRange& rRange ); + void RepaintRange( const ScRangeList& rRange ); bool IsIdleDisabled() const { return bIdleDisabled; } void DisableIdle(bool bDo) { bIdleDisabled = bDo; } diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 4ec44634c285..69852358ed7d 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -136,6 +136,7 @@ public: ScSheetSaveData* GetSheetSaveData(); void RepaintRange( const ScRange& rRange ); + void RepaintRange( const ScRangeList& rRange ); bool HasChangesListeners() const; diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 5c087e0f9c4e..897f1b84a0ef 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -542,12 +542,7 @@ void ScColorScaleFormat::DataChanged(const ScRange& rRange) bool bNeedUpdate = CheckEntriesForRel(rRange); if(bNeedUpdate) { - size_t n = GetRange().size(); - for(size_t i = 0; i < n; ++i) - { - const ScRange* pRange = GetRange()[i]; - mpDoc->RepaintRange(*pRange); - } + mpDoc->RepaintRange(GetRange()); } } @@ -648,12 +643,7 @@ void ScDataBarFormat::DataChanged(const ScRange& rRange) if(bNeedUpdate) { - size_t n = GetRange().size(); - for(size_t i = 0; i < n; ++i) - { - const ScRange* pRange = GetRange()[i]; - mpDoc->RepaintRange(*pRange); - } + mpDoc->RepaintRange(GetRange()); } } @@ -929,7 +919,6 @@ condformat::ScFormatEntryType ScIconSetFormat::GetType() const void ScIconSetFormat::DataChanged( const ScRange& ) { - } void ScIconSetFormat::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab ) diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 7d3815f27256..f2d4aa0ef567 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1947,9 +1947,7 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified ) else { // all conditional format cells - size_t n = maRanges.size(); - for(size_t i = 0; i < n; ++i) - pDoc->RepaintRange(*maRanges[i]); + pDoc->RepaintRange( maRanges ); } } diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 23d4e8049c99..a8f2ff9a16e0 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -898,6 +898,16 @@ void ScDocument::RepaintRange( const ScRange& rRange ) } } +void ScDocument::RepaintRange( const ScRangeList& rRange ) +{ + if ( bIsVisible && pShell ) + { + ScModelObj* pModel = ScModelObj::getImplementation( pShell->GetModel() ); + if ( pModel ) + pModel->RepaintRange( rRange ); // locked repaints are checked there + } +} + //------------------------------------------------------------------------ bool ScDocument::IdleCheckLinks() // true = demnaechst wieder versuchen diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 388145c54b96..ac32d63779bd 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -449,6 +449,12 @@ void ScModelObj::RepaintRange( const ScRange& rRange ) pDocShell->PostPaint( rRange, PAINT_GRID ); } +void ScModelObj::RepaintRange( const ScRangeList& rRange ) +{ + if (pDocShell) + pDocShell->PostPaint( rRange, PAINT_GRID ); +} + uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException) { -- cgit v1.2.3