]> git.lyx.org Git - features.git/blobdiff - src/text3.C
Replace LString.h with support/std_string.h,
[features.git] / src / text3.C
index 98dd18cc0b03aeaa0c6bafad2268e7657aa80040..685c7fd299d0b37a20faa469951197770c43fea5 100644 (file)
 #include <config.h>
 
 #include "lyxtext.h"
-#include "paragraph.h"
 #include "BufferView.h"
 #include "funcrequest.h"
 #include "lyxrc.h"
-#include "Lsstream.h"
+#include "support/std_sstream.h"
 #include "debug.h"
-#include "bufferparams.h"
 #include "buffer.h"
-#include "bufferview_funcs.h"
 #include "ParagraphParameters.h"
 #include "gettext.h"
 #include "factory.h"
 #include "intl.h"
-#include "box.h"
 #include "language.h"
 #include "support/tostr.h"
 #include "support/lstrings.h"
 #include "support/LAssert.h"
 #include "frontends/LyXView.h"
-#include "frontends/screen.h"
 #include "frontends/Dialogs.h"
 #include "insets/insetspecialchar.h"
 #include "insets/insettext.h"
-#include "insets/insetquotes.h"
 #include "insets/insetcommand.h"
 #include "insets/insetnewline.h"
 #include "undo_funcs.h"
 #include "text_funcs.h"
-#include "Lsstream.h"
 
-#include <ctime>
-#include <clocale>
 
 using namespace lyx::support;
 using namespace bv_funcs;
@@ -116,16 +107,16 @@ namespace {
 
                int const width = inset->width();
                int const inset_x = font.isVisibleRightToLeft()
-                       ? (cur.ix() - width) : cur.ix();
+                       ? (cur.x() - width) : cur.x();
 
                Box b(
                        inset_x + inset->scroll(),
                        inset_x + width,
-                       cur.iy() - inset->ascent(),
-                       cur.iy() + inset->descent()
+                       cur.y() - inset->ascent(),
+                       cur.y() + inset->descent()
                );
 
-               if (!b.contained(x, y)) {
+               if (!b.contains(x, y)) {
                        lyxerr[Debug::GUI] << "Missed inset at x,y "
                                           << x << ',' << y
                                           << " box " << b << endl;
@@ -136,7 +127,7 @@ namespace {
 
                x -= b.x1;
                // The origin of an inset is on the baseline
-               y -= text.cursor.iy();
+               y -= text.cursor.y();
 
                return inset;
        }
@@ -266,7 +257,7 @@ void LyXText::cursorPrevious()
                // tall rows, but it's not working right now.
        } else {
                if (inset_owner) {
-                       new_y = bv()->text->cursor.iy()
+                       new_y = bv()->text->cursor.y()
                                + bv()->theLockingInset()->insetInInsetY() + y
                                + rit->height()
                                - bv()->workHeight() + 1;
@@ -302,7 +293,7 @@ void LyXText::cursorNext()
 
        int y = topy + bv_owner->workHeight();
        if (inset_owner && !topy) {
-               y -= (bv_owner->text->cursor.iy()
+               y -= (bv_owner->text->cursor.y()
                          - bv_owner->top_y()
                          + bv_owner->theLockingInset()->insetInInsetY());
        }
@@ -327,7 +318,7 @@ void LyXText::cursorNext()
 #endif
        } else {
                if (inset_owner) {
-                       new_y = bv()->text->cursor.iy()
+                       new_y = bv()->text->cursor.y()
                                + bv()->theLockingInset()->insetInInsetY()
                                + y - rit->baseline();
                } else {
@@ -388,8 +379,9 @@ void doInsertInset(LyXText * lt, FuncRequest const & cmd,
 
 InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
 {
-       lyxerr[Debug::ACTION] << "LyXFunc::dispatch: action[" << cmd.action
-                             <<"] arg[" << cmd.argument << ']' << endl;
+       lyxerr[Debug::ACTION] << "LyXText::dispatch: action[" << cmd.action
+                             <<"] arg[" << cmd.argument << ']' << "xy[" <<
+                                 cmd.x << ',' << cmd.y << ']' << endl;
 
        BufferView * bv = cmd.view();
 
@@ -1214,11 +1206,11 @@ InsetOld::RESULT LyXText::dispatch(FuncRequest const & cmd)
                        LyXFont font = bv->text->getFont(cursor.par(), cursor.pos());
                        int width = tli->width();
                        int inset_x = font.isVisibleRightToLeft()
-                               ? cursor.ix() - width : cursor.ix();
+                               ? cursor.x() - width : cursor.x();
                        int start_x = inset_x + tli->scroll();
                        FuncRequest cmd1 = cmd;
                        cmd1.x = cmd.x - start_x;
-                       cmd1.y = cmd.y - cursor.iy() + bv->top_y();
+                       cmd1.y = cmd.y - cursor.y() + bv->top_y();
                        tli->localDispatch(cmd1);
                        break;
                }