cosmetics: return early whenever possible to reduce indentation.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19724 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-08-22 14:36:18 +00:00
parent a921f1b7ae
commit 4c1144c187

View File

@ -265,13 +265,14 @@ void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
return;
}
// open may fail, so we need to test it again
if (theBufferList().exists(file)) {
if (!theBufferList().exists(file))
return;
// if the current buffer is not that one, switch to it.
if (lyx_view_->buffer()->fileName() != file) {
if (switchToBuffer)
dispatch(FuncRequest(LFUN_BUFFER_SWITCH, file));
else
if (!switchToBuffer)
return;
dispatch(FuncRequest(LFUN_BUFFER_SWITCH, file));
}
// moveToPosition try paragraph id first and then paragraph (pit, pos).
if (!view()->moveToPosition(bm.bottom_pit, bm.bottom_pos,
@ -286,8 +287,10 @@ void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer)
// if bottom_pit, bottom_pos or top_id has been changed, update bookmark
// see http://bugzilla.lyx.org/show_bug.cgi?id=3092
if (bm.bottom_pit != new_pit || bm.bottom_pos != new_pos || bm.top_id != new_id )
const_cast<BookmarksSection::Bookmark &>(bm).updatePos(new_pit, new_pos, new_id);
if (bm.bottom_pit != new_pit || bm.bottom_pos != new_pos
|| bm.top_id != new_id) {
const_cast<BookmarksSection::Bookmark &>(bm).updatePos(
new_pit, new_pos, new_id);
}
}