]> git.lyx.org Git - features.git/commitdiff
All occurrences of buf->errors("Parse") in GuiApplication an GuiView are positioned...
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 29 Oct 2010 18:57:40 +0000 (18:57 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 29 Oct 2010 18:57:40 +0000 (18:57 +0000)
GuiView::loadDocument also already calls setBuffer(), so this is not needed everytime too.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35917 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiView.cpp

index d592821cb49ac5ac86263ff7eb918e550cc1c4b9..15d9f58c16bcf997b36b8efea3d773b8b4cdc42d 100644 (file)
@@ -1352,13 +1352,10 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                current_view_->message(bformat(_("Opening help file %1$s..."),
                                               makeDisplayPath(fname.absFileName())));
                Buffer * buf = current_view_->loadDocument(fname, false);
-               if (buf) {
-                       current_view_->setBuffer(buf);
 #ifndef DEVEL_VERSION
+               if (buf)
                        buf->setReadonly(true);
 #endif
-                       buf->errors("Parse");
-               }
                break;
        }
 
index 81463d9d0e1533c0575e292e9e43a236d0c1a96e..bc79914c01ad58cbc2e835b7e1f0ba74b8af57a3 100644 (file)
@@ -1815,6 +1815,7 @@ Buffer * GuiView::loadDocument(FileName const & filename, bool tolastfiles)
                return 0;
        }
 
+       newBuffer->errors("Parse");
        setBuffer(newBuffer);
 
        if (tolastfiles)
@@ -1895,10 +1896,6 @@ void GuiView::openDocument(string const & fname)
        docstring str2;
        Buffer * buf = loadDocument(fullname);
        if (buf) {
-               // I don't think this is needed, since it will be done in setBuffer().
-               // buf->updateBuffer();
-               setBuffer(buf);
-               buf->errors("Parse");
                str2 = bformat(_("Document %1$s opened."), disp_fn);
                if (buf->lyxvc().inUse())
                        str2 += " " + from_utf8(buf->lyxvc().versionString()) +
@@ -1945,10 +1942,6 @@ static bool import(GuiView * lv, FileName const & filename,
                Buffer * buf = lv->loadDocument(lyxfile);
                if (!buf)
                        return false;
-               // I don't think this is needed, since it will be done in setBuffer().
-               // buf->updateBuffer();
-               lv->setBuffer(buf);
-               buf->errors("Parse");
        } else {
                Buffer * const b = newFile(lyxfile.absFileName(), string(), true);
                if (!b)
@@ -2804,29 +2797,19 @@ void GuiView::openChildDocument(string const & fname)
        FileName const filename = support::makeAbsPath(fname, buffer.filePath());
        documentBufferView()->saveBookmark(false);
        Buffer * child = 0;
-       bool parsed = false;
        if (theBufferList().exists(filename)) {
                child = theBufferList().getBuffer(filename);
+               setBuffer(child);
        } else {
                message(bformat(_("Opening child document %1$s..."),
-               makeDisplayPath(filename.absFileName())));
+                       makeDisplayPath(filename.absFileName())));
                child = loadDocument(filename, false);
-               parsed = true;
        }
-       if (!child)
-               return;
-
        // Set the parent name of the child document.
        // This makes insertion of citations and references in the child work,
        // when the target is in the parent or another child document.
-       child->setParent(&buffer);
-
-       // I don't think this is needed, since it will be called in
-       // setBuffer().
-       //      child->masterBuffer()->updateBuffer();
-       setBuffer(child);
-       if (parsed)
-               child->errors("Parse");
+       if (child)
+               child->setParent(&buffer);
 }
 
 
@@ -2873,10 +2856,6 @@ bool GuiView::goToFileRow(string const & argument)
                        buf = loadDocument(s);
                        if (!buf)
                                return false;
-                       // I don't think this is needed. loadDocument() calls
-                       // setBuffer(), which calls updateBuffer().
-                       // buf->updateBuffer();
-                       buf->errors("Parse");
                } else {
                        message(bformat(
                                        _("File does not exist: %1$s"),