[Libreoffice-commits] .: starmath/inc starmath/source starmath/visual-editor-todo

Jonas Finnemann Jensen jopsen at kemper.freedesktop.org
Tue Nov 2 12:48:05 PDT 2010


 starmath/inc/view.hxx       |    3 +++
 starmath/source/view.cxx    |   14 +++++++++++++-
 starmath/visual-editor-todo |    3 +--
 3 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 8137918224bbbc53b66ddf0babd0c53dfd3a3639
Author: Luke Dixon <6b8b4567 at gmail.com>
Date:   Mon Nov 1 21:57:49 2010 +0000

    Don't draw caret when visual formula editor looses focus.

diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 925b2cc..40c3aab 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -86,6 +86,9 @@ protected:
     virtual void StateChanged( StateChangedType eChanged );
     DECL_LINK(MenuSelectHdl, Menu *);
 
+private:
+    void RepaintViewShellDoc();
+
 public:
     SmGraphicWindow(SmViewShell* pShell);
     ~SmGraphicWindow();
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 7874d06..5c8581e 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -220,6 +220,8 @@ void SmGraphicWindow::GetFocus()
     pViewShell->GetEditWindow()->Flush();
     //Let view shell know what insertions should be done in visual editor
     pViewShell->SetInsertIntoEditWindow(FALSE);
+    SetIsCursorVisible(TRUE);
+    RepaintViewShellDoc();
 }
 
 void SmGraphicWindow::LoseFocus()
@@ -233,6 +235,16 @@ void SmGraphicWindow::LoseFocus()
         pAccessible->LaunchEvent( AccessibleEventId::STATE_CHANGED,
                 aOldValue, aNewValue );
     }
+    if (!IsInlineEditEnabled())
+        return;
+    SetIsCursorVisible(FALSE);
+    RepaintViewShellDoc();
+}
+
+void SmGraphicWindow::RepaintViewShellDoc()
+{
+    SmDocShell &rDoc = *pViewShell->GetDoc();
+    rDoc.Repaint();
 }
 
 void SmGraphicWindow::ShowCursor(BOOL bShow)
@@ -321,7 +333,7 @@ void SmGraphicWindow::Paint(const Rectangle&)
     SetFormulaDrawPos(aPoint);
     if(IsInlineEditEnabled()) {
         //Draw cursor if any...
-        if(pViewShell->GetDoc()->HasCursor())
+        if(pViewShell->GetDoc()->HasCursor() && IsCursorVisible())
             pViewShell->GetDoc()->GetCursor().Draw(*this, aPoint);
     } else {
     SetIsCursorVisible(FALSE);	// (old) cursor must be drawn again
diff --git a/starmath/visual-editor-todo b/starmath/visual-editor-todo
index e2555ab..0ccb955 100644
--- a/starmath/visual-editor-todo
+++ b/starmath/visual-editor-todo
@@ -25,8 +25,7 @@ Medium
 2. SmCursor` should support deletion of lines, rows, cols and sub-/superscripts.
 3. SmCursor::InsertSubSup() should wrap the body in a SmBraceNode if the body is an SmOperNode, SmBinVerNode, etc.
 4. Make caret in visual editor blink.
-5. Don't draw visual editor caret, when SmGraphicWindow doesn't have focus.
-6. When OpenOffice Math runs in standalone mode it centers the current formula, this is not nice for visual editing.
+5. When OpenOffice Math runs in standalone mode it centers the current formula, this is not nice for visual editing.
 
 Complex
 -------


More information about the Libreoffice-commits mailing list