]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
Point fix, earlier forgotten
[lyx.git] / src / lyxfunc.C
index 8c6840a28818075090b045361c6467b3e9fafb84..9c85a46ec617dc89dab45f3cb3b66c5af9710880 100644 (file)
@@ -1,12 +1,21 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file lyxfunc.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Alfredo Braunstein
+ * \author Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
+ * \author Angus Leeming
+ * \author John Levon
+ * \author André Pönitz
+ * \author Allan Rae
+ * \author Dekel Tsur
+ * \author Martin Vermeer
+ * \author Jürgen Vigna
  *
- *         Copyright 1995 Matthias Ettrich
- *          Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS.
+ */
 
 #include <config.h>
 
@@ -310,7 +319,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
        switch (ev.action) {
        case LFUN_EXPORT:
                disable = ev.argument != "custom"
-                       && !Exporter::IsExportable(buf, ev.argument);
+                       && !Exporter::IsExportable(*buf, ev.argument);
                break;
        case LFUN_UNDO:
                disable = buf->undostack.empty();
@@ -336,7 +345,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
                disable = !buf->isLatex() || lyxrc.chktex_command == "none";
                break;
        case LFUN_BUILDPROG:
-               disable = !Exporter::IsExportable(buf, "program");
+               disable = !Exporter::IsExportable(*buf, "program");
                break;
 
        case LFUN_LAYOUT_TABULAR:
@@ -505,6 +514,9 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
                        case InsetOld::NOTE_CODE:
                                disable = ev.argument != "note";
                                break;
+                       case InsetOld::BRANCH_CODE:
+                               disable = ev.argument != "branch";
+                               break;
                        default:
                                break;
                }
@@ -541,7 +553,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
                }
 
                if (name == "print") {
-                       disable = !Exporter::IsExportable(buf, "dvi") ||
+                       disable = !Exporter::IsExportable(*buf, "dvi") ||
                                lyxrc.print_command == "none";
                } else if (name == "character") {
                        UpdatableInset * tli = view()->theLockingInset();
@@ -633,6 +645,11 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
        case LFUN_INSERT_NOTE:
                code = InsetOld::NOTE_CODE;
                break;
+       case LFUN_INSERT_BRANCH:
+               code = InsetOld::BRANCH_CODE;
+               if (buf->params.branchlist.empty())
+                       disable = true;
+               break;
        case LFUN_INSERT_LABEL:
                code = InsetOld::LABEL_CODE;
                break;
@@ -905,8 +922,8 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                                if (irow != view()->text->firstRow()) {
 #if 1
                                        view()->text->setCursorFromCoordinates(
-                                               view()->text->cursor.ix() + inset_x,
-                                               view()->text->cursor.iy() -
+                                               view()->text->cursor.x() + inset_x,
+                                               view()->text->cursor.y() -
                                                irow->baseline() - 1);
                                        view()->text->cursor.x_fix(view()->text->cursor.x());
 #else
@@ -923,8 +940,8 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                                if (irow != view()->text->lastRow()) {
 #if 1
                                        view()->text->setCursorFromCoordinates(
-                                               view()->text->cursor.ix() + inset_x,
-                                               view()->text->cursor.iy() -
+                                               view()->text->cursor.x() + inset_x,
+                                               view()->text->cursor.y() -
                                                irow->baseline() +
                                                irow->height() + 1);
                                        view()->text->cursor.x_fix(view()->text->cursor.x());
@@ -1961,4 +1978,3 @@ bool LyXFunc::wasMetaKey() const
 {
        return (meta_fake_bit != key_modifier::none);
 }
-