]> git.lyx.org Git - lyx.git/blobdiff - src/text3.C
last Friday's text*.C -> text_func shuffle
[lyx.git] / src / text3.C
index 33284bc3e9248f8cf65d1ab26c871b9e5e4c7faf..e4cf6deba6a67e1d2589d245a2137706ec1c43a5 100644 (file)
@@ -43,6 +43,8 @@
 #include <ctime>
 #include <clocale>
 
+using namespace lyx::support;
+
 using std::endl;
 using std::find;
 using std::vector;
@@ -107,7 +109,7 @@ namespace {
                        return 0;
 
                // get inset dimensions
-               lyx::Assert(par->getInset(pos));
+               Assert(par->getInset(pos));
 
                LyXFont const & font = text.getFont(bv->buffer(), par, pos);
 
@@ -588,9 +590,9 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
        case LFUN_WORDSEL: {
                update();
-               LyXCursor cur1;
+               LyXCursor cur1 = cursor;
                LyXCursor cur2;
-               getWord(cur1, cur2, WHOLE_WORD);
+               ::getWord(cur1, cur2, lyx::WHOLE_WORD, ownerParagraphs());
                setCursor(cur1.par(), cur1.pos());
                bv->beforeChange(this);
                setCursor(cur2.par(), cur2.pos());
@@ -920,7 +922,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
        }
 
        case LFUN_INSET_SETTINGS:
-               lyx::Assert(bv->theLockingInset());
+               Assert(bv->theLockingInset());
                bv->theLockingInset()->getLockingInset()->showInsetDialog(bv);
                break;
 
@@ -1016,7 +1018,9 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
        case LFUN_TRANSPOSE_CHARS:
                update();
-               transposeChars(*this, cursor);
+               setUndo(bv, Undo::FINISH, cursor.par());
+               if (transposeChars(cursor))
+                       checkParagraph(cursor.par(), cursor.pos());
                if (inset_owner)
                        bv->updateInset(inset_owner);
                update();
@@ -1266,10 +1270,10 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                if (cmd.button() == mouse_button::button1) {
                        if (!isInInset()) {
                                bv->screen().toggleSelection(this, bv);
-                               selectWord(LyXText::WHOLE_WORD_STRICT);
+                               selectWord(lyx::WHOLE_WORD_STRICT);
                                bv->screen().toggleSelection(this, bv, false);
                        } else {
-                               selectWord(LyXText::WHOLE_WORD_STRICT);
+                               selectWord(lyx::WHOLE_WORD_STRICT);
                        }
                        update();
                        bv->haveSelection(selection.set());