+2005-11-24 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * CutAndPaste.C (numberOfSelections): new helper function.
+
+ * lyxfunc.C (getStatus): remove support for LFUN_COPY and LFUN_CUT.
+
+ * text3.C (getStatus): move code for LFUN_CUT and LFUN_COPY from
+ LyXFunc::getStatus; implement LFUN_PASTE.
+
2005-11-17 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* dociterator.[Ch]: new member realInset() that returns the cell
}
+lyx::size_type numberOfSelections()
+{
+ return theCuts.size();
+}
+
+
void cutSelection(LCursor & cur, bool doclear, bool realcut)
{
// This doesn't make sense, if there is no selection
///
std::vector<std::string> const availableSelections(Buffer const & buffer);
///
+lyx::size_type numberOfSelections();
+///
std::string getSelection(Buffer const & buffer, size_t sel_index);
///
enable = cmd.argument == "custom"
|| Exporter::IsExportable(*buf, cmd.argument);
break;
- case LFUN_CUT:
- case LFUN_COPY:
- enable = cur.selection();
- break;
case LFUN_RUNCHKTEX:
enable = buf->isLatex() && lyxrc.chktex_command != "none";
flag.setOnOff(font.family() == LyXFont::TYPEWRITER_FAMILY);
return true;
+ case LFUN_CUT:
+ case LFUN_COPY:
+ enable = cur.selection();
+ break;
+
+ case LFUN_PASTE:
+ enable = lyx::cap::numberOfSelections() > 0;
+ break;
+
case LFUN_DELETE_WORD_FORWARD:
case LFUN_DELETE_WORD_BACKWARD:
case LFUN_DELETE_LINE_FORWARD:
case LFUN_LOWCASE_WORD:
case LFUN_CAPITALIZE_WORD:
case LFUN_TRANSPOSE_CHARS:
- case LFUN_PASTE:
- case LFUN_CUT:
- case LFUN_COPY:
case LFUN_GETXY:
case LFUN_SETXY:
case LFUN_GETFONT: