From 62e738505561ae9d9cc1572b9ccba91f62abfdca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Fri, 21 Nov 2003 16:35:46 +0000 Subject: [PATCH] small stuff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8117 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/insetspace.C | 5 ----- src/insets/insetspace.h | 2 -- src/insets/insetspecialchar.C | 6 ------ src/insets/insetspecialchar.h | 3 --- src/insets/insettext.C | 3 ++- src/rowpainter.C | 20 +++++++------------- 6 files changed, 9 insertions(+), 30 deletions(-) diff --git a/src/insets/insetspace.C b/src/insets/insetspace.C index 60e62a8ad8..bca1456318 100644 --- a/src/insets/insetspace.C +++ b/src/insets/insetspace.C @@ -275,8 +275,3 @@ bool InsetSpace::isSpace() const { return true; } - -bool InsetSpace::isLineSeparator() const -{ - return false; -} diff --git a/src/insets/insetspace.h b/src/insets/insetspace.h index 6e5aa846eb..eb87db4acb 100644 --- a/src/insets/insetspace.h +++ b/src/insets/insetspace.h @@ -86,8 +86,6 @@ public: /// is this equivalent to a space (which is BTW different from // a line separator)? bool isSpace() const; - // should we break lines after this inset? - bool isLineSeparator() const; private: /// And which kind is this? Kind kind_; diff --git a/src/insets/insetspecialchar.C b/src/insets/insetspecialchar.C index 331afb76fc..fb3f7547a5 100644 --- a/src/insets/insetspecialchar.C +++ b/src/insets/insetspecialchar.C @@ -269,12 +269,6 @@ bool InsetSpecialChar::isLetter() const } -bool InsetSpecialChar::isSpace() const -{ - return false; -} - - bool InsetSpecialChar::isLineSeparator() const { #if 0 diff --git a/src/insets/insetspecialchar.h b/src/insets/insetspecialchar.h index a0187b3c96..2dadf74798 100644 --- a/src/insets/insetspecialchar.h +++ b/src/insets/insetspecialchar.h @@ -77,9 +77,6 @@ public: bool isChar() const; /// is this equivalent to a letter? bool isLetter() const; - /// is this equivalent to a space (which is BTW different from - // a line separator)? - bool isSpace() const; // should we break lines after this inset? bool isLineSeparator() const; private: diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 728a10e35b..67008a62ec 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -257,9 +257,10 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const x += scroll(); x += TEXT_TO_INSET_OFFSET; + y -= text_.firstRow()->ascent_of_text(); text_.xo_ = x; - text_.yo_ = y - text_.firstRow()->ascent_of_text() + bv->top_y(); + text_.yo_ = y + bv->top_y(); paintTextInset(*bv, text_, x, y); diff --git a/src/rowpainter.C b/src/rowpainter.C index 0be4405485..ade0925a54 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -449,20 +449,16 @@ void RowPainter::paintSelection() tmpx -= singleWidth(body_pos - 1); } + tmpx += singleWidth(pos); + if (hfillExpansion(*pit_, row_, pos)) { - tmpx += singleWidth(pos); if (pos >= body_pos) tmpx += hfill_; else tmpx += label_hfill_; - } - - else if (pit_->isSeparator(pos)) { - tmpx += singleWidth(pos); - if (pos >= body_pos) - tmpx += separator_; } else { - tmpx += singleWidth(pos); + if (pit_->isSeparator(pos) && pos >= body_pos) + tmpx += separator_; } if ((startrow != rit_ || text_.selection.start.pos() <= pos) && @@ -976,7 +972,6 @@ int paintRows(BufferView const & bv, LyXText const & text, int xo, int yo, int y) { //lyxerr << " paintRows: rit: " << &*rit << endl; - int const yy = yo; int const y2 = bv.painter().paperHeight(); ParagraphList::iterator end = text.ownerParagraphs().end(); @@ -997,7 +992,7 @@ int paintRows(BufferView const & bv, LyXText const & text, //lyxerr << " paintRows: row: " << &*row << " ignored" << endl; } } - if (yy + y >= y2) + if (yo + y >= y2) return y; } @@ -1017,11 +1012,10 @@ int paintText(BufferView & bv) } -void paintTextInset(BufferView & bv, LyXText & text, int xo, int baseline) +void paintTextInset(BufferView & bv, LyXText & text, int xo, int yo) { - RowList::iterator rit = text.firstRow(); ParagraphList::iterator pit = text.ownerParagraphs().begin(); - paintRows(bv, text, pit, rit, xo, baseline - rit->ascent_of_text(), 0); + paintRows(bv, text, pit, pit->rows.begin(), xo, yo, 0); }