#include "Gui.h"
#include "Buffer.h"
+//FIXME Bug 3701
+//#include "BufferList.h"
#include "BufferParams.h"
#include "BufferView.h"
#include "bufferview_funcs.h"
if (work_area_->bufferView().buffer())
disconnectBuffer();
- if (!b)
+ //FIXME Bug 3701
+ if (!b) // && theBufferList().empty()
getDialogs().hideBufferDependent();
work_area_->bufferView().setBuffer(b);
busy(true);
BOOST_ASSERT(work_area_);
- if (work_area_->bufferView().buffer())
+ bool const hadBuffer = work_area_->bufferView().buffer();
+ if (hadBuffer)
disconnectBuffer();
- bool loaded = work_area_->bufferView().loadLyXFile(filename, tolastfiles);
+ bool const loaded =
+ work_area_->bufferView().loadLyXFile(filename, tolastfiles);
updateToc();
updateMenubar();
if (loaded) {
connectBuffer(*work_area_->bufferView().buffer());
showErrorList("Parse");
- }
+ } else if (hadBuffer)
+ //Need to reconnect the buffer if the load failed
+ connectBuffer(*work_area_->bufferView().buffer());
updateStatusBar();
busy(false);
work_area_->redraw();
boost::bind(&WorkArea::redraw, work_area_));
bufferStructureChangedConnection_ =
- buf.structureChanged.connect(
+ buf.getMasterBuffer()->structureChanged.connect(
boost::bind(&LyXView::updateToc, this));
errorsConnection_ =
bool const review =
lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() &&
lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true);
-
+
toolbars_->update(math, table, review);
// update redaonly status of open dialogs. This could also be in
// updateMenubar(), but since updateToolbars() and updateMenubar()