#include "tracer.h"
#include "font.h"
#include "encoding.h"
+#include "lyxscreen.h"
using std::max;
using std::min;
LyXParagraph::size_type pos =
(is_space && lpos + 1 <= bidi_end &&
!row->par()->IsLineSeparator(lpos + 1) &&
- (!row->par()->table
- || !row->par()->IsNewline(lpos + 1)) )
+ (
+#ifndef NEW_TABULAR
+ !row->par()->table ||
+#endif
+ !row->par()->IsNewline(lpos + 1)) )
? lpos + 1 : lpos;
LyXFont font = row->par()->GetFontSettings(buf->params, pos);
bool new_rtl = font.isVisibleRightToLeft();
}
LyXParagraph::size_type vpos = bidi_start - 1;
- for (LyXParagraph::size_type lpos = bidi_start; lpos <= bidi_end; ++lpos) {
+ for (LyXParagraph::size_type lpos = bidi_start;
+ lpos <= bidi_end; ++lpos) {
vpos += log2vis_list[lpos - bidi_start];
vis2log_list[vpos - bidi_start] = lpos;
log2vis_list[lpos - bidi_start] = vpos;
if (!lyxrc.rtl_support)
return false; // This is just for speedup
- if (!bidi_InRange(pos - 1) ||
- (par->table && par->IsNewline(pos-1)) )
+ if (!bidi_InRange(pos - 1)
+#ifndef NEW_TABULAR
+ || (par->table && par->IsNewline(pos-1))
+#endif
+ )
return false;
bool rtl = bidi_level(pos - 1) % 2;
bool rtl2 = rtl;
- if (pos == par->Last() ||
- (par->table && par->IsNewline(pos)))
+ if (pos == par->Last()
+#ifndef NEW_TABULAR
+ || (par->table && par->IsNewline(pos))
+#endif
+ )
rtl2 = par->isRightToLeftPar(buf->params);
else if (bidi_InRange(pos))
rtl2 = bidi_level(pos) % 2;
bool rtl = font.isVisibleRightToLeft();
bool rtl2 = rtl;
- if (pos == par->Last() ||
- (par->table && par->IsNewline(pos)))
+ if (pos == par->Last()
+#ifndef NEW_TABULAR
+ || (par->table && par->IsNewline(pos))
+#endif
+ )
rtl2 = par->isRightToLeftPar(buf->params);
else if (bidi_InRange(pos))
rtl2 = bidi_level(pos) % 2;
// tmpinset->update(bview, font, false);
tmpinset->draw(bview, font, offset+row->baseline(), x,
cleared);
- if (status == CHANGED_IN_DRAW)
+ if (status == CHANGED_IN_DRAW) {
UpdateInset(bview, tmpinset);
+ status = CHANGED_IN_DRAW;
+ }
}
++vpos;
if (!row->par()->GetDepth()) {
if (!row->par()->GetLayout()) {
// find the previous same level paragraph
+#ifndef NEW_INSETS
if (row->par()->FirstPhysicalPar()->Previous()) {
+#else
+ if (row->par()->Previous()) {
+#endif
LyXParagraph * newpar = row->par()
->DepthHook(row->par()->GetDepth());
if (newpar &&
// make a corresponding row. Needed to call LeftMargin()
// check wether it is a sufficent paragraph
- if (newpar && newpar->footnoteflag == row->par()->footnoteflag
+ if (newpar
+#ifndef NEW_INSETS
+ && newpar->footnoteflag == row->par()->footnoteflag
+#endif
&& textclasslist
.Style(bview->buffer()->params.textclass,
newpar->GetLayout()).isEnvironment()) {
// is used to clear impossible depths after changing
// a layout. Since there is always a redo,
// LeftMargin() is always called
+#ifndef NEW_INSETS
row->par()->FirstPhysicalPar()->depth = 0;
+#else
+ row->par()->depth = 0;
+#endif
}
if (newpar && !row->par()->GetLayout()) {
+#ifndef NEW_INSETS
if (newpar->FirstPhysicalPar()->noindent)
+#else
+ if (newpar->noindent)
+#endif
parindent.erase();
else
parindent = textclasslist
}
int align; // wrong type
+#ifndef NEW_INSETS
if (row->par()->FirstPhysicalPar()->align == LYX_ALIGN_LAYOUT)
align = layout.align;
else
align = row->par()->FirstPhysicalPar()->align;
-
+#else
+ if (row->par()->align == LYX_ALIGN_LAYOUT)
+ align = layout.align;
+ else
+ align = row->par()->align;
+#endif
// set the correct parindent
if (row->pos() == 0) {
if ((layout.labeltype == LABEL_NO_LABEL
|| (layout.labeltype == LABEL_STATIC
&& layout.latextype == LATEX_ENVIRONMENT
&& ! row->par()->IsFirstInSequence()))
+#ifndef NEW_INSETS
&& row->par() == row->par()->FirstPhysicalPar()
+#endif
&& align == LYX_ALIGN_BLOCK
&& !row->par()->noindent
&& (row->par()->layout ||
LyXParagraph * newpar = row->par();
+#ifndef NEW_INSETS
do {
newpar = newpar->FirstPhysicalPar()->Previous();
if (newpar)
newpar = newpar->FirstPhysicalPar();
} while (newpar && newpar->GetDepth() >= row->par()->GetDepth()
&& newpar->footnoteflag == row->par()->footnoteflag);
+#else
+ do {
+ newpar = newpar->Previous();
+ } while (newpar
+ && newpar->GetDepth() >= row->par()->GetDepth());
+#endif
// make a corresponding row. Needed to call LeftMargin()
// check wether it is a sufficent paragraph
- if (newpar && newpar->footnoteflag == row->par()->footnoteflag
+ if (newpar
+#ifndef NEW_INSETS
+ && newpar->footnoteflag == row->par()->footnoteflag
+#endif
&& textclasslist.Style(buf->params.textclass,
newpar->GetLayout())
.isEnvironment()) {
// is used to clear impossible depths after changing
// a layout. Since there is always a redo,
// LeftMargin() is always called
+#ifndef NEW_INSETS
row->par()->FirstPhysicalPar()->depth = 0;
+#else
+ row->par()->depth = 0;
+#endif
}
}
/* Correction: only the fontsize count. The other properties
are taken from the layoutfont. Nicer on the screen :) */
-
+#ifndef NEW_INSETS
LyXParagraph * par = row_ptr->par()->LastPhysicalPar();
LyXParagraph * firstpar = row_ptr->par()->FirstPhysicalPar();
+#else
+ LyXParagraph * par = row_ptr->par();
+ LyXParagraph * firstpar = row_ptr->par();
+#endif
LyXLayout const & layout = textclasslist.Style(bview->buffer()->params.textclass,
firstpar->GetLayout());
}
/* is it a bottom line? */
- if (row_ptr->par()->ParFromPos(RowLast(row_ptr) + 1) == par
+ if (
+#ifndef NEW_INSETS
+ row_ptr->par()->ParFromPos(RowLast(row_ptr) + 1) == par
+#else
+ row_ptr->par() == par
+#endif
&& (!row_ptr->next() || row_ptr->next()->par() != row_ptr->par())) {
/* the paper margins */
height += row_ptr->height();
float x, dummy;
- PrepareToPrint(bview, row_ptr, x, dummy, dummy, dummy);
- row_ptr->width(maxwidth+x);
+ PrepareToPrint(bview, row_ptr, x, dummy, dummy, dummy, false);
+ row_ptr->width(int(maxwidth + x));
if (inset_owner) {
Row * r = firstrow;
width = max(0,workWidth(bview));
/* table stuff -- end */
#endif
// this is only allowed, if the current paragraph is not empty or caption
- if ((cursor.par()->Last() <= 0 && !cursor.par()->IsDummy())
+ if ((cursor.par()->Last() <= 0
+#ifndef NEW_INSETS
+ && !cursor.par()->IsDummy()
+#endif
+ )
&&
layout.labeltype!= LABEL_SENSITIVE)
return;
- SetUndo(bview->buffer(), Undo::INSERT,
+ SetUndo(bview->buffer(), Undo::INSERT,
+#ifndef NEW_INSETS
cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next);
+ cursor.par()->ParFromPos(cursor.pos())->next
+#else
+ cursor.par()->previous,
+ cursor.par()->next
+#endif
+ );
#ifndef NEW_TABULAR
/* table stuff -- begin */
SetHeightOfRow(bview, cursor.row());
- while (!cursor.par()->Next()->table && cursor.par()->Next()->Last()
+ while (
+#ifndef NEW_TABULAR
+ !cursor.par()->Next()->table &&
+#endif
+ cursor.par()->Next()->Last()
&& cursor.par()->Next()->IsNewline(0))
cursor.par()->Next()->Erase(0);
if ((cursor.pos() > 0 &&
cursor.par()->IsLineSeparator(cursor.pos() - 1))
|| (cursor.pos() > 0 && cursor.par()->IsNewline(cursor.pos() - 1))
- || (cursor.pos() == 0 &&
- !(cursor.par()->Previous()
+ || (cursor.pos() == 0
+#ifndef NEW_INSETS
+ && !(cursor.par()->Previous()
&& cursor.par()->Previous()->footnoteflag
- == LyXParagraph::OPEN_FOOTNOTE)))
+ == LyXParagraph::OPEN_FOOTNOTE)
+#endif
+ ))
return;
} else if (IsNewlineChar(c)) {
if (!IsEmptyTableCell()) {
* same Paragraph one to the right and make a rebreak */
void LyXText::InsertChar(BufferView * bview, char c)
{
- SetUndo(bview->buffer(), Undo::INSERT,
+ SetUndo(bview->buffer(), Undo::INSERT,
+#ifndef NEW_INSETS
cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next);
+ cursor.par()->ParFromPos(cursor.pos())->next
+#else
+ cursor.par()->previous,
+ cursor.par()->next
+#endif
+ );
// When the free-spacing option is set for the current layout,
// disable the double-space checking
|| (cursor.pos() > 0
&& cursor.par()->IsNewline(cursor.pos() - 1))
|| (cursor.pos() == 0
+#ifndef NEW_INSETS
&& !(cursor.par()->Previous()
&& cursor.par()->Previous()->footnoteflag
- == LyXParagraph::OPEN_FOOTNOTE))) {
+ == LyXParagraph::OPEN_FOOTNOTE)
+#endif
+ )) {
if (cursor.pos() == 0 )
bview->owner()->getMiniBuffer()->Set(_("You cannot insert a space at the beginning of a paragraph. Please read the Tutorial."));
else
return;
}
} else if (IsNewlineChar(c)) {
+#ifndef NEW_INSETS
if (cursor.par()->FirstPhysicalPar() == cursor.par()
+#else
+ if (cursor.par() == cursor.par()
+#endif
&& cursor.pos() <= BeginningOfMainBody(bview->buffer(), cursor.par())) {
charInserted();
return;
fill_separator = 0;
fill_label_hfill = 0;
-#ifndef NEW_INSETS
bool is_rtl = row->par()->isRightToLeftPar(bview->buffer()->params);
+#ifndef NEW_INSETS
if (is_rtl) {
x = RightMargin(bview->buffer(), row);
// is it block, flushleft or flushright?
// set x how you need it
int align;
+#ifndef NEW_INSETS
if (row->par()->FirstPhysicalPar()->align == LYX_ALIGN_LAYOUT)
align = textclasslist.Style(bview->buffer()->params.textclass, row->par()->GetLayout()).align;
else
align = row->par()->FirstPhysicalPar()->align;
+#else
+ if (row->par()->align == LYX_ALIGN_LAYOUT)
+ align = textclasslist.Style(bview->buffer()->params.textclass, row->par()->GetLayout()).align;
+ else
+ align = row->par()->align;
+#endif
// center displayed insets
+ Inset * inset;
if (row->par()->GetChar(row->pos()) == LyXParagraph::META_INSET
- && row->par()->GetInset(row->pos())
- && row->par()->GetInset(row->pos())->display())
+ && (inset=row->par()->GetInset(row->pos()))
+ && (inset->display())) // || (inset->scroll() < 0)))
align = LYX_ALIGN_CENTER;
switch (align) {
&& (tmpcursor.par()->IsSeparator(tmpcursor.pos() - 1)
|| tmpcursor.par()->IsKomma(tmpcursor.pos() - 1))
&& !(tmpcursor.par()->IsHfill(tmpcursor.pos() - 1)
+#ifndef NEW_INSETS
|| tmpcursor.par()->IsFloat(tmpcursor.pos() - 1)
+#endif
|| tmpcursor.par()->IsInset(tmpcursor.pos() - 1)))
tmpcursor.pos(tmpcursor.pos() - 1);
if (tmpcursor.pos()
&& (tmpcursor.par()->IsInset(tmpcursor.pos() - 1)
+#ifndef NEW_INSETS
|| tmpcursor.par()->IsFloat(tmpcursor.pos() - 1)
+#endif
|| tmpcursor.par()->IsHfill(tmpcursor.pos() - 1))) {
tmpcursor.pos(tmpcursor.pos() - 1);
} else if (!tmpcursor.pos()) {
// version did. (JMarc)
void LyXText::ChangeWordCase(BufferView * bview, LyXText::TextCase action)
{
+#ifndef NEW_INSETS
LyXParagraph * tmppar = cursor.par()->ParFromPos(cursor.pos());
+#else
+ LyXParagraph * tmppar = cursor.par();
+#endif
SetUndo(bview->buffer(),Undo::FINISH, tmppar->previous, tmppar->next);
+#ifndef NEW_INSETS
LyXParagraph::size_type tmppos =
cursor.par()->PositionInParFromPos(cursor.pos());
+#else
+ LyXParagraph::size_type tmppos = cursor.pos();
+#endif
while (tmppos < tmppar->size()) {
unsigned char c = tmppar->GetChar(tmppos);
if (IsKommaChar(c) || IsLineSeparatorChar(c))
if (old_cursor.par() != cursor.par() || old_cursor.pos() != cursor.pos()) {
LyXCursor tmpcursor = cursor;
cursor = old_cursor; // to make sure undo gets the right cursor position
- SetUndo(bview->buffer(), Undo::DELETE,
+ SetUndo(bview->buffer(), Undo::DELETE,
+#ifndef NEW_INSETS
cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next);
+ cursor.par()->ParFromPos(cursor.pos())->next
+#else
+ cursor.par()->previous,
+ cursor.par()->next
+#endif
+ );
cursor = tmpcursor;
Backspace(bview);
}
if ((lastpos == 0
|| (lastpos == 1 && cursor.par()->IsSeparator(0)))
+#ifndef NEW_INSETS
&& !(cursor.par()->Next()
&& cursor.par()->footnoteflag == LyXParagraph::NO_FOOTNOTE
- && cursor.par()->Next()->footnoteflag == LyXParagraph::OPEN_FOOTNOTE)) {
+ && cursor.par()->Next()->footnoteflag == LyXParagraph::OPEN_FOOTNOTE)
+#endif
+ ) {
// This is an empty paragraph and we delete it just by moving the cursor one step
// left and let the DeleteEmptyParagraphMechanism handle the actual deletion
// of the paragraph.
if (cursor.par()->previous) {
+#ifndef NEW_INSETS
LyXParagraph * tmppar = cursor.par()->previous->FirstPhysicalPar();
+#else
+ LyXParagraph * tmppar = cursor.par()->previous;
+#endif
if (cursor.par()->GetLayout() == tmppar->GetLayout()
+#ifndef NEW_INSETS
&& cursor.par()->footnoteflag == tmppar->footnoteflag
+#endif
&& cursor.par()->GetAlign() == tmppar->GetAlign()) {
// Inherit botom DTD from the paragraph below.
// (the one we are deleting)
return;
}
}
-
+
+#ifndef NEW_INSETS
if (cursor.par()->ParFromPos(cursor.pos())->previous){
SetUndo(bview->buffer(), Undo::DELETE,
cursor.par()->ParFromPos(cursor.pos())->previous->previous,
cursor.par()->ParFromPos(cursor.pos())->next);
}
+#else
+ if (cursor.par()->previous) {
+ SetUndo(bview->buffer(), Undo::DELETE,
+ cursor.par()->previous->previous,
+ cursor.par()->next);
+ }
+#endif
LyXParagraph * tmppar = cursor.par();
Row * tmprow = cursor.row();
if (cursor.par() != tmppar
&& (cursor.par()->GetLayout() == tmppar->GetLayout()
|| tmppar->GetLayout() == 0 /*standard*/)
+#ifndef NEW_INSETS
&& cursor.par()->footnoteflag == tmppar->footnoteflag
+#endif
#ifndef NEW_TABULAR
/* table stuff -- begin*/
&& !cursor.par()->table /* no pasting of tables */
} else {
/* this is the code for a normal backspace, not pasting
* any paragraphs */
- SetUndo(bview->buffer(), Undo::DELETE,
+ SetUndo(bview->buffer(), Undo::DELETE,
+#ifndef NEW_INSETS
cursor.par()->ParFromPos(cursor.pos())->previous,
- cursor.par()->ParFromPos(cursor.pos())->next);
+ cursor.par()->ParFromPos(cursor.pos())->next
+#else
+ cursor.par()->previous,
+ cursor.par()->next
+#endif
+ );
// We used to do CursorLeftIntern() here, but it is
// not a good idea since it triggers the auto-delete
// mechanism. So we do a CursorLeftIntern()-lite,
}
// break the cursor row again
- z = NextBreakPoint(bview, row, workWidth(bview));
-
- if (z != RowLast(row) ||
- (row->next() && row->next()->par() == row->par() &&
- RowLast(row) == row->par()->Last() - 1)){
+ if (row->next() && row->next()->par() == row->par() &&
+ (RowLast(row) == row->par()->Last() - 1 ||
+ NextBreakPoint(bview, row, workWidth(bview)) != RowLast(row))) {
/* it can happen that a paragraph loses one row
* without a real breakup. This is when a word
* is to long to be broken. Well, I don t care this
* hack ;-) */
- if (row->next() && row->next()->par() == row->par() &&
- RowLast(row) == row->par()->Last() - 1)
+ if (RowLast(row) == row->par()->Last() - 1)
RemoveRow(row->next());
refresh_y = y;
SetCursor(bview, cursor.par(), cursor.pos(), false, cursor.boundary());
// cursor MUST be in row now
- if (row->next() && row->next()->par() == row->par())
- need_break_row = row->next();
- else
- need_break_row = 0;
+ need_break_row = row->next();
} else {
// set the dimensions of the row
row->fill(Fill(bview, row, workWidth(bview)));
lastpos = cursor.par()->Last();
if (cursor.pos() == lastpos) {
- SetCurrentFont(bview);
if (IsBoundary(bview->buffer(), cursor.par(), cursor.pos()) != cursor.boundary())
SetCursor(bview, cursor.par(), cursor.pos(), false, !cursor.boundary());
+ SetCurrentFont(bview);
}
// check, wether the last characters font has changed.
LyXParagraph::size_type last = RowLastPrintable(row_ptr);
LyXParagraph::size_type vpos, pos;
- float x, tmpx;
- int y_top, y_bottom;
- float fill_separator, fill_hfill, fill_label_hfill;
+ float x;
+ float tmpx;
+ int y_top;
+ int y_bottom;
LyXFont font(LyXFont::ALL_SANE);
int maxdesc;
<< row_ptr->height() << endl;
return;
}
+
+ float fill_separator;
+ float fill_hfill;
+ float fill_label_hfill;
PrepareToPrint(bview, row_ptr, x, fill_separator,
fill_hfill, fill_label_hfill);
x += x_offset;
// clear the area where we want to paint/print
- int ww;
- ww = bview->workWidth();
+ int ww = bview->workWidth();
bool clear_area = true;
Inset * inset = 0;
- if ((last == row_ptr->pos()) &&
+ if (!bview->screen()->forceClear() && (last == row_ptr->pos()) &&
(row_ptr->par()->GetChar(row_ptr->pos()) == LyXParagraph::META_INSET) &&
- (inset=row_ptr->par()->GetInset(row_ptr->pos())))
- {
+ (inset = row_ptr->par()->GetInset(row_ptr->pos()))) {
clear_area = inset->doClearArea();
}
- if (cleared) { // we don't need to clear it's already done!!!
+ // we don't need to clear it's already done!!!
+ if (cleared) {
clear_area = true;
} else if (clear_area) {
- int w;
- if (inset_owner)
- w = inset_owner->width(bview, font);
- else
- w = ww;
+ int w = (inset_owner ? inset_owner->width(bview, font) : ww);
pain.fillRectangle(x_offset, y_offset, w, row_ptr->height());
} else if (inset != 0) {
int h = row_ptr->baseline() - inset->ascent(bview, font);
if (h > 0) {
- int w;
- if (inset_owner)
- w = inset_owner->width(bview, font);
- else
- w = ww;
+ int w = (inset_owner ?
+ inset_owner->width(bview, font) : ww);
pain.fillRectangle(x_offset, y_offset, w, h);
}
+ h += inset->ascent(bview, font) + inset->descent(bview, font);
+ if ((row_ptr->height() - h) > 0) {
+ int w = (inset_owner ?
+ inset_owner->width(bview, font) : ww);
+ pain.fillRectangle(x_offset,y_offset+h, w, row_ptr->height()-h);
+ }
+ if (!inset_owner && !inset->display() && !inset->needFullRow())
+ {
+ int w = inset->width(bview, font) + int(x);
+ pain.fillRectangle(w, y_offset, ww - w, row_ptr->height());
+ }
}
if (selection) {
+ int w = (inset_owner ? inset_owner->width(bview, font) : ww);
/* selection code */
if (bidi_same_direction) {
if (sel_start_cursor.row() == row_ptr &&
else
pain.fillRectangle(x_offset + sel_start_cursor.x(),
y_offset,
- ww - sel_start_cursor.x(),
+ w - sel_start_cursor.x(),
row_ptr->height(),
LColor::selection);
} else if (sel_end_cursor.row() == row_ptr) {
if (is_rtl)
pain.fillRectangle(x_offset + sel_end_cursor.x(),
y_offset,
- ww - sel_end_cursor.x(),
+ w - sel_end_cursor.x(),
row_ptr->height(),
LColor::selection);
else
LColor::selection);
} else if (y > long(sel_start_cursor.y())
&& y < long(sel_end_cursor.y())) {
- pain.fillRectangle(x_offset, y_offset, ww,
+ pain.fillRectangle(x_offset, y_offset, w,
row_ptr->height(),
LColor::selection);
}
sel_end_cursor.row() != row_ptr &&
y > long(sel_start_cursor.y())
&& y < long(sel_end_cursor.y())) {
- pain.fillRectangle(x_offset, y_offset, ww,
+ pain.fillRectangle(x_offset, y_offset, w,
row_ptr->height(),
LColor::selection);
} else if (sel_start_cursor.row() == row_ptr ||
sel_end_cursor.row() == row_ptr) {
float tmpx = x;
- int cell = 0;
#ifndef NEW_TABULAR
+ int cell = 0;
if (row_ptr->par()->table) {
cell = NumberOfCell(row_ptr->par(), row_ptr->pos());
tmpx += row_ptr->par()->table->GetBeginningOfTextInCell(cell);
}
#endif
// Draw appendix lines
+#ifndef NEW_INSETS
LyXParagraph * firstpar = row_ptr->par()->FirstPhysicalPar();
+#else
+ LyXParagraph * firstpar = row_ptr->par();
+#endif
if (firstpar->appendix){
pain.line(1, y_offset,
1, y_offset + row_ptr->height(),
int next_depth = 0;
int prev_depth = 0;
if (row_ptr->next())
+#ifndef NEW_INSETS
if (row_ptr->par()->footnoteflag ==
row_ptr->next()->par()->footnoteflag)
next_depth = row_ptr->next()->par()->GetDepth();
else if (row_ptr->par()->footnoteflag != LyXParagraph::OPEN_FOOTNOTE)
next_depth = depth;
-
+#else
+ next_depth = row_ptr->next()->par()->GetDepth();
+#endif
if (row_ptr->previous())
+#ifndef NEW_INSETS
if (row_ptr->par()->footnoteflag ==
row_ptr->previous()->par()->footnoteflag)
prev_depth = row_ptr->previous()->par()->GetDepth();
else if (row_ptr->par()->footnoteflag != LyXParagraph::OPEN_FOOTNOTE)
prev_depth = depth;
+#else
+ prev_depth = row_ptr->previous()->par()->GetDepth();
+#endif
for (int i = 1; i <= depth; ++i) {
int line_x = (LYX_PAPER_MARGIN / 5) * (i + minipage) + box_x;
if (is_rtl) {
tmpx = ww - LeftMargin(bview, row_ptr)
+ lyxfont::width(layout.labelsep, font);
+#ifndef NEW_INSETS
if (row_ptr->par()->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
LyXFont font(LyXFont::ALL_SANE);
font.setSize(LyXFont::SIZE_SMALL);
tmpx += lyxfont::width("Mwide-fixM", font);
}
+#endif
} else
tmpx = x - lyxfont::width(layout.labelsep, font)
- lyxfont::width(tmpstring, font);
}
/* is it a last row? */
+#ifndef NEW_INSETS
LyXParagraph * par = row_ptr->par()->LastPhysicalPar();
- if ((row_ptr->par()->ParFromPos(last + 1) == par) &&
- (!row_ptr->next() || (row_ptr->next()->par() != row_ptr->par())))
+#else
+ LyXParagraph * par = row_ptr->par();
+#endif
+ if (
+#ifndef NEW_INSETS
+ (row_ptr->par()->ParFromPos(last + 1) == par)
+#else
+ (row_ptr->par() == par)
+#endif
+ && (!row_ptr->next() || (row_ptr->next()->par() != row_ptr->par())))
{
/* think about the margins */
if (!row_ptr->next() && bv_owner)
int y = (y_offset + row_ptr->baseline()) - size;
int x = is_rtl ? LYX_PAPER_MARGIN
: ww - LYX_PAPER_MARGIN - size;
+#ifndef NEW_INSETS
if (row_ptr->par()->footnoteflag == LyXParagraph::OPEN_FOOTNOTE)
if (is_rtl) {
LyXFont font(LyXFont::ALL_SANE);
x += lyxfont::width("Mwide-figM", font);
} else
x -= LYX_PAPER_MARGIN/2;
+#endif
if (row_ptr->fill() <= size)
x += (size - row_ptr->fill() + 1) * (is_rtl ? -1 : 1);
if (endlabel == END_LABEL_BOX) {
}
#endif
-
if (vc > last + 1) // This shouldn't happen.
vc = last + 1;
boundary = false;
-
+#if 0 // currently unused
+ bool lastrow = (!row->next() || row->next()->par() != row->par());
+ bool rtl = (lastrow)
+ ? row->par()->isRightToLeftPar(bview->buffer()->params)
+ : false;
+#endif
+
if (row->pos() > last) // Row is empty?
c = row->pos();
- else if (vc == row->pos() ||
- (row->par()->table
- && vc <= last && row->par()->IsNewline(vc-1)) ) {
+#warning This is wrong, please have a look Dekel (Jug)
+#if 0
+ else if (lastrow &&
+ ( (rtl && vc == row->pos()&& x < tmpx - 5) ||
+ (!rtl && vc == last + 1 && x > tmpx + 5) ))
+ c = last + 1;
+#endif
+ else if (vc == row->pos()
+#ifndef NEW_TABULAR
+ || (row->par()->table
+ && vc <= last && row->par()->IsNewline(vc-1))
+#endif
+ ) {
c = vis2log(vc);
if (bidi_level(c) % 2 == 1)
++c;
}
}
- if (!row->par()->table && row->pos() <= last && c > last
- && row->par()->IsNewline(last)) {
+ if (
+#ifndef NEW_TABULAR
+ !row->par()->table &&
+#endif
+ row->pos() <= last && c > last
+ && row->par()->IsNewline(last)) {
if (bidi_level(last) % 2 == 0)
tmpx -= SingleWidth(bview, row->par(), last);
else