X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftext.C;h=46259d4d8b7b5f20dc52bf6fc9ba559670616bea;hb=2523638092e2024bac408eee98ad2094bc4e4089;hp=77820a2e122fe1dc6b5eccb6f7778e549ebd940c;hpb=cf3c73f4e85a8aedd92030427982aef98aae2baa;p=lyx.git diff --git a/src/text.C b/src/text.C index 77820a2e12..46259d4d8b 100644 --- a/src/text.C +++ b/src/text.C @@ -150,12 +150,14 @@ unsigned char LyXText::transformChar(unsigned char c, Paragraph * par, } 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); @@ -847,7 +849,7 @@ int LyXText::leftMargin(BufferView * bview, Row const * row) const 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 @@ -2026,11 +2028,10 @@ void LyXText::insertChar(BufferView * bview, char c) // 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? @@ -2055,9 +2056,7 @@ void LyXText::insertChar(BufferView * bview, char c) 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); @@ -2284,7 +2283,7 @@ void LyXText::cursorLeftOneWord(BufferView * bview) const } -void LyXText::cursorLeftOneWord(LyXCursor & cur) const +void LyXText::cursorLeftOneWord(LyXCursor & cur) const { // treat HFills, floats and Insets as words cur = cursor; @@ -2306,7 +2305,7 @@ void LyXText::cursorLeftOneWord(LyXCursor & cur) const } } 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); } } @@ -2324,8 +2323,8 @@ void LyXText::getWord(LyXCursor & from, LyXCursor & to, 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; } @@ -2395,7 +2394,8 @@ LyXText::selectNextWordToSpellcheck(BufferView * bview, float & value) const 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 @@ -2789,7 +2789,7 @@ void LyXText::backspace(BufferView * bview) && cursor.par()->getAlign() == tmppar->getAlign()) { removeParagraph(tmprow); removeRow(tmprow); - pasteParagraph(bview->buffer()->params, cursor.par()); + mergeParagraph(bview->buffer()->params, cursor.par()); if (!cursor.pos() || !cursor.par()->isSeparator(cursor.pos() - 1)) ; //cursor.par()->insertChar(cursor.pos(), ' '); @@ -3271,7 +3271,7 @@ int LyXText::drawLengthMarker(DrawRowParams & p, string const & prefix, 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; @@ -3280,8 +3280,8 @@ int LyXText::drawLengthMarker(DrawRowParams & p, string const & prefix, 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; @@ -3788,7 +3788,7 @@ LyXText::getColumnNearX(BufferView * bview, Row * row, int & x, } 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