]> git.lyx.org Git - features.git/commitdiff
small stuff
authorAndré Pönitz <poenitz@gmx.net>
Fri, 21 Nov 2003 16:35:46 +0000 (16:35 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 21 Nov 2003 16:35:46 +0000 (16:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8117 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/insetspace.C
src/insets/insetspace.h
src/insets/insetspecialchar.C
src/insets/insetspecialchar.h
src/insets/insettext.C
src/rowpainter.C

index 60e62a8ad8a6a8fb47f7e67a632bbbe3318d8551..bca145631862e4af3d9099a40c85f1fb0797d62e 100644 (file)
@@ -275,8 +275,3 @@ bool InsetSpace::isSpace() const
 {
        return true;
 }
-
-bool InsetSpace::isLineSeparator() const
-{
-       return false;
-}
index 6e5aa846eb5445202949a83af584285fd95b4f02..eb87db4acb36172949632383a10c49139a8eb9f6 100644 (file)
@@ -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_;
index 331afb76fc0dfddb83b94479a6a7e71bcebfe11a..fb3f7547a595068a0962b69e8b6ff8f8de95a4a9 100644 (file)
@@ -269,12 +269,6 @@ bool InsetSpecialChar::isLetter() const
 }
 
 
-bool InsetSpecialChar::isSpace() const
-{
-       return false;
-}
-
-
 bool InsetSpecialChar::isLineSeparator() const
 {
 #if 0
index a0187b3c96e39b8c716bcc561e54a479eec05a19..2dadf74798c05c9b2967ec5ed328d85c0b053fde 100644 (file)
@@ -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:
index 728a10e35bfe6036a34f272f23d5fb1ae8fa1cfb..67008a62ec0e37824e3c19d023196b588229c2c3 100644 (file)
@@ -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);
 
index 0be4405485c499868b3bbfe5c0b20a194872e8e1..ade0925a54d10898580dffe04012c975bf675840 100644 (file)
@@ -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);
 }