[PATCH] Make Undo & Redo work with the visual formula editor

Luke Dixon 6b8b4567 at gmail.com
Tue Feb 15 14:46:54 PST 2011


and update todo list.
---
 starmath/source/cursor.cxx   |    3 ++-
 starmath/source/document.cxx |    1 +
 starmath/visual-editor-todo  |   13 ++++++-------
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 8685ee5..e9eb200 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1461,7 +1461,8 @@ void SmCursor::EndEdit(){
     SmNodeToTextVisitor(pTree, formula);
     //pTree->CreateTextFromNode(formula);
     pDocShell->aText = formula;
-    pDocShell->GetEditEngine().SetText(formula);
+    pDocShell->GetEditEngine().QuickInsertText( formula, ESelection( 0, 0, EE_PARA_ALL, EE_PARA_ALL ) );
+    pDocShell->GetEditEngine().QuickFormatDoc();
 }
 
 void SmCursor::RequestRepaint(){
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index d98c406..eddbe9b 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -1174,6 +1174,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
                     (pTmpUndoMgr->*fnDo)( 0 );
             }
             Repaint();
+            UpdateText();
             SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
             while( pFrm )
             {
diff --git a/starmath/visual-editor-todo b/starmath/visual-editor-todo
index b19c1e7..3be3fd2 100644
--- a/starmath/visual-editor-todo
+++ b/starmath/visual-editor-todo
@@ -36,10 +36,9 @@ Complex
 
 Complex and non-essential
 -------------------------
-1. Global clipboard integration
-2. Support undo/redo with UndoManager integration
-3. Consider improving GUI for "Formula Elements"-dialog, most buttons work with visual editor
-4. Consider allowing users to enter commands in visual editor, by prefixing the command...
-5. Optimize things, for instance SmCursor::AnnotateSelection() is called way too many places...
-6. Improve handling of MoveUp and MoveDown in SmCursor::Move, SmCaretPos2LineVisitor might need improvement.
-7. Synchronized command text caret and visual editor caret.
+* Global clipboard integration
+* Consider improving GUI for "Formula Elements"-dialog, most buttons work with visual editor
+* Consider allowing users to enter commands in visual editor, by prefixing the command...
+* Optimize things, for instance SmCursor::AnnotateSelection() is called way too many places...
+* Improve handling of MoveUp and MoveDown in SmCursor::Move, SmCaretPos2LineVisitor might need improvement.
+* Synchronized command text caret and visual editor caret.
-- 
1.7.4


--=-4d/x8mvHbkbL5t1Kfal0--



More information about the LibreOffice mailing list