From 17818a9141789db65be3ac26b26f866dac47aeb6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Thu, 17 Feb 2000 15:24:43 +0000 Subject: [PATCH] Changed functioncall to MathedCursor::SelGetArea as we always returned the NULL pointer with the new Painter-stuff. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@559 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 6 ++++++ po/POTFILES.in | 1 + src/mathed/formula.C | 2 +- src/mathed/math_cursor.C | 16 ++++++++++------ src/mathed/math_cursor.h | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index e4f4f80a7d..779b85f7b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-02-17 Juergen Vigna + + * src/mathed/math_cursor.[Ch] (SelGetArea): Changed form int * to + int ** as we have to return the pointer, otherwise we have only + NULL pointers in the returning function. + 2000-02-16 Jean-Marc Lasgouttes * src/LaTeX.C (operator()): quote file name when running latex. diff --git a/po/POTFILES.in b/po/POTFILES.in index 7f6a48b17b..cb815fa30b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -75,6 +75,7 @@ src/mathed/math_panel.C src/menus.C src/minibuffer.C src/minibuffer.h +src/newinsets/newinset.h src/Painter.C src/PaperLayout.C src/paragraph.C diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 7ea0de4ddf..66641c6258 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -496,7 +496,7 @@ void InsetFormula::draw(Painter & pain, LyXFont const &, int n; int * xp = 0; int * yp = 0; - mathcursor->SelGetArea(xp, yp, n); + mathcursor->SelGetArea(&xp, &yp, n); pain.fillPolygon(xp, yp, n, LColor::selection); } mathcursor->draw(pain, int(x), baseline); diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index e2f5efbc2e..5e7ed1abf3 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -961,15 +961,19 @@ void MathedCursor::SelBalance() #ifdef USE_PAINTER -void MathedCursor::SelGetArea(int * xp, int * yp, int & np) +void MathedCursor::SelGetArea(int ** xp, int ** yp, int & np) { + static int xpoint[10]; + static int ypoint[10]; + if (!selection) { np = 0; + xpoint[0] = 0; + ypoint[0] = 0; + *xp = &xpoint[0]; + *yp = &ypoint[0]; return; } - - static int xpoint[10]; - static int ypoint[10]; // single row selection int i = 0, x, y, a, d, xo, yo, x1, y1, a1, d1; @@ -1015,8 +1019,8 @@ void MathedCursor::SelGetArea(int * xp, int * yp, int & np) xpoint[i] = xpoint[0]; ypoint[i++] = ypoint[0]; - xp = &xpoint[0]; - yp = &ypoint[0]; + *xp = &xpoint[0]; + *yp = &ypoint[0]; np = i; // lyxerr << "AN[" << x << " " << y << " " << x1 << " " << y1 << "] "; // lyxerr << "MT[" << a << " " << d << " " << a1 << " " << d1 << "] "; diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index c8c16e9094..b2fcecc63d 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -124,7 +124,7 @@ class MathedCursor { /// void SelBalance(); #ifdef USE_PAINTER - void SelGetArea(int * xp, int * yp, int & n); + void SelGetArea(int ** xp, int ** yp, int & n); #else /// XPoint * SelGetArea(int &); -- 2.39.2