From 4a964acbe7472194a9300c7715d05082fe268ac9 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 4 Apr 2002 10:24:33 +0000 Subject: [PATCH] Ensure that graphics BoundingBox member variables are initialised. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3899 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/graphics/ChangeLog | 5 +++++ src/graphics/GraphicsParams.C | 27 ++++++++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 76673be04a..da3dc91d62 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,8 @@ +2002-04-04 Angus Leeming + + * GraphicsParams.C (c-tor): ensure that the member variables are + initialised. + 2002-03-26 Angus Leeming * GraphicsCacheItem.C (convertToDisplayFormat): don't launch that Alert diff --git a/src/graphics/GraphicsParams.C b/src/graphics/GraphicsParams.C index b0cf8e1312..f63b28b0b0 100644 --- a/src/graphics/GraphicsParams.C +++ b/src/graphics/GraphicsParams.C @@ -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; } -- 2.39.2