]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Update it.po
[lyx.git] / src / Buffer.cpp
index fec78d57529fee9db052eecea2f0ad2b88e74c59..d11b057c4d408f3b73978a8b42f65ee3658de139 100644 (file)
@@ -2543,7 +2543,7 @@ Buffer const * Buffer::parent() const
 ListOfBuffers Buffer::allRelatives() const
 {
        ListOfBuffers lb = masterBuffer()->getDescendents();
-       lb.push_front(const_cast<Buffer *>(this));
+       lb.push_front(const_cast<Buffer *>(masterBuffer()));
        return lb;
 }
 
@@ -3899,9 +3899,10 @@ void Buffer::bufferErrors(TeXErrors const & terr, ErrorList & errorList) const
                int errorRow = it->error_in_line;
                Buffer const * buf = 0;
                Impl const * p = d;
-               p->texrow.getIdFromRow(errorRow, id_start, pos_start);
-               if (id_start == -1) {
-                       // Check whether the error occurred in a child
+               if (it->child_name.empty())
+                   p->texrow.getIdFromRow(errorRow, id_start, pos_start);
+               else {
+                       // The error occurred in a child
                        ListOfBuffers::const_iterator cit = clist.begin();
                        for (; cit != cen; ++cit) {
                                string const child_name =
@@ -3929,6 +3930,12 @@ void Buffer::bufferErrors(TeXErrors const & terr, ErrorList & errorList) const
                        found = p->texrow.getIdFromRow(errorRow, id_end, pos_end);
                } while (found && id_start == id_end && pos_start == pos_end);
 
+               if (id_start != id_end) {
+                       // Next registered position is outside the inset where
+                       // the error occurred, so signal end-of-paragraph
+                       pos_end = 0;
+               }
+
                errorList.push_back(ErrorItem(it->error_desc,
                        it->error_text, id_start, pos_start, pos_end, buf));
        }