Alfredo Braunstein <[EMAIL PROTECTED]> writes: Some lame comments from me.
Seems that you should just update from head, and merge this baby. | Index: src/Makefile.am | =================================================================== | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Makefile.am,v | retrieving revision 1.218 | diff -u -p -r1.218 Makefile.am | --- src/Makefile.am 26 Oct 2004 18:39:09 -0000 1.218 | +++ src/Makefile.am 25 Nov 2004 05:56:01 -0000 | @@ -4,7 +4,7 @@ DISTCLEANFILES += config.h libintl.h ver | | MAINTAINERCLEANFILES += $(srcdir)/config.h.in | | -SUBDIRS = mathed insets graphics support frontends . client tex2lyx | +SUBDIRS = mathed insets graphics support frontends . tex2lyx Why this change? | Index: src/cursor.C | =================================================================== | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v | retrieving revision 1.113 | diff -u -p -r1.113 cursor.C | --- src/cursor.C 24 Nov 2004 21:53:37 -0000 1.113 | +++ src/cursor.C 25 Nov 2004 05:56:02 -0000 | @@ -15,6 +15,7 @@ | #include "BufferView.h" | #include "buffer.h" | #include "cursor.h" | +#include "coordcache.h" | #include "CutAndPaste.h" | #include "debug.h" | #include "dispatchresult.h" | @@ -42,6 +43,7 @@ | #include "support/limited_stack.h" | | #include "frontends/LyXView.h" | +#include "frontends/font_metrics.h" | | #include <boost/assert.hpp> | #include <boost/bind.hpp> | @@ -80,6 +82,7 @@ namespace { | | | // Find position closest to (x, y) in cell given by iter. | + // Used only in mathed | DocIterator bruteFind2(LCursor const & c, int x, int y) | { | double best_dist = 1e10; 1e10 is not good... (but not your code)... double best_dist = std::numeric_limits<double>::max(); would be a lot better. | @@ -94,11 +97,12 @@ namespace { | int xo, yo; | LCursor cur = c; | cur.setCursor(it); | - cur.inset().getCursorPos(cur, xo, yo); | + cur.inset().getCursorPos(cur.top(), xo, yo); | double d = (x - xo) * (x - xo) + (y - yo) * (y - yo); | // '<=' in order to take the last possible position | // this is important for clicking behind \sum in e.g. '\sum_i a' | - lyxerr[Debug::DEBUG] << "i: " << i << " d: " << d << " best: " << best_dist << endl; | + lyxerr[Debug::DEBUG] << "i: " << i << " d: " << d | + << " best: " << best_dist << endl; | if (d <= best_dist) { | best_dist = d; best_dist = min(best_dist, d); | Index: src/frontends/Painter.C | =================================================================== | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/Painter.C,v | retrieving revision 1.16 | diff -u -p -r1.16 Painter.C | --- src/frontends/Painter.C 7 Apr 2004 20:20:13 -0000 1.16 | +++ src/frontends/Painter.C 25 Nov 2004 05:56:08 -0000 | Index: src/frontends/screen.C | =================================================================== | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/screen.C,v | retrieving revision 1.96 | diff -u -p -r1.96 screen.C | --- src/frontends/screen.C 18 Jun 2004 13:31:54 -0000 1.96 | +++ src/frontends/screen.C 25 Nov 2004 05:56:08 -0000 | InsetOld::EDITABLE InsetCollapsable::editable() const You have a few of these "InsetOld::" creeping in again. I got rid of quite a lot of those last week. | - setLabel(status() == Collapsed ? getNewLabel(_("P-ERT")) : _("P-ERT")); | + setLabel(status() == Collapsed ? getNewLabel(_("ERT")) : _("ERT")); :-) | InsetBase * InsetTabular::setPos(LCursor & cur, int x, int y) const | { | lyxerr << "# InsetTabular::setPos() x=" << x << " y=" << y << endl; | int idx_min = 0; | int dist_min = 1000000; int dist_min = std::numeric_limits<int>::max(); | for (idx_type i = 0; i < nargs(); ++i) { | - int d = getText(i)->dist(x, y); | - if (d < dist_min) { | - dist_min = d; | - idx_min = i; | + if (theCoords.insets_.has(tabular.getCellInset(i).get())) { | + int d = dist(*tabular.getCellInset(i), x, y); | + if (d < dist_min) { | + dist_min = d; dist_min = std::min(dist_min, d); | @@ -202,15 +199,21 @@ void InsetText::draw(PainterInfo & pi, i | | void InsetText::drawSelection(PainterInfo & pi, int x, int y) const | { | + // repaint the background if needed | + if (backgroundColor() != LColor::background) | + clearInset(pi.pain, x, y); | text_.drawSelection(pi, x, y); | } | | | void InsetText::drawFrame(Painter & pain, int x, int y) const | { | - int const w = text_.width(); | + int w = text_.width(); | + if (w < 1) | + w = 1; int const w = std::max(1, text_.width()); | Index: src/mathed/Makefile.am | =================================================================== | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/Makefile.am,v | retrieving revision 1.136 | diff -u -p -r1.136 Makefile.am | --- src/mathed/Makefile.am 11 Nov 2004 12:01:34 -0000 1.136 | +++ src/mathed/Makefile.am 25 Nov 2004 05:56:11 -0000 | @@ -9,6 +9,7 @@ INCLUDES = -I$(srcdir)/../ $(BOOST_INCLU | AM_CXXFLAGS = $(PCH_FLAGS) | | libmathed_la_SOURCES = \ | + $(PCH_FILE) \ Hmm... is this needed? | Index: src/mathed/math_mboxinset.h | =================================================================== | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_mboxinset.h,v | retrieving revision 1.9 | diff -u -p -r1.9 math_mboxinset.h | --- src/mathed/math_mboxinset.h 24 Nov 2004 21:58:41 -0000 1.9 | +++ src/mathed/math_mboxinset.h 25 Nov 2004 05:56:11 -0000 | @@ -27,6 +27,11 @@ public: | /// draw according to cached metrics | void draw(PainterInfo &, int x, int y) const; | /// | + void drawSelection(PainterInfo & pi, int x, int y) const; | + /// | + void priv_dispatch(LCursor & cur, FuncRequest & cmd); priv_dispatch does not exist anymore (renamed to doDispatch) -- Lgb