Andre Poenitz wrote:
On Mon, Apr 16, 2007 at 04:32:59PM +0200, Abdelrazak Younes wrote:
Stefan Schimanski wrote:
OK, got it from bugzilla.
Sorry, forgot to attach it to the mail as well.
Good detective work! I feel stupid for not seeing that at the first
glance :-(
Do you have SVN access?
No, no write access.
OK, I'll commit the patch for you. Please consider asking for it.
Not yet. The patches I've seen so far deviate too much from LyX style to
go in as-is.
Too late, sorry, I've committed a slightly modified patch already. But I
don't think it deviates from LyX style:
Author: younes
Date: Mon Apr 16 16:42:53 2007
New Revision: 17826
URL: http://www.lyx.org/trac/changeset/17826
Log:
Fixed bug 3449 by Stefan Schimanski:
http://bugzilla.lyx.org/show_bug.cgi?id=3449
One problem was no metric calculation was done for insets on cursor
movement. Of course scrolling or entering character caused the missing
metric calls, hence the described behavior in the bug report. This is
fixed by re-implementing idxLast(), idxFirst() and notifyCursorLeaves().
Another problem was that 'a' and '1' were drawn at the same position
because of a mis-calculation of the x-position in InsetMathMacro::draw().
Modified:
lyx-devel/trunk/src/mathed/InsetMathMacro.C
lyx-devel/trunk/src/mathed/InsetMathMacro.h
Modified: lyx-devel/trunk/src/mathed/InsetMathMacro.C
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/mathed/InsetMathMacro.C?rev=17826
==============================================================================
--- lyx-devel/trunk/src/mathed/InsetMathMacro.C (original)
+++ lyx-devel/trunk/src/mathed/InsetMathMacro.C Mon Apr 16 16:42:53 2007
@@ -105,8 +105,8 @@
tmpl_.draw(pi, x + w + 12, h);
h += tmpl_.descent();
Dimension ldim;
- string t = "#1: ";
- mathed_string_dim(font, name(), ldim);
+ docstring t = from_ascii("#1: ");
+ mathed_string_dim(font, t, ldim);
for (idx_type i = 0; i < nargs(); ++i) {
MathArray const & c = cell(i);
h += max(c.ascent(), ldim.asc) + 5;
@@ -156,6 +156,27 @@
}
+bool MathMacro::idxFirst(LCursor & cur) const
+{
+ cur.updateFlags(Update::Force);
+ return InsetMathNest::idxFirst(cur);
+}
+
+
+bool MathMacro::idxLast(LCursor & cur) const
+{
+ cur.updateFlags(Update::Force);
+ return InsetMathNest::idxLast(cur);
+}
+
+
+bool MathMacro::notifyCursorLeaves(LCursor & cur)
+{
+ cur.updateFlags(Update::Force);
+ return InsetMathNest::notifyCursorLeaves(cur);
+}
+
+
void MathMacro::maple(MapleStream & os) const
{
updateExpansion();
Modified: lyx-devel/trunk/src/mathed/InsetMathMacro.h
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/mathed/InsetMathMacro.h?rev=17826
==============================================================================
--- lyx-devel/trunk/src/mathed/InsetMathMacro.h (original)
+++ lyx-devel/trunk/src/mathed/InsetMathMacro.h Mon Apr 16 16:42:53 2007
@@ -43,6 +43,12 @@
bool boundary, int & x, int & y) const;
///
InsetBase * editXY(LCursor & cur, int x, int y);
+ /// target pos when we enter the inset from the left by pressing "Right"
+ bool idxFirst(LCursor &) const;
+ /// target pos when we enter the inset from the right by pressing "Left"
+ bool idxLast(LCursor &) const;
+ ///
+ virtual bool notifyCursorLeaves(LCursor &);
///
docstring name() const;
///