diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-05-03 22:20:42 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-05-03 22:20:42 -0400 |
commit | 9ba100be28096667e32c81ddb17261b1074c1288 (patch) | |
tree | 8de8e9cd178ed595b2bb6678a065530cfeab5153 /sc/source/ui | |
parent | 184b7e7b959a1769d84f9a1581c71dd315eb184d (diff) |
fdo#36051: Eliminated the hang due to removal of autofill undo object.
An artifact of the old code, which appears to do nothing meaningful
today was performing an incredibly slow operation upon destruction of
the autofill undo object. Removed it, and also removed several other
methods and data members that were used only in that removed code.
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/inc/undoblk.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk3.cxx | 50 |
3 files changed, 6 insertions, 57 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index c9d600f34d9c..62ced922b01f 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4023,8 +4023,7 @@ sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMar { rDocShell.GetUndoManager()->AddUndoAction( new ScUndoAutoFill( &rDocShell, aDestArea, aSourceArea, pUndoDoc, aMark, - eDir, FILL_SIMPLE, FILL_DAY, MAXDOUBLE, 1.0, 1e307, - pDoc->GetRangeName()->GetSharedMaxIndex()+1 ) ); + eDir, FILL_SIMPLE, FILL_DAY, MAXDOUBLE, 1.0, 1e307) ); } rDocShell.PostPaintGridAll(); @@ -4143,8 +4142,7 @@ sal_Bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMar { rDocShell.GetUndoManager()->AddUndoAction( new ScUndoAutoFill( &rDocShell, aDestArea, aSourceArea, pUndoDoc, aMark, - eDir, eCmd, eDateCmd, fStart, fStep, fMax, - pDoc->GetRangeName()->GetSharedMaxIndex()+1 ) ); + eDir, eCmd, eDateCmd, fStart, fStep, fMax) ); } bSuccess = sal_True; @@ -4271,8 +4269,7 @@ sal_Bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillD { rDocShell.GetUndoManager()->AddUndoAction( new ScUndoAutoFill( &rDocShell, aDestArea, aSourceArea, pUndoDoc, aMark, - eDir, eCmd, eDateCmd, MAXDOUBLE, fStep, fMax, - pDoc->GetRangeName()->GetSharedMaxIndex()+1 ) ); + eDir, eCmd, eDateCmd, MAXDOUBLE, fStep, fMax) ); } rDocShell.PostPaintGridAll(); diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx index d8617490219a..16fc7591ac08 100644 --- a/sc/source/ui/inc/undoblk.hxx +++ b/sc/source/ui/inc/undoblk.hxx @@ -421,8 +421,7 @@ public: ScDocument* pNewUndoDoc, const ScMarkData& rMark, FillDir eNewFillDir, FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd, - double fNewStartValue, double fNewStepValue, double fNewMaxValue, - sal_uInt16 nMaxShIndex ); + double fNewStartValue, double fNewStepValue, double fNewMaxValue ); virtual ~ScUndoAutoFill(); virtual void Undo(); @@ -444,7 +443,6 @@ private: double fMaxValue; sal_uLong nStartChangeAction; sal_uLong nEndChangeAction; - sal_uInt16 nMaxSharedIndex; void SetChangeTrack(); }; diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 446e3dede1c6..45ea822f2090 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -602,8 +602,7 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, const ScRange& rRange, const ScRange& rSourceArea, ScDocument* pNewUndoDoc, const ScMarkData& rMark, FillDir eNewFillDir, FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd, - double fNewStartValue, double fNewStepValue, double fNewMaxValue, - sal_uInt16 nMaxShIndex ) + double fNewStartValue, double fNewStepValue, double fNewMaxValue ) // : ScBlockUndo( pNewDocShell, rRange, SC_UNDO_AUTOHEIGHT ), // @@ -615,8 +614,7 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, eFillDateCmd ( eNewFillDateCmd ), fStartValue ( fNewStartValue ), fStepValue ( fNewStepValue ), - fMaxValue ( fNewMaxValue ), - nMaxSharedIndex ( nMaxShIndex) + fMaxValue ( fNewMaxValue ) { SetChangeTrack(); } @@ -626,7 +624,6 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, ScUndoAutoFill::~ScUndoAutoFill() { - pDocShell->GetDocument()->EraseNonUsedSharedNames(nMaxSharedIndex); delete pUndoDoc; } @@ -649,26 +646,6 @@ void ScUndoAutoFill::SetChangeTrack() nStartChangeAction = nEndChangeAction = 0; } -namespace { - -bool eraseNameContaining(ScRangeName& rNames, const rtl::OUString& rCriteria) -{ - ScRangeName::iterator itr = rNames.begin(), itrEnd = rNames.end(); - for (; itr != itrEnd; ++itr) - { - rtl::OUString aRName = itr->GetName(); - if (aRName.indexOf(rCriteria) >= 0) - { - // Criteria found. Erase this. - rNames.erase(itr); - return true; - } - } - return false; -} - -} - void ScUndoAutoFill::Undo() { BeginUndo(); @@ -698,29 +675,6 @@ void ScUndoAutoFill::Undo() if (pViewShell) pViewShell->CellContentChanged(); -// Shared-Names loeschen -// Falls Undo ins Dokument gespeichert -// => automatisches Loeschen am Ende -// umarbeiten!! - - String aName = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("___SC_")); - aName += String::CreateFromInt32(nMaxSharedIndex); - aName += '_'; - ScRangeName* pRangeName = pDoc->GetRangeName(); - bool bHasFound = false; - // Remove all range names that contain ___SC_... - while (true) - { - bool bErased = eraseNameContaining(*pRangeName, aName); - if (bErased) - bHasFound = true; - else - break; - } - - if (bHasFound) - pRangeName->SetSharedMaxIndex(pRangeName->GetSharedMaxIndex()-1); - ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); if ( pChangeTrack ) pChangeTrack->Undo( nStartChangeAction, nEndChangeAction ); |