]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Fix a crash when closing tabs
[lyx.git] / src / Text.cpp
index 98d19dfb023693c7453768a18eec361174b22412..579089dab8d93fcc2fc864a50738f24d21c0c2fb 100644 (file)
@@ -895,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
@@ -1881,6 +1881,7 @@ bool Text::dissolveInset(Cursor & cur)
                }
 
                pasteParagraphList(cur, plist, b.params().documentClassPtr(),
+                                  b.params().authors(),
                                   b.errorList("Paste"));
        }