#include "bufferparams.h"
#include "buffer.h"
#include "debug.h"
+#include "intl.h"
#include "lyxrc.h"
#include "encoding.h"
#include "frontends/LyXView.h"
#include "frontends/Painter.h"
#include "frontends/font_metrics.h"
#include "frontends/screen.h"
+#include "frontends/WorkArea.h"
#include "bufferview_funcs.h"
#include "BufferView.h"
#include "language.h"
#include "ParagraphParameters.h"
#include "undo_funcs.h"
#include "WordLangTuple.h"
+#include "paragraph_funcs.h"
#include "insets/insetbib.h"
#include "insets/insettext.h"
Buffer::inset_iterator it = bview->buffer()->inset_iterator_begin();
Buffer::inset_iterator end = bview->buffer()->inset_iterator_end();
for (; it != end; ++it) {
- if (*it == inset) {
+ if (&(*it) == inset) {
par = it.getPar();
pos = it.getPos();
break;
}
if (Encodings::is_arabic(next_char)) {
- if (Encodings::is_arabic(prev_char))
+ if (Encodings::is_arabic(prev_char) &&
+ !Encodings::is_arabic_special(prev_char))
return Encodings::TransformChar(c, Encodings::FORM_MEDIAL);
else
return Encodings::TransformChar(c, Encodings::FORM_INITIAL);
} else {
- if (Encodings::is_arabic(prev_char))
+ if (Encodings::is_arabic(prev_char) &&
+ !Encodings::is_arabic_special(prev_char))
return Encodings::TransformChar(c, Encodings::FORM_FINAL);
else
return Encodings::TransformChar(c, Encodings::FORM_ISOLATED);
drawForeignMark(p, orig_x, orig_font);
-#ifdef INHERIT_LANGUAGE
-#ifdef WITH_WARNINGS
- if ((font.language() == inherit_language) ||
- (font.language() == ignore_language))
- lyxerr << "No this shouldn't happen!\n";
-#endif
-#endif
return true;
}
} else {
// find the next level paragraph
- Paragraph * newpar =
- row->par()->outerHook();
+ Paragraph * newpar = row->par()->outerHook();
// make a corresponding row. Needed to call LeftMargin()
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());
+ x += len.inPixels(tw);
}
LyXAlignment align; // wrong type
// 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()->empty());
- cursor.par()->breakParagraph(bview->buffer()->params, cursor.pos(),
- keep_layout);
+ ::breakParagraph(bview->buffer()->params, cursor.par(), cursor.pos(),
+ keep_layout);
// well this is the caption hack since one caption is really enough
if (layout->labeltype == LABEL_SENSITIVE) {
// we would not get a rebreak!
row->fill(fill(bview, row, workWidth(bview)));
}
+
if (c == Paragraph::META_INSET || row->fill() < 0) {
refresh_y = y;
refresh_row = row;
- refresh_x = cursor.x();
- refresh_pos = cursor.pos();
status(bview, LyXText::NEED_MORE_REFRESH);
breakAgainOneRow(bview, row);
// will the cursor be in another row now?
need_break_row = 0;
} else {
refresh_y = y;
- refresh_x = cursor.x();
refresh_row = row;
- refresh_pos = cursor.pos();
int const tmpheight = row->height();
setHeightOfRow(bview, row);
}
-void LyXText::cursorLeftOneWord(LyXCursor & cur) const
+void LyXText::cursorLeftOneWord(LyXCursor & cur) const
{
// treat HFills, floats and Insets as words
cur = cursor;
}
} else { // Here, cur != 0
while (cur.pos() > 0 &&
- cur.par()->isWord(cur.pos()-1))
+ cur.par()->isWord(cur.pos() - 1))
cur.pos(cur.pos() - 1);
}
}
if (cursor.pos() == 0 || cursor.pos() == cursor.par()->size()
|| cursor.par()->isSeparator(cursor.pos())
|| cursor.par()->isKomma(cursor.pos())
- || cursor.par()->isSeparator(cursor.pos() -1)
- || cursor.par()->isKomma(cursor.pos() -1)) {
+ || cursor.par()->isSeparator(cursor.pos() - 1)
+ || cursor.par()->isKomma(cursor.pos() - 1)) {
to = from;
return;
}
if (the_locking_inset) {
WordLangTuple word = the_locking_inset->selectNextWordToSpellcheck(bview, value);
if (!word.word().empty()) {
- value += float(cursor.y())/float(height);
+ value += float(cursor.y());
+ value /= float(height);
return word;
}
// we have to go on checking so move cursor to the next char
&& cursor.par()->getAlign() == tmppar->getAlign()) {
removeParagraph(tmprow);
removeRow(tmprow);
- cursor.par()->pasteParagraph(bview->buffer()->params);
+ mergeParagraph(bview->buffer()->params, cursor.par());
if (!cursor.pos() || !cursor.par()->isSeparator(cursor.pos() - 1))
; //cursor.par()->insertChar(cursor.pos(), ' ');
switch (vsp.kind()) {
case VSpace::LENGTH:
{
- str = prefix + " (" + vsp.asLyXCommand() + ")";
+ str = prefix + " (" + vsp.asLyXCommand() + ')';
// adding or removing space
bool const added = !(vsp.length().len().value() < 0.0);
ty1 = added ? (start + arrow_size) : start;
by2 = added ? end : (end - arrow_size);
break;
}
- case VSpace:: VFILL:
- str = prefix + " (vertical fill)";
+ case VSpace::VFILL:
+ str = prefix + _(" (vertical fill)");
ty1 = ty2 = start;
by1 = by2 = end;
break;
}
if (hfillExpansion(bview->buffer(), row, c)) {
- x += singleWidth(bview, row->par(), c);
+ tmpx += singleWidth(bview, row->par(), c);
if (c >= main_body)
tmpx += fill_hfill;
else