<div>Hi Luke,</div><div><br></div><div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">


It seems that undo/redo is the major one and I just worked out why<br>undo/redo wasn&#39;t working, noticed it while looking at Caolán&#39;s unit<br>tests for starmath. I&#39;ve attached the patch.</blockquote></div><div>


It would be major step to get that issue fixed... And you&#39;re going the right way, but your patch doesn&#39;t work if the formula is written in multiple lines...</div><div>try, writing the formula 3+3+3 \n \n \n \n +4+4 (replace \n by line break not NEWLINE but whitespace linebreak).</div>


<div>Then in visual editor delete +3, go into the command editor again and back into the visual editor and notice that it now says 3+3+4+4+4+4.</div><div>The command editor will say  { 3 + 3 + 4 + 4 }  \n \n \n \n +4+4, because the SetText(0, formula) only replaced the first paragraph...</div>


<div><br></div><div>What I understand from editeng_8.cxx line 1621 (see [1]) is that the number you pass in setText(0, formula), is the paragraph to be replaced by the text...</div><div>The method signature is EditEngine::SetText( sal_uInt16 nPara, const XubString&amp; rTxt ), and it calls SelectParagraph(nPara)........</div>


<div>At least that&#39;s what I can decrypt from the sources... (I think I&#39;ve seen ROT13 variants that was easier to read).</div><div><br></div><div>I have no idea how to solve this... Maybe we can call EditEngine::UndoActionStart(USHORT nId) (see [2]) and EditEngine::UndoActionEnd(USHORT nId), before and after the called to EditEngine::SetText(formula)...</div>


<div>But in that case I don&#39;t know if we can pass any value as nId, the existing ones are defined in [3] (line 64).</div><div>The only place I can see EDITUNDO_INSERT used is to call UndoActionStart/End and in one switch case where labels are generated...</div>


<div><br></div><div>But again, there&#39;s no documentation, what so ever! So unless we can find the guy who wrote it, maybe we should just try something and hope it doesn&#39;t introduce a bug somewhere we don&#39;t notice...</div>

<div><br></div><div>[1] <a href="http://docs.libreoffice.org/editeng/html/editeng_8cxx-source.html#l01621" target="_blank">http://docs.libreoffice.org/editeng/html/editeng_8cxx-source.html#l01621</a></div>
<div>[2] <a href="http://docs.libreoffice.org/editeng/html/classEditEngine.html#c7a0ff1067cb9e6054be7cfaaa91872c" target="_blank">http://docs.libreoffice.org/editeng/html/classEditEngine.html#c7a0ff1067cb9e6054be7cfaaa91872c</a></div>


<div>[3] <a href="http://docs.libreoffice.org/editeng/html/editdata_8hxx-source.html#l00064" target="_blank">http://docs.libreoffice.org/editeng/html/editdata_8hxx-source.html#l00064</a></div><div><br></div><div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">


It would be great to have Jonas&#39; great work on by default, and with<br>undo/redo, perhaps it is now possible?</blockquote></div><div>Undo/redo would be a great step in the right direction, if we don&#39;t have it users will probably consider it a regression...</div>


<div>I recently pushed line deletion using backspace... Now I just need to implement it using delete...</div><div>But apart from that the visual editor does still discards bold, font, color and alignment information, it wouldn&#39;t be hard to retain it... But it would be hard to edit it intuitively using visual editor, which is why it just discards this now...</div>


<div>But I would imagine that some people would get rather mad, if we enable a feature that removes formatting from their formulas...</div><div><br></div><div>We can probably enable the visual editor as an non-default editing mode (i.e. activated from toolbar) once the formatting issue is addressed... Then when we&#39;ve integrated it properly, so that users of the command editor doesn&#39;t feel any uncomfort, we can make it default...</div>


<div>But as long as it discards formatting information (font, bold, color, alignment, etc) we probably shouldn&#39;t enable it by default... Users hate regressions, especially if it eats all their formatting information without asking nicely first :)</div>

<div><br></div>--<br>Regards Jonas Finnemann Jensen.<br>
<br><br><div class="gmail_quote">On Sun, Feb 13, 2011 at 18:12, Luke Dixon <span dir="ltr">&lt;<a href="mailto:6b8b4567@gmail.com" target="_blank">6b8b4567@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi Michael, Jonas,<br>
<br>
On Fri, 2011-02-11 at 10:15 +0000, Michael Meeks wrote:<br>
&gt;       Quick question, while I&#39;m here: what are the blockers for enabling this<br>
&gt; by default on master ? was it undo/redo ? or do we have any malingering<br>
&gt; known crashers / mis-features left.<br>
<br>
I think Jonas fixed the crash I noticed.<br>
There are 2 more bugs at <a href="http://bugzilla.freedesktop.org" target="_blank">bugzilla.freedesktop.org</a>, I don&#39;t think they<br>
would be too difficult to fix.<br>
<br>
It seems that undo/redo is the major one and I just worked out why<br>
undo/redo wasn&#39;t working, noticed it while looking at Caolán&#39;s unit<br>
tests for starmath. I&#39;ve attached the patch.<br>
<br>
I made it also update the formula when undoing or redoing stuff. I<br>
didn&#39;t enable updating only as an experimental feature, as I don&#39;t quite<br>
get why it doesn&#39;t update already. It looked a little bad when undoing<br>
from the visual formula editor. I hope it will be okay :)<br>
<br>
I noticed that when undoing the cursor position goes to the front of the<br>
formula, not sure that is too easy to fix, but I figure having undo is<br>
better than not. Perhaps I could update the Easy Hack to be for this<br>
instead.<br>
<br>
It would be great to have Jonas&#39; great work on by default, and with<br>
undo/redo, perhaps it is now possible?<br>
<br>
Regards,<br>
<font color="#888888">Luke<br>
</font><br>_______________________________________________<br>
LibreOffice mailing list<br>
<a href="mailto:LibreOffice@lists.freedesktop.org" target="_blank">LibreOffice@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/libreoffice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a><br>
<br></blockquote></div><br>