[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kformula/flake/tests
From:       Jeremias Epperlein <jeeree () web ! de>
Date:       2009-08-05 15:44:57
Message-ID: 1249487097.995328.25205.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1007355 by jeremiase:

Update the CursorTest, sorry for breaking compilation

 M  +14 -15    TestCursor.cpp  


--- trunk/koffice/kformula/flake/tests/TestCursor.cpp #1007354:1007355
@@ -30,6 +30,7 @@
 #include <KoSelection.h>
 #include <KoCanvasBase.h>
 #include <kdebug.h>
+#include <FormulaEditor.h>
 
 class MockCanvas : public KoCanvasBase
 {
@@ -84,23 +85,22 @@
     QCOMPARE(canvas->shapeManager()->selection()->count(),1);
     KoFormulaTool* tool= new KoFormulaTool(canvas);
     tool->activate();
-/*
-    FormulaCursor* cursor=tool->formulaCursor();
-    FormulaElement* root=cursor->formulaData()->formulaElement();
-    canvas->addCommand(new FormulaCommandUpdate(shape,cursor->insertText("ade")));
-    cursor->moveTo(root->childElements()[0],1);
-    //(a|de)
-    canvas->addCommand(new FormulaCommandUpdate(shape,cursor->insertText("bc")));
-    cursor->moveTo(root->childElements()[0],6);
+   FormulaEditor* editor=tool->formulaEditor();
+    FormulaElement* root=editor->formulaData()->formulaElement();
+    canvas->addCommand(new FormulaCommandUpdate(shape,editor->insertText("ade")));
+    editor->cursor().moveTo(root->childElements()[0],1);
+   //(a|de)
+    canvas->addCommand(new FormulaCommandUpdate(shape,editor->insertText("bc")));
+    editor->cursor().moveTo(root->childElements()[0],6);
     //(abcde|)
-    cursor->move(MoveLeft);
+    editor->cursor().move(MoveLeft);
     //(abcd|e)
-    QCOMPARE(cursor->position(),5);
-    cursor->moveTo(root->childElements()[0],0);
-    cursor->move(MoveLeft);
+    QCOMPARE(editor->cursor().position(),5);
+    editor->cursor().moveTo(root->childElements()[0],0);
+    editor->cursor().move(MoveLeft);
     //|(abcde)
-    QCOMPARE(cursor->position(),0);
-    canvas->addCommand(new FormulaCommandUpdate(shape,cursor->insertText("123")));
+    QCOMPARE(editor->cursor().position(),0);
+    canvas->addCommand(new FormulaCommandUpdate(shape,editor->insertText("123")));
     QCOMPARE(root->childElements().count(),2);
     //(12)(abcde)
     canvas->stack->undo();
@@ -109,7 +109,6 @@
     //(12)(abcde)
     QCOMPARE(root->childElements().count(),2);
     canvas->stack->clear();
-*/
 }
 
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic