]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
Move #includes out of header files.
[lyx.git] / src / lyxfunc.C
index 603dbf47b61c503b6f30a50d48a022320fbf4a7f..c7de612436e78f1250562b8b7e2998f0cfdaf9b1 100644 (file)
@@ -26,6 +26,8 @@
 #include "buffer.h"
 #include "buffer_funcs.h"
 #include "BufferView.h"
+#include "funcrequest.h"
+#include "iterators.h"
 #include "lyxserver.h"
 #include "intl.h"
 #include "lyx_main.h"
@@ -319,7 +321,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();
@@ -345,7 +347,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:
@@ -553,7 +555,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();
@@ -922,8 +924,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
@@ -940,8 +942,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());
@@ -1631,7 +1633,11 @@ exit_with_message:
        view()->owner()->updateLayoutChoice();
 
        if (view()->available()) {
-               view()->fitCursor();
+               if (view()->fitCursor()) {
+                       lyxerr << "LyXFunc->fitCursor->update" << endl;
+
+                       view()->update();
+               }
 
                // If we executed a mutating lfun, mark the buffer as dirty
                if (!getStatus(ev).disabled()
@@ -1978,4 +1984,3 @@ bool LyXFunc::wasMetaKey() const
 {
        return (meta_fake_bit != key_modifier::none);
 }
-