]> git.lyx.org Git - lyx.git/commitdiff
Some cleanup and a fix for a potential crash while investigating #7572.
authorRichard Heck <rgheck@comcast.net>
Fri, 27 May 2011 19:47:10 +0000 (19:47 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 27 May 2011 19:47:10 +0000 (19:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38858 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/frontends/qt4/GuiView.cpp

index 39a87c517a9a4dd331c5fbffd5af8e97c0df9c02..3ddc0efd427ef05040d2c600ebb2e3f9233298bb 100644 (file)
@@ -2188,8 +2188,8 @@ int BufferView::scrollUp(int offset)
 
 void BufferView::setCursorFromRow(int row)
 {
-       int tmpid = -1;
-       int tmppos = -1;
+       int tmpid;
+       int tmppos;
 
        buffer_.texrow().getIdFromRow(row, tmpid, tmppos);
 
index 97d320491782d6fdb83136fee0b3ed11bf80e1b7..701abf11567fb60c955831dc91b9c44df43309ff 100644 (file)
@@ -2930,6 +2930,13 @@ bool GuiView::goToFileRow(string const & argument)
                        return false;
                }
        }
+       if (!buf) {
+               message(bformat(
+                       _("No buffer for file `%1$s'."),
+                       makeDisplayPath(file_name))
+               );
+               return false;
+       }
        setBuffer(buf);
        documentBufferView()->setCursorFromRow(row);
        return true;