]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.C
fix compilation pb ; update eu.po
[lyx.git] / src / insets / insettext.C
index 4484a9cca249b60c3701098b9230ddfe6df4fa56..b693257621590b0d2ef63a2081b8dceecb16fd59 100644 (file)
@@ -37,7 +37,6 @@
 #include "lyxcursor.h"
 #include "CutAndPaste.h"
 #include "font.h"
-#include "minibuffer.h"
 #include "LColor.h"
 #include "support/textutils.h"
 #include "support/LAssert.h"
@@ -47,6 +46,8 @@
 #include "trans_mgr.h"
 #include "lyxscreen.h"
 #include "WorkArea.h"
+#include "gettext.h"
+#include "lyxfunc.h"
 
 using std::ostream;
 using std::ifstream;
@@ -91,9 +92,6 @@ void InsetText::init(InsetText const * ins)
        insetDescent = 0;
        insetWidth = 0;
        the_locking_inset = 0;
-#if 0
-       cursor_visible = false;
-#endif
        interline_space = 1;
        no_selection = false;
        need_update = INIT;
@@ -322,7 +320,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
        UpdatableInset::draw(bv, f, baseline, x, cleared);
 #else
        if (!owner())
-               x += (float)scroll();
+               x += static_cast<float>(scroll());
 #endif
        // update insetWidth and insetHeight with dummy calls
        (void)ascent(bv, f);
@@ -387,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;
@@ -568,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;
@@ -739,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, "");
@@ -1112,9 +1112,8 @@ InsetText::LocalDispatch(BufferView * bv,
 
                        // see if we found the layout number:
                        if (!layout.first) {
-                               string msg = string(N_("Layout ")) + arg + N_(" not known");
-
-                               bv->owner()->getMiniBuffer()->Set(msg);
+                               string const msg = string(N_("Layout ")) + arg + N_(" not known");
+                               bv->owner()->getLyXFunc()->Dispatch(LFUN_MESSAGE, msg);
                                break;
                        }