Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi Michael, Jonas,

On Fri, 2011-02-11 at 10:15 +0000, Michael Meeks wrote:
      Quick question, while I'm here: what are the blockers for enabling this
by default on master ? was it undo/redo ? or do we have any malingering
known crashers / mis-features left.

I think Jonas fixed the crash I noticed.
There are 2 more bugs at bugzilla.freedesktop.org, I don't think they
would be too difficult to fix.

It seems that undo/redo is the major one and I just worked out why
undo/redo wasn't working, noticed it while looking at Caolán's unit
tests for starmath. I've attached the patch.

I made it also update the formula when undoing or redoing stuff. I
didn't enable updating only as an experimental feature, as I don't quite
get why it doesn't update already. It looked a little bad when undoing
from the visual formula editor. I hope it will be okay :)

I noticed that when undoing the cursor position goes to the front of the
formula, not sure that is too easy to fix, but I figure having undo is
better than not. Perhaps I could update the Easy Hack to be for this
instead.

It would be great to have Jonas' great work on by default, and with
undo/redo, perhaps it is now possible?

Regards,
Luke
From 9851ff6a87a3701fa5387aeccc1a7fdd3dd05e07 Mon Sep 17 00:00:00 2001
From: Luke Dixon <6b8b4567@gmail.com>
Date: Sun, 13 Feb 2011 16:28:22 +0000
Subject: [PATCH] Make Undo & Redo work with the visual formula editor.

---
 starmath/source/cursor.cxx   |    2 +-
 starmath/source/document.cxx |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 33ae549..4e65f48 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1461,7 +1461,7 @@ void SmCursor::EndEdit(){
     SmNodeToTextVisitor(pTree, formula);
     //pTree->CreateTextFromNode(formula);
     pDocShell->aText = formula;
-    pDocShell->GetEditEngine().SetText(formula);
+    pDocShell->GetEditEngine().SetText(0, formula);
 }
 
 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 )
             {
-- 
1.7.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.