GuiWorkArea const * GuiView::currentMainWorkArea() const
{
- if (d.currentTabWorkArea() == NULL)
- return NULL;
+ if (!d.currentTabWorkArea())
+ return 0;
return d.currentTabWorkArea()->currentWorkArea();
}
GuiWorkArea * GuiView::currentMainWorkArea()
{
- if (d.currentTabWorkArea() == NULL)
- return NULL;
+ if (!d.currentTabWorkArea())
+ return 0;
return d.currentTabWorkArea()->currentWorkArea();
}
void GuiView::setCurrentWorkArea(GuiWorkArea * wa)
{
LYXERR(Debug::DEBUG, "Setting current wa: " << wa << endl);
- if (wa == NULL) {
- d.current_work_area_ = NULL;
+ if (!wa) {
+ d.current_work_area_ = 0;
d.setBackground();
return;
}
- GuiWorkArea * old_gwa = theGuiApp()->currentView()->currentWorkArea();
- if (old_gwa == wa)
+
+ // FIXME: I've no clue why this is here and why it accesses
+ // theGuiApp()->currentView, which might be 0 (bug 6464).
+ // See also 27525 (vfr).
+ if (theGuiApp()->currentView() == this
+ && theGuiApp()->currentView()->currentWorkArea() == wa)
return;
if (currentBufferView())
GuiWorkArea * wa = workArea(*newBuffer);
if (wa == 0) {
- newBuffer->masterBuffer()->updateLabels();
+ newBuffer->masterBuffer()->updateBuffer();
wa = addWorkArea(*newBuffer);
} else {
//Disconnect the old buffer...there's no new one.
docstring str2;
Buffer * buf = loadDocument(fullname);
if (buf) {
- buf->updateLabels();
+ buf->updateBuffer();
setBuffer(buf);
buf->errors("Parse");
str2 = bformat(_("Document %1$s opened."), disp_fn);
Buffer * buf = lv->loadDocument(lyxfile);
if (!buf)
return false;
- buf->updateLabels();
+ buf->updateBuffer();
lv->setBuffer(buf);
buf->errors("Parse");
} else {
// 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);
- child->masterBuffer()->updateLabels();
+ child->masterBuffer()->updateBuffer();
setBuffer(child);
if (parsed)
child->errors("Parse");
buf = theBufferList().getBuffer(s);
else if (s.exists()) {
buf = loadDocument(s);
- buf->updateLabels();
+ buf->updateBuffer();
buf->errors("Parse");
} else {
message(bformat(
dr);
break;
}
- if (doc_buffer->doExport(argument, false)) {
+ if (!doc_buffer->doExport(argument, false)) {
dr.setError(true);
dr.setMessage(bformat(_("Error exporting to format: %1$s."),
cmd.argument()));
// will be replaced by a proper factory...
Dialog * createGuiAbout(GuiView & lv);
-Dialog * createGuiBibitem(GuiView & lv);
Dialog * createGuiBibtex(GuiView & lv);
Dialog * createGuiChanges(GuiView & lv);
Dialog * createGuiCharacter(GuiView & lv);
if (name == "aboutlyx")
return createGuiAbout(*this);
- if (name == "bibitem")
- return createGuiBibitem(*this);
if (name == "bibtex")
return createGuiBibtex(*this);
if (name == "changes")