]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.C
fix compilation pb ; update eu.po
[lyx.git] / src / insets / insettext.C
index cd18251615a89010490ee42a4ed24d114a474261..b693257621590b0d2ef63a2081b8dceecb16fd59 100644 (file)
@@ -46,8 +46,8 @@
 #include "trans_mgr.h"
 #include "lyxscreen.h"
 #include "WorkArea.h"
-#include "lyxfunc.h"
 #include "gettext.h"
+#include "lyxfunc.h"
 
 using std::ostream;
 using std::ifstream;
@@ -385,6 +385,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
 #ifdef WITH_WARNINGS
 #warning Jürgen, why is this a block of its own? (Lgb)
 #warning because you told me to define variables only in local context (Jug)!
+#warning then make it a function/method of its own. (Lgb)
 #endif
        {
        int y = 0;
@@ -566,7 +567,8 @@ void InsetText::Edit(BufferView * bv, int x, int y, unsigned int button)
        inset_boundary = false;
        inset_par = 0;
        old_par = 0;
-       if (!checkAndActivateInset(bv, x, y, button))
+       int tmp_y = (y < 0)?0:y;
+       if (!checkAndActivateInset(bv, x, tmp_y, button))
                TEXT(bv)->SetCursorFromCoordinates(bv, x - drawTextXOffset,
                                                   y + insetAscent);
        TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
@@ -737,7 +739,7 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
                        return;
                }
        }
-       if (!inset && (button == 2)) {
+       if (!inset) { // && (button == 2)) {
                bool paste_internally = false;
                if ((button == 2) && TEXT(bv)->selection) {
                        LocalDispatch(bv, LFUN_COPY, "");
@@ -1111,8 +1113,7 @@ InsetText::LocalDispatch(BufferView * bv,
                        // see if we found the layout number:
                        if (!layout.first) {
                                string const msg = string(N_("Layout ")) + arg + N_(" not known");
-                               bv->owner()->getLyXFunc()
-                                       ->Dispatch(LFUN_MESSAGE, msg);
+                               bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, msg);
                                break;
                        }