]> git.lyx.org Git - lyx.git/blobdiff - src/text2.C
Dekels tabular/textinset patches
[lyx.git] / src / text2.C
index 6636883fe874dbe74f961a52a9406d19fb2fbba9..2c7e52f73dd7d4761c1829c0e1e514a1b4504f73 100644 (file)
@@ -2037,7 +2037,7 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const
                                Floating const & fl
                                        = floatList.getType(tmp->type());
                                // We should get the correct number here too.
-                               s = fl.name + " #:";
+                               s = fl.name() + " #:";
                        } else {
                                /* par->SetLayout(0); 
                                   s = layout->labelstring;  */
@@ -2145,16 +2145,13 @@ void LyXText::InsertInset(BufferView * bview, Inset * inset)
                                      * The character will not be inserted a
                                      * second time */
 #if 1
-       // if we enter a text-inset the cursor should be to the left side
-       // of it! This couldn't happen before as Undo was not handled inside
+       // If we enter a highly editable inset the cursor should be to before
+       // the inset. This couldn't happen before as Undo was not handled inside
        // inset now after the Undo LyX tries to call inset->Edit(...) again
        // and cannot do this as the cursor is behind the inset and GetInset
        // does not return the inset!
-       if (inset->IsTextInset()) {
-               if (cursor.par()->isRightToLeftPar(bview->buffer()->params))
-                       CursorRight(bview);
-               else
-                       CursorLeft(bview);
+       if (inset->Editable() == Inset::HIGHLY_EDITABLE) {
+               CursorLeft(bview, true);
        }
 #endif
 }
@@ -2189,7 +2186,7 @@ void LyXText::CutSelection(BufferView * bview, bool doclear)
                return;
    
        // OK, we have a selection. This is always between sel_start_cursor
-       // and sel_end cursor
+       // and sel_end_cursor
 #ifndef NEW_INSETS
        // Check whether there are half footnotes in the selection
        if (sel_start_cursor.par()->footnoteflag != LyXParagraph::NO_FOOTNOTE
@@ -2674,7 +2671,8 @@ void LyXText::CheckParagraph(BufferView * bview, LyXParagraph * par,
                        
                        // set the cursor again. Otherwise
                        // dangling pointers are possible
-                       SetCursor(bview, cursor.par(), cursor.pos());
+                       SetCursor(bview, cursor.par(), cursor.pos(),
+                                 false, cursor.boundary());
                        sel_cursor = cursor;
                        return;
                }
@@ -2709,20 +2707,25 @@ void LyXText::CheckParagraph(BufferView * bview, LyXParagraph * par,
    
        if (selection) {
                tmpcursor = cursor;
-               SetCursorIntern(bview, sel_cursor.par(), sel_cursor.pos());
+               SetCursorIntern(bview, sel_cursor.par(), sel_cursor.pos(),
+                               false, sel_cursor.boundary());
                sel_cursor = cursor; 
                SetCursorIntern(bview, sel_start_cursor.par(),
-                               sel_start_cursor.pos());
+                               sel_start_cursor.pos(),
+                               false, sel_start_cursor.boundary());
                sel_start_cursor = cursor; 
                SetCursorIntern(bview, sel_end_cursor.par(),
-                               sel_end_cursor.pos());
+                               sel_end_cursor.pos(),
+                               false, sel_end_cursor.boundary());
                sel_end_cursor = cursor; 
                SetCursorIntern(bview, last_sel_cursor.par(),
-                               last_sel_cursor.pos());
+                               last_sel_cursor.pos(),
+                               false, last_sel_cursor.boundary());
                last_sel_cursor = cursor; 
                cursor = tmpcursor;
        }
-       SetCursorIntern(bview, cursor.par(), cursor.pos());
+       SetCursorIntern(bview, cursor.par(), cursor.pos(),
+                       false, cursor.boundary());
 }