]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
LFUN_UNICODE_INSERT - unicode-insert
[lyx.git] / src / paragraph.C
index fa45cbd99b40269ebd950c46d0187e7b96dd29d4..84ab0f9ffed2c528e8cf0bc2e4152868c0b216c6 100644 (file)
@@ -46,7 +46,6 @@
 #include "support/convert.h"
 #include "support/unicode.h"
 
-#include <boost/tuple/tuple.hpp>
 #include <boost/bind.hpp>
 
 #include <algorithm>
@@ -236,19 +235,19 @@ void Paragraph::validate(LaTeXFeatures & features) const
 }
 
 
-bool Paragraph::erase(pos_type pos, bool trackChanges)
+bool Paragraph::eraseChar(pos_type pos, bool trackChanges)
 {
-       return pimpl_->erase(pos, trackChanges);
+       return pimpl_->eraseChar(pos, trackChanges);
 }
 
 
-int Paragraph::erase(pos_type start, pos_type end, bool trackChanges)
+int Paragraph::eraseChars(pos_type start, pos_type end, bool trackChanges)
 {
-       return pimpl_->erase(start, end, trackChanges);
+       return pimpl_->eraseChars(start, end, trackChanges);
 }
 
 
-void Paragraph::insert(pos_type start, string const & str,
+void Paragraph::insert(pos_type start, docstring const & str,
                        LyXFont const & font, Change const & change)
 {
        for (size_t i = 0, n = str.size(); i != n ; ++i)
@@ -570,7 +569,7 @@ int Paragraph::stripLeadingSpaces()
        int i = 0;
        while (!empty() && (isNewline(0) || isLineSeparator(0))
                && (lookupChange(0).type != Change::DELETED)) {
-               erase(0, false); // no change tracking here
+               eraseChar(0, false); // no change tracking here
                ++i;
        }
 
@@ -656,8 +655,8 @@ void Paragraph::setBeginOfBody()
        pos_type end = size();
        if (i < end && !isNewline(i)) {
                ++i;
-               char previous_char = 0;
-               char temp = 0;
+               char_type previous_char = 0;
+               char_type temp = 0;
                if (i < end) {
                        previous_char = text_[i];
                        if (!isNewline(i)) {
@@ -1159,7 +1158,7 @@ string Paragraph::getID(Buffer const & buf, OutputParams const & runparams) cons
                        InsetBase::Code lyx_code = inset->lyxCode();
                        if (lyx_code == InsetBase::LABEL_CODE) {
                                string const id = static_cast<InsetCommand const *>(inset)->getContents();
-                               return "id=\"" + sgml::cleanID(buf, runparams, id) + "\"";
+                               return "id='" + to_utf8(sgml::cleanID(buf, runparams, from_utf8(id))) + "'";
                        }
                }
 
@@ -1179,14 +1178,8 @@ pos_type Paragraph::getFirstWord(Buffer const & buf, odocstream & os, OutputPara
                        value_type c = getChar(i);
                        if (c == ' ')
                                break;
-                       bool ws;
-                       string str;
-                       // FIXME UNICODE
-                       // sgml::escapeChar takes a char, not lyx::char_type
-                       boost::tie(ws, str) = sgml::escapeChar(c);
-                        // FIXME UNICODE
-                       os << from_ascii(str);
-               }
+                       os << sgml::escapeChar(c);
+               }
        }
        return i;
 }
@@ -1244,17 +1237,12 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
                        inset->docbook(buf, os, runparams);
                } else {
                        value_type c = getChar(i);
-                       bool ws;
-                       string str;
-                       // FIXME UNICODE
-                       // sgml::escapeChar takes a char, not lyx::char_type
-                       boost::tie(ws, str) = sgml::escapeChar(c);
 
                        if (style->pass_thru)
                                 os.put(c);
                        else
                                 // FIXME UNICODE
-                                os << from_ascii(str);
+                                os << sgml::escapeChar(c);
                }
                font_old = font;
        }