X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FParagraph.cpp;h=c29ca4cb930110e780b8011b19ef7fea4d77a246;hb=8e1a869c45b0c1cb1ee1f3e85d51325224ec3eb4;hp=0c5feb0cf23a93082cfc2cc066bb3c37fd05ec1d;hpb=cf64064db71ddedb4deb888e63325cea8619a9cd;p=lyx.git diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 0c5feb0cf2..c29ca4cb93 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -562,6 +562,18 @@ void Paragraph::addChangesToToc(DocIterator const & cdit, } +void Paragraph::addChangesToBuffer(Buffer const & buf) const +{ + d->changes_.updateBuffer(buf); +} + + +bool Paragraph::isChangeUpdateRequired() const +{ + return d->changes_.isUpdateRequired(); +} + + bool Paragraph::isDeleted(pos_type start, pos_type end) const { LASSERT(start >= 0 && start <= size(), return false); @@ -1192,7 +1204,9 @@ void Paragraph::Private::latexSpecialChar(otexstream & os, break; case '-': os << '-'; - if (i + 1 < end_pos && text_[i+1] == '-') { + if (i + 1 < static_cast(text_.size()) && + (end_pos == -1 || i + 1 < end_pos) && + text_[i+1] == '-') { // Prevent "--" becoming an endash and "---" becoming // an emdash. // Within \ttfamily, "--" is merged to "-" (no endash) @@ -1395,7 +1409,7 @@ void Paragraph::Private::validate(LaTeXFeatures & features) const } } string const snippet = to_utf8(ods.str()); - features.addPreambleSnippet(snippet); + features.addPreambleSnippet(snippet, true); } } @@ -1426,7 +1440,7 @@ void Paragraph::Private::validate(LaTeXFeatures & features) const icit->inset->validate(features); if (layout_->needprotect && icit->inset->lyxCode() == FOOT_CODE) - features.require("footmisc"); + features.require("NeedLyXFootnoteCode"); } } @@ -1731,7 +1745,10 @@ Font const & Paragraph::getFontSettings(BufferParams const & bparams, FontSpan Paragraph::fontSpan(pos_type pos) const { - LBUFERR(pos < size()); + LBUFERR(pos <= size()); + + if (pos == size()) + return FontSpan(pos, pos); pos_type start = 0; FontList::const_iterator cit = d->fontlist_.begin(); @@ -1820,14 +1837,6 @@ Font const Paragraph::getLayoutFont } -/// Returns the height of the highest font in range -FontSize Paragraph::highestFontInRange - (pos_type startpos, pos_type endpos, FontSize def_size) const -{ - return d->fontlist_.highestInRange(startpos, endpos, def_size); -} - - char_type Paragraph::getUChar(BufferParams const & bparams, pos_type pos) const { char_type c = d->text_[pos];