]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Store ASCII data in std::string
[lyx.git] / src / Text.cpp
index 99d9cfb6070aba5ec4a952c98e932ffbef447257..a2ae1aed8f33b772ea527dbb824c2ff9b874bc4f 100644 (file)
@@ -1008,7 +1008,10 @@ void Text::insertChar(Cursor & cur, char_type c)
 
        // Prevent to insert uncodable characters in verbatim and ERT
        // (workaround for bug 9012)
-       if (cur.paragraph().isPassThru() && cur.current_font.language()) {
+       // Don't do it for listings inset, since InsetListings::latex() tries
+       // to switch to a usable encoding which works in many cases (bug 9102).
+       if (cur.paragraph().isPassThru() && owner_->lyxCode() != LISTINGS_CODE &&
+           cur.current_font.language()) {
                Encoding const * e = cur.current_font.language()->encoding();
                if (!e->encodable(c)) {
                        cur.message(_("Character is uncodable in verbatim paragraphs."));
@@ -1273,8 +1276,7 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
        LBUFERR(this == cur.text());
 
        if (!cur.selection()) {
-               bool const changed = cur.paragraph().isChanged(cur.pos());
-               if (!(changed && findNextChange(&cur.bv())))
+               if (!selectChange(cur))
                        return;
        }
 
@@ -1290,7 +1292,6 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
        bool endsBeforeEndOfPar = (endPos < pars_[endPit].size());
 
        // first, accept/reject changes within each individual paragraph (do not consider end-of-par)
-
        for (pit_type pit = begPit; pit <= endPit; ++pit) {
                pos_type parSize = pars_[pit].size();
 
@@ -1366,11 +1367,8 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
        }
 
        // finally, invoke the DEPM
-
        deleteEmptyParagraphMechanism(begPit, endPit, cur.buffer()->params().track_changes);
 
-       //
-
        cur.finishUndo();
        cur.clearSelection();
        setCursorIntern(cur, begPit, begPos);