[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Wed Mar 20 21:42:57 PDT 2013


 sc/source/ui/inc/undocell.hxx  |   26 ------------
 sc/source/ui/undo/undocell.cxx |   83 -----------------------------------------
 2 files changed, 109 deletions(-)

New commits:
commit b9ef706442909b89fb9ffd83e067ddc7303df1a8
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Mar 21 00:44:59 2013 -0400

    ScUndoPutCell is no longer used.
    
    Change-Id: I9ccefaaf71c4a39c0d28155f6b38e72cfc909ca2

diff --git a/sc/source/ui/inc/undocell.hxx b/sc/source/ui/inc/undocell.hxx
index 19bdee5..39c7595 100644
--- a/sc/source/ui/inc/undocell.hxx
+++ b/sc/source/ui/inc/undocell.hxx
@@ -132,32 +132,6 @@ private:
     void            SetChangeTrack();
 };
 
-
-class ScUndoPutCell: public ScSimpleUndo
-{
-public:
-                    TYPEINFO();
-                    ScUndoPutCell( ScDocShell* pNewDocShell,
-                            const ScAddress& rNewPos,
-                            ScBaseCell* pUndoCell, ScBaseCell* pRedoCell );
-    virtual         ~ScUndoPutCell();
-
-    virtual void    Undo();
-    virtual void    Redo();
-    virtual void    Repeat(SfxRepeatTarget& rTarget);
-    virtual sal_Bool    CanRepeat(SfxRepeatTarget& rTarget) const;
-
-    virtual rtl::OUString GetComment() const;
-
-private:
-    ScAddress       aPos;
-    ScBaseCell*     pOldCell;
-    ScBaseCell*     pEnteredCell;
-    sal_uLong           nEndChangeAction;
-
-    void            SetChangeTrack();
-};
-
 class ScUndoSetCell : public ScSimpleUndo
 {
 public:
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index b7dfef5..0fbeb51 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)) {}


More information about the Libreoffice-commits mailing list