]> git.lyx.org Git - features.git/commitdiff
- y - (-y) is pretty close to 0
authorAndré Pönitz <poenitz@gmx.net>
Tue, 29 Jul 2003 10:00:51 +0000 (10:00 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 29 Jul 2003 10:00:51 +0000 (10:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7440 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/screen.C
src/paragraph.C
src/text.C

index 6a4721c9a085b362d3470fed07d32378679ebec1..48060a82dad6b5d33eeb59d8ff43176fe4d058c7 100644 (file)
@@ -321,30 +321,28 @@ void LyXScreen::toggleSelection(LyXText * text, BufferView * bv,
                                int yo, int xo)
 {
        // only if there is a selection
-       if (!text->selection.set()) return;
+       if (!text->selection.set())
+               return;
 
        int const bottom = min(
-               max(static_cast<int>(text->selection.end.y()
+               max(int(text->selection.end.y()
                                     - text->getRow(text->selection.end)->baseline()
                                     + text->getRow(text->selection.end)->height()),
                    text->top_y()),
-               static_cast<int>(text->top_y() + workarea().workHeight()));
+               int(text->top_y() + workarea().workHeight()));
        int const top = min(
-               max(static_cast<int>(text->selection.start.y() -
+               max(int(text->selection.start.y() -
                                     text->getRow(text->selection.start)->baseline()),
                    text->top_y()),
-               static_cast<int>(text->top_y() + workarea().workHeight()));
+               int(text->top_y() + workarea().workHeight()));
 
        if (kill_selection)
                text->selection.set(false);
 
        workarea().getPainter().start();
 
-       drawFromTo(text, bv, top - text->top_y(), bottom - text->top_y(),
-                  yo, xo);
-       expose(0, top - text->top_y(),
-              workarea().workWidth(),
-              bottom - text->top_y() - (top - text->top_y()));
+       drawFromTo(text, bv, top - text->top_y(), bottom - text->top_y(), yo, xo);
+       expose(0, top - text->top_y(), workarea().workWidth(), bottom - top);
 
        workarea().getPainter().end();
 }
index 5579d6deeea234e75227382628a16d643d69cfa7..18a65dae301803561a49ae29158394c372da0f4d 100644 (file)
@@ -404,8 +404,7 @@ LyXFont const Paragraph::getFontSettings(BufferParams const & bparams,
 }
 
 
-lyx::pos_type
-Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
+lyx::pos_type Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
 {
        Assert(pos <= size());
 
index 23dd04082439701ec366f51bfcc2a46364434605..46fc845e683b0a230387137dc6472f933796ff8d 100644 (file)
@@ -860,7 +860,7 @@ pos_type LyXText::rowBreakPoint(Row const & row) const
                chunkwidth += thiswidth;
 
                InsetOld * in = pit->isInset(i) ? pit->getInset(i) : 0;
-               fullrow = (in && (in->display() || in->needFullRow()));
+               fullrow = in && (in->display() || in->needFullRow());
 
                // break before a character that will fall off
                // the right of the row
@@ -971,7 +971,7 @@ int LyXText::fill(RowList::iterator row, int paper_width) const
                                                font = getFont(pit, i);
                                                endPosOfFontSpan = pit->getEndPosOfFontSpan(i);
                                        }
-                                       if (! font.language()->RightToLeft()) {
+                                       if (!font.language()->RightToLeft()) {
                                                w += font_metrics::width(c, font);
                                        } else {
                                                // Fall-back to the normal case