<div>Hi Luke,</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><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; ">
Would be cool, would be a bit difficult to document it when I don't know<br>what it's supposed to be doing though. That isn't an excuse though, I<br>don't mind trying to work out a few of them.</blockquote>
</div><div>Well, lets just think about writing a note for the next guy, if we find a solution :)</div><blockquote></blockquote><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; ">
pDocShell->GetEditEngine().QuickInsertText(formula, ESelection( 0, 0, 0xFFFF, 0xFFFF ));<br> pDocShell->GetEditEngine().QuickFormatDoc(); </blockquote><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; ">
</blockquote><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; ">
I don't know why it is called quick, perhaps because it doesn't update<br>the text in the window. I saw QuickFormat called after it sometimes,<br>which updates the text in the window.<br>ESelection is how it is in SmEditWindow::SelectAll(). Perhaps there is<br>
something better to use than 0xFFFF (maybe EE_PARA_ALL is the right<br>one?).</blockquote><div>I noticed that 0xFFFF is used in SelectAll... but searching for EE_PARA_ALL, gives some results where it's used for creating selections, so that's probably what it's a constant for...</div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div> </div><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; ">
Perhaps it's a little better, any thoughts?</blockquote></div><div>I think we finally have a solution... I just tried it out, looks to me as if it's working, without any nasty side effects...</div><div>I noticed that QuickInsertText and QuickFormatDoc was used in some accessibility code, so it's probably okay to use them..</div>
<div><br></div><div>Unless, you've other ideas, I suggest don't you update your patch, then I'll push it... And please update the todo-list, you've just fixed one of the complicated issues... :)</div><div>
<br clear="all">--<br>Regards Jonas Finnemann Jensen.<br>
<br><br><div class="gmail_quote">On Tue, Feb 15, 2011 at 02:03, Luke Dixon <span dir="ltr"><<a href="mailto:6b8b4567@gmail.com">6b8b4567@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Jonas,<br>
<div class="im"><br>
On Mon, 2011-02-14 at 20:17 +0100, Jonas Finnemann Jensen wrote:<br>
<br>
><br>
> I think it ought to be that easy... More documentation would speedup<br>
> development and reduce bugs dramatically...<br>
> (Maybe we should write a few doxygen comments for EditEngine, if we<br>
> figure out how it works).<br>
><br>
<br>
</div>I noticed a few comments in ImpEditEngine that I found informative (with<br>
the aid of google translate), which I think would be a lot better in<br>
doxygen comments on the actual functions instead of buried in the<br>
implementation ones (assuming I've guessed right that Imp means<br>
implementation, which seems right to me by how that class is used).<br>
<br>
Would be cool, would be a bit difficult to document it when I don't know<br>
what it's supposed to be doing though. That isn't an excuse though, I<br>
don't mind trying to work out a few of them.<br>
<div class="im"><br>
><br>
> I had a very bad solution that seemed to work but made the<br>
> unit tests<br>
> not work.<br>
> I replaced SetText with:<br>
> SmGetActiveView()->GetEditWindow()->SelectAll();<br>
> SmGetActiveView()->GetEditWindow()->InsertText(formula);<br>
> Why is this a bad solution ?<br>
> Any idea, why this doesn't work with the unit tests ?<br>
> It seems like it might be a fairly good solution... Unless undo/redo<br>
> manages selections too... So that this becomes two steps ?<br>
><br>
<br>
</div>I thought it was bad because I'm not sure what unintended consequences<br>
calling SmEditWindow::SelectAll() would have. I might be worried for<br>
nothing though.<br>
<br>
It doesn't seem to make it 2 steps.<br>
<br>
I don't know why it doesn't pass the tests, I didn't look (I would guess<br>
something doesn't get initialized right or at all).<br>
I've got this instead of the 2 SmGetActiveView... lines which seems to<br>
work without breaking the tests:<br>
<br>
pDocShell->GetEditEngine().QuickInsertText(formula, ESelection( 0,<br>
0, 0xFFFF, 0xFFFF ));<br>
pDocShell->GetEditEngine().QuickFormatDoc();<br>
<br>
I don't know why it is called quick, perhaps because it doesn't update<br>
the text in the window. I saw QuickFormat called after it sometimes,<br>
which updates the text in the window.<br>
ESelection is how it is in SmEditWindow::SelectAll(). Perhaps there is<br>
something better to use than 0xFFFF (maybe EE_PARA_ALL is the right<br>
one?).<br>
<br>
Perhaps it's a little better, any thoughts?<br>
<div class="im"><br>
> Don't be, it also happens to me... That's why the visual formula<br>
> editor had bugs to begin with, and it's no unlikely that we'll find<br>
> more :)<br>
> Besides if we don't propose patches, or partially working fixes... and<br>
> discuss these we'll never get undo integration to work properly.<br>
<br>
</div>Thanks for the encouragement, it makes me feel a lot better about<br>
this. :)<br>
<br>
Regards,<br>
<font color="#888888">Luke<br>
<br>
<br>
</font></blockquote></div><br></div></div>