#include "lyxtext.h"
#include "lyxrow.h"
-#include "layout.h"
+#include "lyxtextclasslist.h"
#include "paragraph.h"
#include "lyx_gui_misc.h"
#include "gettext.h"
pos_type pos) const
{
if (!Encodings::is_arabic(c))
- if (lyxrc.font_norm_type == LyXRC::ISO_8859_6_8 && isdigit(c))
+ if (lyxrc.font_norm_type == LyXRC::ISO_8859_6_8 && IsDigit(c))
return c + (0xb0 - '0');
else
return c;
// Returns the paragraph position of the last character in the specified row
pos_type LyXText::rowLast(Row const * row) const
{
- if (!row->next() || row->next()->par() != row->par())
+ if (!row->next() || row->next()->par() != row->par()) {
return row->par()->size() - 1;
- else
+ } else {
return row->next()->pos() - 1;
+ }
}
{
pos_type const last = rowLast(row);
pos_type first = row->pos();
+
if (first) { /* hfill *DO* count at the beginning
* of paragraphs! */
- while (first <= last && row->par()->isHfill(first))
+ while (first <= last && row->par()->isHfill(first)) {
++first;
+ }
}
first = max(first, beginningOfMainBody(buf, row->par()));
int n = 0;
for (pos_type p = first; p <= last; ++p) {
// last, because the end is ignored!
+
if (row->par()->isHfill(p)) {
++n;
}
static string const number_seperators = ".,:";
if (current_font.number() == LyXFont::ON) {
- if (!isdigit(c) && !contains(number_operators, c) &&
+ if (!IsDigit(c) && !contains(number_operators, c) &&
!(contains(number_seperators, c) &&
cursor.pos() >= 1 &&
cursor.pos() < cursor.par()->size() &&
cursor.pos() - 1).number() == LyXFont::ON)
)
number(bview); // Set current_font.number to OFF
- } else if (isdigit(c) &&
+ } else if (IsDigit(c) &&
real_current_font.isVisibleRightToLeft()) {
number(bview); // Set current_font.number to ON
y_bottom -= asc;
}
- pos_type const last = rowLastPrintable(p.row);
bool const is_rtl = p.row->par()->isRightToLeftPar(p.bv->buffer()->params);
int const endlabel = par->getEndLabel(buffer->params);
case END_LABEL_BOX:
case END_LABEL_FILLED_BOX:
{
- LyXFont const font = getFont(buffer, par, last);
+ LyXFont const font = getLabelFont(buffer, par);
int const size = int(0.75 * lyxfont::maxAscent(font));
int const y = (p.yo + p.row->baseline()) - size;
int x = is_rtl ? LYX_PAPER_MARGIN : ww - LYX_PAPER_MARGIN - size;
x += (size - p.row->fill() + 1) * (is_rtl ? -1 : 1);
if (endlabel == END_LABEL_BOX) {
- p.pain->line(x, y, x, y + size, LColor::eolmarker);
- p.pain->line(x + size, y, x + size , y + size, LColor::eolmarker);
- p.pain->line(x, y, x + size, y, LColor::eolmarker);
- p.pain->line(x, y + size, x + size, y + size, LColor::eolmarker);
+ p.pain->rectangle(x, y, size, size, LColor::eolmarker);
} else {
- p.pain->fillRectangle(x, y, size, size, LColor::eolmarker);
+ p.pain->fillRectangle(x, y, size, size,
+ LColor::eolmarker);
}
break;
}