Check if string holds absolute file name before passing to FileName

See http://comments.gmane.org/gmane.editors.lyx.cvs/38213http://comments.gmane.org/gmane.editors.lyx.cvs/38213
This commit is contained in:
Juergen Spitzmueller 2013-12-02 09:50:21 +01:00
parent 7f0c44cae3
commit 44df37ab2a

View File

@ -1572,10 +1572,12 @@ 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());
bool const is_open = FileName::isAbsolute(fname)
&& theBufferList().getBuffer(FileName(fname));
if (d->views_.empty()
|| (!lyxrc.open_buffers_in_tabs
&& current_view_->documentBufferView() != 0
&& !theBufferList().getBuffer(FileName(fname)))) {
&& !is_open)) {
// 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;