}
+void BufferView::reload()
+{
+ string const fn = buffer()->fileName();
+ if (bufferlist.close(buffer()))
+ buffer(bufferlist.loadLyXFile(fn));
+}
+
+
void BufferView::resize()
{
if (pimpl_->buffer_) {
*/
void repaint();
+ /// reload the contained buffer
+ void reload();
+
/// fit the user cursor within the visible view
bool fitCursor();
/// perform pending painting updates
+2003-03-08 John Levon <levon@movementarian.org>
+
+ * lyxfunc.h:
+ * lyxfunc.C: move reloadBuffer()
+
+ * BufferView.h:
+ * BufferView.C: to here
+
+ * lyxvc.C: add comment
+
+ * vc-backend.h:
+ * vc-backend.C: call bv->reload() to avoid
+ getStatus() check on MENURELOAD
+
2003-03-07 Dekel Tsur <dekelts@tau.ac.il>
* LaTeX.C (run): Fix a bug where the DVI file was not updated due
break;
case LFUN_MENURELOAD:
- reloadBuffer();
+ view()->reload();
break;
case LFUN_UPDATE:
}
-void LyXFunc::reloadBuffer()
-{
- string const fn = owner->buffer()->fileName();
- if (bufferlist.close(owner->buffer()))
- view()->buffer(bufferlist.loadLyXFile(fn));
-}
-
-
void LyXFunc::closeBuffer()
{
if (bufferlist.close(owner->buffer()) && !quitting) {
///
void closeBuffer();
///
- void reloadBuffer();
- ///
// This return or directly text (default) of getLyXText()
///
LyXText * TEXT(bool) const;
using std::endl;
using std::pair;
+/* WARNING: Several of the vcs-> methods end up
+ * deleting this object via BufferView::reload() !
+ */
+
LyXVC::LyXVC()
{
vcs = 0;
}
vcs->checkOut();
-
}
}
+void VCS::reload()
+{
+ owner_->getUser()->reload();
+ /* Watch out ! We have deleted ourselves here
+ * via the ->reload() !
+ */
+}
+
+
RCS::RCS(string const & m)
{
master_ = m;
cmd += OnlyFilename(owner_->fileName());
cmd += '"';
doVCCommand(cmd, owner_->filePath());
- owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
}
doVCCommand("ci -q -u -m\"" + msg + "\" \""
+ OnlyFilename(owner_->fileName()) + '"',
owner_->filePath());
- owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+ reload();
}
doVCCommand("co -q -l \""
+ OnlyFilename(owner_->fileName()) + '"',
owner_->filePath());
- owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+ reload();
}
owner_->filePath());
// We ignore changes and just reload!
owner_->markClean();
- owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+ reload();
}
doVCCommand("cvs -q add -m \"" + msg + "\" \""
+ OnlyFilename(owner_->fileName()) + '"',
owner_->filePath());
- owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+ reload();
}
doVCCommand("cvs -q commit -m \"" + msg + "\" \""
+ OnlyFilename(owner_->fileName()) + '"',
owner_->filePath());
- owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+ reload();
}
doVCCommand("rm -f \"" + fil + "\"; cvs update \"" + fil + '"',
owner_->filePath());
owner_->markClean();
- owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+ reload();
}
/// parse information from the version file
virtual void scanMaster() = 0;
+ /// reload the document
+ void reload();
+
/**
* doVCCommand - call out to the version control utility
* @param cmd the command to execute