]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Compile fix after change 4b64aaf, replace missing constructor for C-string with docst...
[lyx.git] / src / Paragraph.cpp
index ae2e6def1ff6ebda935983c446d775ee5f96d796..c29ca4cb930110e780b8011b19ef7fea4d77a246 100644 (file)
@@ -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<pos_type>(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];
@@ -3269,8 +3278,6 @@ void Paragraph::forOutliner(docstring & os, size_t const maxlen,
                char_type const c = d->text_[i];
                if (isPrintable(c))
                        os += c;
-               else if (c == '\t' || c == '\n')
-                       os += ' ';
                else if (c == META_INSET)
                        getInset(i)->forOutliner(os, tmplen, false);
        }