X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXVC.cpp;h=244dff156d166797c314d79d5a220a6a2aa3b272;hb=0b791d49f52d0e0271b9f189e0561cbb314f81e1;hp=192b70b8f9c0a1f3370bcaff24ea727ed5a26c7d;hpb=aafd52f44167d5510be1ddcb974daa9dae486933;p=lyx.git diff --git a/src/LyXVC.cpp b/src/LyXVC.cpp index 192b70b8f9..244dff156d 100644 --- a/src/LyXVC.cpp +++ b/src/LyXVC.cpp @@ -176,6 +176,8 @@ bool LyXVC::registrer() string LyXVC::checkIn() { LYXERR(Debug::LYXVC, "LyXVC: checkIn"); + if (!vcs) + return string(); docstring empty(_("(no log message)")); docstring response; string log; @@ -201,6 +203,8 @@ string LyXVC::checkIn() string LyXVC::checkOut() { + if (!vcs) + return string(); //RCS allows checkOut only in ReadOnly mode if (vcs->toggleReadOnlyEnabled() && !owner_->isReadonly()) return string(); @@ -213,6 +217,8 @@ string LyXVC::checkOut() string LyXVC::repoUpdate() { LYXERR(Debug::LYXVC, "LyXVC: repoUpdate"); + if (!vcs) + return string(); return vcs->repoUpdate(); } @@ -220,6 +226,8 @@ string LyXVC::repoUpdate() string LyXVC::lockingToggle() { LYXERR(Debug::LYXVC, "LyXVC: toggle locking property"); + if (!vcs) + return string(); return vcs->lockingToggle(); } @@ -227,6 +235,8 @@ string LyXVC::lockingToggle() bool LyXVC::revert() { LYXERR(Debug::LYXVC, "LyXVC: revert"); + if (!vcs) + return false; docstring const file = owner_->fileName().displayName(20); docstring text = bformat(_("Reverting to the stored version of the " @@ -243,12 +253,16 @@ bool LyXVC::revert() void LyXVC::undoLast() { + if (!vcs) + return; vcs->undoLast(); } void LyXVC::toggleReadOnly() { + if (!vcs) + return; if (!vcs->toggleReadOnlyEnabled()) return; @@ -277,12 +291,16 @@ bool LyXVC::inUse() const string const LyXVC::versionString() const { + if (!vcs) + return string(); return vcs->versionString(); } bool LyXVC::locking() const { + if (!vcs) + return false; return vcs->status() != VCS::NOLOCKING; }