X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText.cpp;h=8f30f4eb7c151f0c6a9d8c1986252949445d3c24;hb=7a000652c02f98dcff4d3c611b22af244409df73;hp=b00f10de0c72edf95851c1a93db0093044345d9f;hpb=b6c089afa468159637e6ea14acb3ca1e14364d70;p=lyx.git diff --git a/src/Text.cpp b/src/Text.cpp index b00f10de0c..8f30f4eb7c 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -859,11 +859,12 @@ void Text::insertStringAsLines(Cursor & cur, docstring const & str, pos_type pos = cur.pos(); // The special chars we handle - map specialchars; - specialchars[0x200c] = InsetSpecialChar::LIGATURE_BREAK; - specialchars[0x200b] = InsetSpecialChar::ALLOWBREAK; - specialchars[0x2026] = InsetSpecialChar::LDOTS; - specialchars[0x2011] = InsetSpecialChar::NOBREAKDASH; + static map specialchars = { + { 0x200c, InsetSpecialChar::LIGATURE_BREAK }, + { 0x200b, InsetSpecialChar::ALLOWBREAK }, + { 0x2026, InsetSpecialChar::LDOTS }, + { 0x2011, InsetSpecialChar::NOBREAKDASH } + }; // insert the string, don't insert doublespace bool space_inserted = true; @@ -894,12 +895,12 @@ void Text::insertStringAsLines(Cursor & cur, docstring const & str, ++pos; space_inserted = true; } - } else if (specialchars.find(ch) != specialchars.end()) { - if (par.insertInset(pos, new InsetSpecialChar(specialchars.find(ch)->second), - font, bparams.track_changes ? - Change(Change::INSERTED) - : Change(Change::UNCHANGED))) - ++pos; + } else if (specialchars.find(ch) != specialchars.end() + && (par.insertInset(pos, new InsetSpecialChar(specialchars.find(ch)->second), + font, bparams.track_changes + ? Change(Change::INSERTED) + : Change(Change::UNCHANGED)))) { + ++pos; space_inserted = false; } else if (!isPrintable(ch)) { // Ignore (other) unprintables @@ -1495,7 +1496,8 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op) } // finally, invoke the DEPM - deleteEmptyParagraphMechanism(begPit, endPit, cur.buffer()->params().track_changes); + deleteEmptyParagraphMechanism(begPit, endPit, begPos, endPos, + cur.buffer()->params().track_changes); cur.finishUndo(); cur.clearSelection(); @@ -1880,6 +1882,7 @@ bool Text::dissolveInset(Cursor & cur) } pasteParagraphList(cur, plist, b.params().documentClassPtr(), + b.params().authors(), b.errorList("Paste")); }