]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.C
ws changes only
[lyx.git] / src / rowpainter.C
index f9b150e3a26680697e500d46e4d55f39f5f68299..ac1fadd6a0416ad30f1689104b6f3b6c391d9151 100644 (file)
 #include "rowpainter.h"
 
 #include "buffer.h"
+#include "bufferparams.h"
 #include "BufferView.h"
 #include "encoding.h"
 #include "gettext.h"
 #include "language.h"
+#include "LColor.h"
 #include "lyxrc.h"
 #include "lyxrow.h"
 #include "lyxrow_funcs.h"
 #include "metricsinfo.h"
+#include "paragraph.h"
 #include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
+#include "vspace.h"
 
 #include "frontends/font_metrics.h"
 #include "frontends/Painter.h"
 
 #include "insets/insettext.h"
 
-#include "support/LAssert.h"
 #include "support/textutils.h"
 
-using namespace lyx::support;
 
-using std::max;
 using lyx::pos_type;
+using std::max;
+using std::string;
 
 extern int PAPER_MARGIN;
 extern int CHANGEBAR_MARGIN;
@@ -176,7 +179,7 @@ void RowPainter::paintInset(pos_type const pos)
 {
        InsetOld * inset = const_cast<InsetOld*>(pit_->getInset(pos));
 
-       Assert(inset);
+       BOOST_ASSERT(inset);
 
        PainterInfo pi(perv(bv_));
        pi.base.font = getFont(pos);
@@ -335,7 +338,7 @@ void RowPainter::paintFromPos(pos_type & vpos)
 
        char const c = pit_->getChar(pos);
 
-       if (IsInsetChar(c)) {
+       if (c == Paragraph::META_INSET) {
                paintInset(pos);
                ++vpos;
                paintForeignMark(orig_x, orig_font);
@@ -596,12 +599,15 @@ int RowPainter::paintLengthMarker(string const & prefix, VSpace const & vsp, int
        int d = 0;
 
        LyXFont font;
-       font.setColor(LColor::added_space).decSize().decSize();
+       font.setColor(LColor::added_space);
+       font.decSize();
+       font.decSize();
        font_metrics::rectText(str, font, w, a, d);
 
        pain_.rectText(leftx + 2 * arrow_size + 5,
-                        start + ((end - start) / 2) + d,
-                        str, font);
+                      start + ((end - start) / 2) + d,
+                      str, font,
+                      LColor::none, LColor::none);
 
        // top arrow
        pain_.line(leftx, ty1, midx, ty2, LColor::added_space);
@@ -621,7 +627,8 @@ int RowPainter::paintLengthMarker(string const & prefix, VSpace const & vsp, int
 int RowPainter::paintPageBreak(string const & label, int y)
 {
        LyXFont pb_font;
-       pb_font.setColor(LColor::pagebreak).decSize();
+       pb_font.setColor(LColor::pagebreak);
+       pb_font.decSize();
 
        int w = 0;
        int a = 0;
@@ -631,12 +638,12 @@ int RowPainter::paintPageBreak(string const & label, int y)
        int const text_start = int(xo_ + (width_ - w) / 2);
        int const text_end = text_start + w;
 
-       pain_.rectText(text_start, y + d, label, pb_font);
+       pain_.rectText(text_start, y + d, label, pb_font, LColor::none, LColor::none);
 
        pain_.line(int(xo_), y, text_start, y,
-               LColor::pagebreak, Painter::line_onoffdash);
+                  LColor::pagebreak, Painter::line_onoffdash);
        pain_.line(text_end, y, int(xo_ + width_), y,
-               LColor::pagebreak, Painter::line_onoffdash);
+                  LColor::pagebreak, Painter::line_onoffdash);
 
        return 3 * defaultRowHeight();
 }
@@ -645,7 +652,8 @@ int RowPainter::paintPageBreak(string const & label, int y)
 int RowPainter::paintAppendixStart(int y)
 {
        LyXFont pb_font;
-       pb_font.setColor(LColor::appendix).decSize();
+       pb_font.setColor(LColor::appendix);
+       pb_font.decSize();
 
        string const label = _("Appendix");
        int w = 0;
@@ -656,7 +664,7 @@ int RowPainter::paintAppendixStart(int y)
        int const text_start = int(xo_ + (width_ - w) / 2);
        int const text_end = text_start + w;
 
-       pain_.rectText(text_start, y + d, label, pb_font);
+       pain_.rectText(text_start, y + d, label, pb_font, LColor::none, LColor::none);
 
        pain_.line(int(xo_ + 1), y, text_start, y, LColor::appendix);
        pain_.line(text_end, y, int(xo_ + width_ - 2), y, LColor::appendix);
@@ -742,13 +750,13 @@ void RowPainter::paintFirst()
                        // this is special code for the chapter layout. This is
                        // printed in an extra row and has a pagebreak at
                        // the top.
-                       if (layout->labeltype == LABEL_COUNTER_CHAPTER) {
+                       if (layout->counter == "chapter") {
                                if (buffer.params().secnumdepth >= 0) {
                                        float spacing_val = 1.0;
                                        if (!parparams.spacing().isDefault()) {
                                                spacing_val = parparams.spacing().getValue();
                                        } else {
-                                               spacing_val = buffer.params().spacing.getValue();
+                                               spacing_val = buffer.params().spacing().getValue();
                                        }
 
                                        int const maxdesc =
@@ -791,7 +799,7 @@ void RowPainter::paintFirst()
                        if (!parparams.spacing().isDefault()) {
                                spacing_val = parparams.spacing().getValue();
                        } else {
-                               spacing_val = buffer.params().spacing.getValue();
+                               spacing_val = buffer.params().spacing().getValue();
                        }
 
                        int maxdesc =