#include "buffer.h"
#include "debug.h"
#include "lyxrc.h"
-#include "LyXView.h"
-#include "Painter.h"
+#include "frontends/LyXView.h"
+#include "frontends/Painter.h"
+#include "frontends/screen.h"
#include "tracer.h"
#include "font.h"
#include "encoding.h"
-#include "lyxscreen.h"
#include "bufferview_funcs.h"
#include "BufferView.h"
#include "language.h"
return;
}
+ Inset * inset = row->par()->inInset();
+ if (inset && inset->owner() &&
+ inset->owner()->lyxCode() == Inset::ERT_CODE) {
+ bidi_start = -1;
+ return;
+ }
+
bidi_start = row->pos();
bidi_end = rowLastPrintable(row);
pos_type stack[2];
bool const rtl_par =
- row->par()->getParLanguage(buf->params)->RightToLeft();
+ row->par()->isRightToLeftPar(buf->params);
int level = 0;
bool rtl = false;
bool rtl0 = false;
break;
}
+ if ((workWidth(bview) > 0) &&
+ !row->par()->params().leftIndent().zero())
+ {
+ LyXLength const len = row->par()->params().leftIndent();
+ int const tw = inset_owner ?
+ inset_owner->latexTextWidth(bview) : workWidth(bview);
+ x += len.inPixels(tw, bview->text->defaultHeight());
+ }
+
LyXAlignment align; // wrong type
if (row->par()->params().align() == LYX_ALIGN_LAYOUT)
keep_layout = 2;
else
keep_layout = layout.isEnvironment();
+
+ // we need to set this before we insert the paragraph. IMO the
+ // breakParagraph call should return a bool if it inserts the
+ // paragraph before or behind and we should react on that one
+ // but we can fix this in 1.3.0 (Jug 20020509)
+ bool const isempty = (layout.keepempty && !cursor.par()->size());
cursor.par()->breakParagraph(bview->buffer()->params, cursor.pos(),
keep_layout);
/* This check is necessary. Otherwise the new empty paragraph will
* be deleted automatically. And it is more friendly for the user! */
- if (cursor.pos() || layout.keepempty)
+ if (cursor.pos() || isempty)
setCursor(bview, cursor.par()->next(), 0);
else
setCursor(bview, cursor.par(), 0);