From 832136c37c51f2a2f0dc42f3aeacbf065a82d1be Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Wed, 13 Jun 2007 17:18:37 +0000 Subject: [PATCH] * Change the dim parameter correctly, even if dim_ has not changed (fixes http://bugzilla.lyx.org/show_bug.cgi?id=3858) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18765 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathKern.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/mathed/InsetMathKern.cpp b/src/mathed/InsetMathKern.cpp index 2b2b1efc53..ab80287be5 100644 --- a/src/mathed/InsetMathKern.cpp +++ b/src/mathed/InsetMathKern.cpp @@ -25,24 +25,18 @@ using std::auto_ptr; InsetMathKern::InsetMathKern() { - dim_.asc = 0; - dim_.des = 0; } InsetMathKern::InsetMathKern(Length const & w) : wid_(w) { - dim_.asc = 0; - dim_.des = 0; } InsetMathKern::InsetMathKern(docstring const & s) : wid_(to_utf8(s)) { - dim_.asc = 0; - dim_.des = 0; } @@ -54,11 +48,12 @@ auto_ptr InsetMathKern::doClone() const bool InsetMathKern::metrics(MetricsInfo & mi, Dimension & dim) const { - int wid_pixel = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M')); - if (wid_pixel == dim_.wid) + dim.asc = 0; + dim.des = 0; + dim.wid = wid_.inPixels(0, mathed_char_width(mi.base.font, 'M')); + if (dim == dim_) return false; - dim_.wid = wid_pixel; - dim = dim_; + dim_ = dim; return true; } -- 2.39.2