]> git.lyx.org Git - features.git/commitdiff
Changed functioncall to MathedCursor::SelGetArea as we always returned the
authorJürgen Vigna <jug@sad.it>
Thu, 17 Feb 2000 15:24:43 +0000 (15:24 +0000)
committerJürgen Vigna <jug@sad.it>
Thu, 17 Feb 2000 15:24:43 +0000 (15:24 +0000)
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
po/POTFILES.in
src/mathed/formula.C
src/mathed/math_cursor.C
src/mathed/math_cursor.h

index e4f4f80a7df049f54fdd2b506a7808ea095fe20f..779b85f7b8385cc40a66d4f529549f540544ea1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-02-17  Juergen Vigna  <jug@sad.it>
+
+       * 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  <Jean-Marc.Lasgouttes@inria.fr>
 
        * src/LaTeX.C (operator()): quote file name when running latex.
index 7f6a48b17b17199b317390536da7731df82bc297..cb815fa30ba8e908735aa1ddf980b060cd314061 100644 (file)
@@ -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
index 7ea0de4ddfdec6e8295f5dd6aa358e9b5e5dccd7..66641c6258e2bd76077f1dd3c1d551df81754d87 100644 (file)
@@ -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);
index e2f5efbc2e56148c2ca89a9c8f9d06357344ea4d..5e7ed1abf3a8f721edee9e24430e7d7ea5b579df 100644 (file)
@@ -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 << "] ";
index c8c16e9094a8979ccadec7c870a8216d45026045..b2fcecc63d6b1f929176983021e24a94a70f833a 100644 (file)
@@ -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 &);