]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.C
last Friday's text*.C -> text_func shuffle
[lyx.git] / src / rowpainter.C
index 39745f1ecff23eba18c2fcff96af72500e6a9b72..b43895acc15818ebd78305c8cb34ff5633711f12 100644 (file)
@@ -11,8 +11,6 @@
 
 #include <config.h>
 
-#include <algorithm>
-
 #include "frontends/Painter.h"
 #include "frontends/screen.h"
 #include "frontends/font_metrics.h"
 #include "lyxrow_funcs.h"
 #include "metricsinfo.h"
 
+#include <algorithm>
+
+using namespace lyx::support;
+
 using std::max;
 using lyx::pos_type;
 
@@ -102,7 +104,7 @@ void RowPainter::paintInset(pos_type const pos)
 {
        Inset * inset = const_cast<Inset*>(pit_->getInset(pos));
 
-       lyx::Assert(inset);
+       Assert(inset);
 
 #warning inset->update FIXME
        inset->update(perv(bv_), false);
@@ -314,8 +316,8 @@ void RowPainter::paintSelection()
        int const endx = text_.selection.end.x();
        int const starty = text_.selection.start.y();
        int const endy = text_.selection.end.y();
-       RowList::iterator startrow = text_.selection.start.row();
-       RowList::iterator endrow = text_.selection.end.row();
+       RowList::iterator startrow = text_.getRow(text_.selection.start);
+       RowList::iterator endrow = text_.getRow(text_.selection.end);
 
        if (text_.bidi_same_direction) {
                int x;
@@ -452,8 +454,10 @@ void RowPainter::paintDepthBar()
        if (row_ != text_.rows().begin())
                prev_depth = boost::prior(row_)->par()->getDepth();
        Paragraph::depth_type next_depth = 0;
-       if (boost::next(row_) != text_.rows().end())
-               next_depth = boost::next(row_)->par()->getDepth();
+
+       RowList::iterator next_row = boost::next(row_);
+       if (next_row != text_.rows().end())
+               next_depth = next_row->par()->getDepth();
 
        for (Paragraph::depth_type i = 1; i <= depth; ++i) {
                int x = (PAPER_MARGIN / 5) * i + xo_;