]> git.lyx.org Git - lyx.git/blobdiff - src/Changes.cpp
Further to r26743, add CustomPars and ForcePlain layout tags to InsetLayout,
[lyx.git] / src / Changes.cpp
index 1456db561c2d4971834f78dd3c8f7439be249f34..b49f2551509ee921b8af5db1e07b6817c8c154b1 100644 (file)
@@ -406,21 +406,28 @@ void Changes::addToToc(DocIterator const & cdit, Buffer const & buffer) const
                        str.push_back(0x2702);
                        break;
                case Change::INSERTED:
-                       // 0x2702 is the hand writting symbol in the Dingbats unicode group.
+                       // 0x270d is the hand writting symbol in the Dingbats unicode group.
                        str.push_back(0x270d);
                        break;
                }
                dit.pos() = it->range.start;
-               str += " " + dit.paragraph().asString(it->range.start, it->range.end);
+               Paragraph const & par = dit.paragraph();
+               str += " " + par.asString(it->range.start, min(par.size(), it->range.end));
+               if (it->range.end > par.size())
+                       // the end of paragraph symbol from the Punctuation group
+                       str.push_back(0x204B);
                docstring const & author = author_list.get(it->change.author).name();
-               Toc::const_iterator it = change_list.item(0, author);
+               Toc::iterator it = change_list.item(0, author);
                if (it == change_list.end()) {
                        change_list.push_back(TocItem(dit, 0, author));
                        change_list.push_back(TocItem(dit, 1, str));
-               } else {
-                       it++;
-                       change_list.insert(it, TocItem(dit, 1, str));
+                       continue;
+               }
+               for (++it; it != change_list.end(); ++it) {
+                       if (it->depth() == 0 && it->str() != author)
+                               break;
                }
+               change_list.insert(it, TocItem(dit, 1, str));
        }
 }