From 0b7886a1a8e5464d30bb2d86ffcf7a19269f4e05 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 7 Sep 2010 13:37:22 +0000 Subject: [PATCH] Gcc compile fix. abs is defined for float not int. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35316 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetLine.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/insets/InsetLine.cpp b/src/insets/InsetLine.cpp index be05fe1423..60fb29995e 100644 --- a/src/insets/InsetLine.cpp +++ b/src/insets/InsetLine.cpp @@ -106,9 +106,9 @@ void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const frontend::FontMetrics const & fm = theFontMetrics(mi.base.font); dim.asc = fm.maxAscent(); dim.des = fm.maxDescent(); - + Length width = Length(to_ascii(getParam("width"))); - int w = + int w = width.inPixels(mi.base.textwidth, fm.width(char_type('M'))); @@ -119,7 +119,7 @@ void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const // set a minimal width int const minw = (w < 0) ? 3 * 8 : 4; - dim.wid = max(minw, abs(w)); + dim.wid = max(minw, max(w, -w)); // Cache the inset dimension setDimCache(mi, dim); @@ -134,15 +134,15 @@ void InsetLine::draw(PainterInfo & pi, int x, int y) const // get the length of the parameters in pixels Length offset = Length(to_ascii(getParam("offset"))); - int o = + int o = offset.inPixels(pi.base.textwidth, fm.width(char_type('M'))); Length width = Length(to_ascii(getParam("width"))); - int w = + int w = width.inPixels(pi.base.textwidth, fm.width(char_type('M'))); Length height = Length(to_ascii(getParam("height"))); - int h = + int h = height.inPixels(pi.base.textwidth, fm.width(char_type('M'))); -- 2.39.2