]> git.lyx.org Git - lyx.git/commitdiff
Also when not using tabs, do not open a file twice if already opened (part of #8787)
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 26 Nov 2013 15:12:52 +0000 (16:12 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 26 Nov 2013 15:12:52 +0000 (16:12 +0100)
src/frontends/qt4/GuiApplication.cpp

index 53fb170390edee744f5b987e20ed7e38ff6a4f1a..6fd3eb479f91734e7c9334fffff0f7ef6043a34b 100644 (file)
@@ -1572,8 +1572,10 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                validateCurrentView();
                // FIXME: create a new method shared with LFUN_HELP_OPEN.
                string const fname = to_utf8(cmd.argument());
-               if (d->views_.empty() || (!lyxrc.open_buffers_in_tabs
-                         && current_view_->documentBufferView() != 0)) {
+               if (d->views_.empty()
+                   || (!lyxrc.open_buffers_in_tabs
+                       && current_view_->documentBufferView() != 0
+                       && !theBufferList().getBuffer(FileName(fname)))) {
                        // We want the ui session to be saved per document and not per
                        // window number. The filename crc is a good enough identifier.
                        boost::crc_32_type crc;