]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
lyx2lyx/lyx_1_6.py: fixes for r26882 as promised
[lyx.git] / src / Buffer.cpp
index 434f56103ab63027f257b7ced4414aed19612e63..7358872b0b45b26b7ab5a893d8cc0768cf89204d 100644 (file)
@@ -115,7 +115,9 @@ namespace os = support::os;
 
 namespace {
 
-int const LYX_FORMAT = 340; //jamatos: add plain layout
+// Do not remove the comment below, so we get merge conflict in
+// independent branches. Instead add your own.
+int const LYX_FORMAT = 344;  // ps: backref
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
@@ -275,6 +277,11 @@ Buffer::~Buffer()
        // GuiView already destroyed
        gui_ = 0;
 
+       if (d->unnamed && d->filename.extension() == "internal") {
+               // No need to do additional cleanups for internal buffer.
+               delete d;
+               return;
+       }
 
        // loop over children
        Impl::BufferPositionMap::iterator it = d->children_positions.begin();
@@ -619,11 +626,8 @@ void Buffer::insertStringAsLines(ParagraphList & pars,
                                ++pos;
                                space_inserted = true;
                        } else {
-                               const pos_type n = 8 - pos % 8;
-                               for (pos_type i = 0; i < n; ++i) {
-                                       par.insertChar(pos, ' ', font, params().trackChanges);
-                                       ++pos;
-                               }
+                               par.insertChar(pos, *cit, font, params().trackChanges);
+                               ++pos;
                                space_inserted = true;
                        }
                } else if (!isPrintable(*cit)) {