]> git.lyx.org Git - features.git/commitdiff
Ensure that graphics BoundingBox member variables are initialised.
authorAngus Leeming <leeming@lyx.org>
Thu, 4 Apr 2002 10:24:33 +0000 (10:24 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 4 Apr 2002 10:24:33 +0000 (10:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3899 a592a061-630c-0410-9148-cb99ea01b6c8

src/graphics/ChangeLog
src/graphics/GraphicsParams.C

index 76673be04aafd2f947492c358a7e2f37a0e314de..da3dc91d622f104be303acc94a1a116bd01abf1f 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-04  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * GraphicsParams.C (c-tor): ensure that the member variables are
+       initialised.
+
 2002-03-26  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * GraphicsCacheItem.C (convertToDisplayFormat): don't launch that Alert
index b0cf8e1312aef3ac214617c7b558d2fbaeb91b1c..f63b28b0b05c1c1398fe51a20ba5ee5874828146 100644 (file)
@@ -109,6 +109,7 @@ BoundingBox::BoundingBox()
 
 
 BoundingBox::BoundingBox(string const & bb)
+       : xl(0), yb(0), xr(0), yt(0)
 {
        if (bb.empty())
                return;
@@ -139,18 +140,22 @@ BoundingBox::BoundingBox(string const & bb)
        // want the bounding box in Postscript pixels.
        // Note further that there are 72 Postscript pixels per inch.
        double const scaling_factor = 7200.0 / (lyxrc.dpi * lyxrc.zoom);
-       xl = uint(scaling_factor * length_xl.inPixels(1, 1));
-       yb = uint(scaling_factor * length_yb.inPixels(1, 1));
-       xr = uint(scaling_factor * length_xr.inPixels(1, 1));
-       yt = uint(scaling_factor * length_yt.inPixels(1, 1));
-
-       if (xr <= xl || yt <= yb) {
-               xl = 0;
-               yb = 0;
-               xr = 0;
-               yt = 0;
+       unsigned int const xl_tmp =
+               uint(scaling_factor * length_xl.inPixels(1, 1));
+       unsigned int const yb_tmp =
+               uint(scaling_factor * length_yb.inPixels(1, 1));
+       unsigned int const xr_tmp =
+               uint(scaling_factor * length_xr.inPixels(1, 1));
+       unsigned int const yt_tmp =
+               uint(scaling_factor * length_yt.inPixels(1, 1));
+
+       if (xr <= xl || yt <= yb)
                return;
-       }
+
+       xl = xl_tmp;
+       yb = yb_tmp;
+       xr = xr_tmp;
+       yt = yt_tmp;
 }