From 1111df8541e25f7c3e999fe67ab27297b7fc216b Mon Sep 17 00:00:00 2001 From: Baruch Even Date: Mon, 16 Jul 2001 14:42:40 +0000 Subject: [PATCH] Removed some unneeded casts git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2249 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 4 ++++ src/insets/insetgraphics.C | 21 ++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index c969c570d4..7b574e2850 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2001-07-17 Baruch Even + + * insetgraphics.C (draw): Removed unneeded casts. + 2001-07-16 Juergen Vigna * insettext.C (update): fixed small oversight (reset lt to 0). diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 26a03fde9f..d5e90bd6d2 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -261,16 +261,16 @@ void InsetGraphics::draw(BufferView * bv, LyXFont const & font, int lwidth = width(bv, font); // Make sure x is updated upon exit from this routine - float old_x = x; + int old_x = x; x += lwidth; // This will draw the graphics. If the graphics has not been loaded yet, // we draw just a rectangle. if (imageLoaded) { - paint.image(int(old_x) + 2, baseline - lascent, - lwidth - 4, lascent + ldescent, - cacheHandle->getImage()); + paint.image(old_x + 2, baseline - lascent, + lwidth - 4, lascent + ldescent, + cacheHandle->getImage()); } else { // Get the image status, default to unknown error. @@ -287,25 +287,24 @@ void InsetGraphics::draw(BufferView * bv, LyXFont const & font, return; } - string const msg = statusMessage(); - paint.rectangle(int(old_x) + 2, baseline - lascent, + paint.rectangle(old_x + 2, baseline - lascent, lwidth - 4, lascent + ldescent); + string const msg = statusMessage(); if (!msg.empty()) { // Print the message. LyXFont msgFont(font); msgFont.setFamily(LyXFont::SANS_FAMILY); msgFont.setSize(LyXFont::SIZE_FOOTNOTE); string const justname = OnlyFilename (params.filename); - paint.text(int(old_x) + 8, - baseline - lyxfont::maxAscent(msgFont) - 4, - justname, msgFont); + paint.text(old_x + 8, + baseline - lyxfont::maxAscent(msgFont) - 4, + justname, msgFont); msgFont.setSize(LyXFont::SIZE_TINY); - paint.text(int(old_x) + 8, baseline - 4, - msg, msgFont); + paint.text(old_x + 8, baseline - 4, msg, msgFont); } } }