diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-21 00:44:59 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 21:49:20 -0400 |
commit | 9b016fd7e95cfb6789d329cadb94caa0b63ae80d (patch) | |
tree | 261b8b6640d4b5aadc73b4662dc10997b381417f /sc/source/ui/undo | |
parent | 4223e45a0cdf3dc589d0aaf3de2c9abba0ee64cd (diff) |
ScUndoPutCell is no longer used.
Change-Id: I9ccefaaf71c4a39c0d28155f6b38e72cfc909ca2
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r-- | sc/source/ui/undo/undocell.cxx | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index b7dfef5c9454..0fbeb51cd545 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -48,7 +48,6 @@ using ::boost::shared_ptr; TYPEINIT1(ScUndoCursorAttr, ScSimpleUndo); TYPEINIT1(ScUndoEnterData, ScSimpleUndo); TYPEINIT1(ScUndoEnterValue, ScSimpleUndo); -TYPEINIT1(ScUndoPutCell, ScSimpleUndo); TYPEINIT1(ScUndoSetCell, ScSimpleUndo); TYPEINIT1(ScUndoPageBreak, ScSimpleUndo); TYPEINIT1(ScUndoPrintZoom, ScSimpleUndo); @@ -416,88 +415,6 @@ sal_Bool ScUndoEnterValue::CanRepeat(SfxRepeatTarget& /* rTarget */) const return false; } -ScUndoPutCell::ScUndoPutCell( ScDocShell* pNewDocShell, const ScAddress& rNewPos, - ScBaseCell* pUndoCell, ScBaseCell* pRedoCell ) : - ScSimpleUndo( pNewDocShell ), - aPos ( rNewPos ), - pOldCell ( pUndoCell ), - pEnteredCell( pRedoCell ) -{ - SetChangeTrack(); -} - -ScUndoPutCell::~ScUndoPutCell() -{ - if (pOldCell) - pOldCell->Delete(); - if (pEnteredCell) - pEnteredCell->Delete(); -} - -rtl::OUString ScUndoPutCell::GetComment() const -{ - return ScGlobal::GetRscString( STR_UNDO_ENTERDATA ); // "Input" -} - -void ScUndoPutCell::SetChangeTrack() -{ - ScDocument* pDoc = pDocShell->GetDocument(); - ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); - if ( pChangeTrack ) - { - nEndChangeAction = pChangeTrack->GetActionMax() + 1; - pChangeTrack->AppendContent( aPos, pOldCell ); - if ( nEndChangeAction > pChangeTrack->GetActionMax() ) - nEndChangeAction = 0; // Nothing is appended - } - else - nEndChangeAction = 0; -} - -void ScUndoPutCell::Undo() -{ - BeginUndo(); - - ScDocument* pDoc = pDocShell->GetDocument(); - ScBaseCell* pNewCell = pOldCell ? pOldCell->Clone( *pDoc, aPos, SC_CLONECELL_STARTLISTENING ) : 0; - - pDoc->PutCell( aPos.Col(), aPos.Row(), aPos.Tab(), pNewCell ); - - pDocShell->PostPaintCell( aPos ); - - ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); - if ( pChangeTrack ) - pChangeTrack->Undo( nEndChangeAction, nEndChangeAction ); - - EndUndo(); -} - -void ScUndoPutCell::Redo() -{ - BeginRedo(); - - ScDocument* pDoc = pDocShell->GetDocument(); - ScBaseCell* pNewCell = pEnteredCell ? pEnteredCell->Clone( *pDoc, aPos, SC_CLONECELL_STARTLISTENING ) : 0; - - pDoc->PutCell( aPos.Col(), aPos.Row(), aPos.Tab(), pNewCell ); - - pDocShell->PostPaintCell( aPos ); - - SetChangeTrack(); - - EndRedo(); -} - -void ScUndoPutCell::Repeat(SfxRepeatTarget& /* rTarget */) -{ - // makes no sense -} - -sal_Bool ScUndoPutCell::CanRepeat(SfxRepeatTarget& /* rTarget */) const -{ - return false; -} - ScUndoSetCell::Value::Value() : meType(CELLTYPE_NONE), mfValue(0.0) {} ScUndoSetCell::Value::Value( double fValue ) : meType(CELLTYPE_VALUE), mfValue(fValue) {} ScUndoSetCell::Value::Value( const OUString& rString ) : meType(CELLTYPE_STRING), mpString(new OUString(rString)) {} |