From a833cc234e60a296056ec5ddaa3c07764e5b4cc5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 12 Jul 2002 15:30:50 +0000 Subject: [PATCH] let inBP return negative values, too. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4624 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/lyxlength.C | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 220be184eb..470bacfeb4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ + +2002-07-15 André Pönitz + + * lyxlength.C: inBP should be able to return negative values + 2002-07-12 John Levon * lyxfunc.C: use lyx_gui::update_fonts() diff --git a/src/lyxlength.C b/src/lyxlength.C index 2a0b2fa0b5..c21bd86766 100644 --- a/src/lyxlength.C +++ b/src/lyxlength.C @@ -165,6 +165,10 @@ int LyXLength::inPixels(int default_width, int default_height) const // we don't care about sign of value, we // display negative space with text too +#ifdef WITH_WARNINGS +#warning if you don't care than either call this function differently or let it return negative values and call abs() explicitly when needed (Andre') +#endif + double result = 0.0; int val_sign = val_ < 0.0 ? -1 : 1; @@ -244,7 +248,6 @@ int LyXLength::inBP() const // return any LyXLength value as a one with // the PostScript point, called bp (big points) double result = 0.0; - int val_sign = val_ < 0.0 ? -1 : 1; switch (unit_) { case LyXLength::CM: // 1bp = 0.2835cm @@ -263,7 +266,7 @@ int LyXLength::inBP() const result = val_; break; } - return static_cast(result * val_sign + 0.5); + return static_cast(result + 0.5); } -- 2.39.2