}
// moveToPosition use par_id, and par_pit and return new par_id.
pit_type new_pit;
+ pos_type new_pos;
int new_id;
- boost::tie(new_pit, new_id) = view()->moveToPosition(bm.par_pit, bm.par_id, bm.par_pos);
- // if par_id or pit has been changed, reset par_pit and par_id
+ boost::tie(new_pit, new_pos, new_id) = view()->moveToPosition(bm.bottom_pit, bm.bottom_pos, bm.top_id, bm.top_pos);
+ // 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.par_pit != new_pit || bm.par_id != new_id)
- const_cast<BookmarksSection::Bookmark &>(bm).setPos(new_pit, 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);
}
}
string const name = cmd.getArg(0);
if (!buf)
enable = name == "aboutlyx"
- || name == "file"
- || name == "forks"
+ || name == "file" //FIXME: should be removed.
|| name == "prefs"
|| name == "texinfo";
else if (name == "print")
enable = Exporter::isExportable(*buf, "dvi")
&& lyxrc.print_command != "none";
- else if (name == "character" || name == "mathpanel")
+ else if (name == "character")
enable = cur.inset().lyxCode() != InsetBase::ERT_CODE;
else if (name == "latexlog")
enable = isFileReadable(FileName(buf->getLogName().second));
-#if !defined (USE_ASPELL) && !defined (USE_ISPELL) && !defined (USE_PSPELL)
else if (name == "spellchecker")
+#if defined (USE_ASPELL) || defined (USE_ISPELL) || defined (USE_PSPELL)
+ enable = !buf->isReadonly();
+#else
enable = false;
#endif
else if (name == "vclog")
enable = buf->lyxvc().inUse();
- else if (name == "view-source")
- enable = buf;
break;
}
break;
case LFUN_TOOLBAR_TOGGLE_STATE: {
- ToolbarBackend::Flags flags = lyx_view_->getToolbarState(to_utf8(cmd.argument()));
- if (!(flags & ToolbarBackend::AUTO))
- flag.setOnOff(flags & ToolbarBackend::ON);
+ ToolbarInfo::Flags flags = lyx_view_->getToolbarState(to_utf8(cmd.argument()));
+ if (!(flags & ToolbarInfo::AUTO))
+ flag.setOnOff(flags & ToolbarInfo::ON);
break;
}