From 24ff65acc43538f49dfec2041e3e10b75c2e29e3 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 14 Sep 2010 13:42:09 +0000 Subject: [PATCH] coding style and C++ fixes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35370 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetLine.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/insets/InsetLine.cpp b/src/insets/InsetLine.cpp index 60fb29995e..aadb7f78ae 100644 --- a/src/insets/InsetLine.cpp +++ b/src/insets/InsetLine.cpp @@ -107,10 +107,9 @@ void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const dim.asc = fm.maxAscent(); dim.des = fm.maxDescent(); - Length width = Length(to_ascii(getParam("width"))); - int w = - width.inPixels(mi.base.textwidth, - fm.width(char_type('M'))); + Length const width(to_ascii(getParam("width"))); + int w = width.inPixels(mi.base.textwidth, + fm.width(char_type('M'))); // assure that the line inset is not outside of the window // check that it doesn't exceed the outer boundary @@ -118,7 +117,7 @@ void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const w = mi.base.textwidth; // set a minimal width - int const minw = (w < 0) ? 3 * 8 : 4; + int const minw = (w < 0) ? 24 : 4; dim.wid = max(minw, max(w, -w)); // Cache the inset dimension @@ -134,16 +133,13 @@ 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 = - offset.inPixels(pi.base.textwidth, - fm.width(char_type('M'))); - Length width = Length(to_ascii(getParam("width"))); - int w = - width.inPixels(pi.base.textwidth, + int o = offset.inPixels(pi.base.textwidth, + fm.width(char_type('M'))); + Length const width(to_ascii(getParam("width"))); + int w = width.inPixels(pi.base.textwidth, fm.width(char_type('M'))); Length height = Length(to_ascii(getParam("height"))); - int h = - height.inPixels(pi.base.textwidth, + int h = height.inPixels(pi.base.textwidth, fm.width(char_type('M'))); // get the surrounding text color