]> git.lyx.org Git - lyx.git/blobdiff - src/text2.C
insetquote fix; getStatus tweaks
[lyx.git] / src / text2.C
index 9c001ca63722bb5d4f7dc617c4c5633b352b94ba..938d9fd3a201fea559db7fc53fa9f8fff6538588 100644 (file)
@@ -199,7 +199,7 @@ void LyXText::setCharFont(BufferView * bv, Paragraph * par,
        if (par->getChar(pos) == Paragraph::META_INSET) {
                Inset * inset = par->getInset(pos);
                if (inset) {
-                       if (inset->editable()==Inset::HIGHLY_EDITABLE) {
+                       if (inset->editable()==Inset::IS_EDITABLE) {
                                UpdatableInset * uinset =
                                        static_cast<UpdatableInset *>(inset);
                                uinset->setFont(bv, fnt, toggleall, true);
@@ -523,7 +523,7 @@ void LyXText::setLayout(BufferView * bview, LyXTextClass::size_type layout)
        selection.cursor = cursor;
        setCursor(bview, selection.end.par(), selection.end.pos(), false);
        updateCounters(bview, cursor.row());
-       clearSelection(bview);
+       clearSelection();
        setSelection(bview);
        setCursor(bview, tmpcursor.par(), tmpcursor.pos(), true);
 }
@@ -604,7 +604,7 @@ void  LyXText::incDepth(BufferView * bview)
        selection.cursor = cursor;
        setCursor(bview, selection.end.par(), selection.end.pos());
        updateCounters(bview, cursor.row());
-       clearSelection(bview);
+       clearSelection();
        setSelection(bview);
        setCursor(bview, tmpcursor.par(), tmpcursor.pos());
 }
@@ -661,7 +661,7 @@ void  LyXText::decDepth(BufferView * bview)
        selection.cursor = cursor;
        setCursor(bview, selection.end.par(), selection.end.pos());
        updateCounters(bview, cursor.row());
-       clearSelection(bview);
+       clearSelection();
        setSelection(bview);
        setCursor(bview, tmpcursor.par(), tmpcursor.pos());
 }
@@ -723,7 +723,7 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
        setCursor(bview, selection.start.par(), selection.start.pos());
        selection.cursor = cursor;
        setCursor(bview, selection.end.par(), selection.end.pos());
-       clearSelection(bview);
+       clearSelection();
        setSelection(bview);
        setCursor(bview, tmpcursor.par(), tmpcursor.pos(), true,
                  tmpcursor.boundary());
@@ -779,7 +779,7 @@ void LyXText::redoDrawingOfParagraph(BufferView * bview, LyXCursor const & cur)
 // and the specified par 
 // This function is needed after SetLayout and SetFont etc.
 void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
-                            Paragraph const * endpar) const
+                             Paragraph const * endpar) const
 {
        Row * tmprow2;
        Paragraph * tmppar = 0;
@@ -797,7 +797,8 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
        } else {
                first_phys_par = tmprow->par();
                while (tmprow->previous()
-                      && tmprow->previous()->par() == first_phys_par) {
+                      && tmprow->previous()->par() == first_phys_par)
+               {
                        tmprow = tmprow->previous();
                        y -= tmprow->height();
                }
@@ -807,8 +808,8 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
        status(bview, LyXText::NEED_MORE_REFRESH);
        refresh_y = y;
        refresh_row = tmprow->previous();        /* the real refresh row will
-                                                   be deleted, so I store
-                                                   the previous here */ 
+                                               be deleted, so I store
+                                               the previous here */ 
        // remove it
        if (tmprow->next())
                tmppar = tmprow->next()->par();
@@ -824,7 +825,7 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
    
        // remove the first one
        tmprow2 = tmprow;     /* this is because tmprow->previous()
-                                can be 0 */
+                                can be 0 */
        tmprow = tmprow->previous();
        removeRow(tmprow2);
    
@@ -976,7 +977,7 @@ string const LyXText::selectionAsString(Buffer const * buffer) const
 }
 
 
-void LyXText::clearSelection(BufferView * /*bview*/) const
+void LyXText::clearSelection() const
 {
        selection.set(false);
        selection.mark(false);
@@ -1048,7 +1049,7 @@ void LyXText::toggleFree(BufferView * bview,
        // Implicit selections are cleared afterwards
        //and cursor is set to the original position.
        if (implicitSelection) {
-               clearSelection(bview);
+               clearSelection();
                cursor = resetCursor;
                setCursor(bview, cursor.par(), cursor.pos());
                selection.cursor = cursor;
@@ -1083,7 +1084,7 @@ LyXText::getStringToIndex(BufferView * bview)
        // Implicit selections are cleared afterwards
        //and cursor is set to the original position.
        if (implicitSelection) {
-               clearSelection(bview);
+               clearSelection();
                cursor = resetCursor;
                setCursor(bview, cursor.par(), cursor.pos());
                selection.cursor = cursor;
@@ -1176,7 +1177,7 @@ void LyXText::setParagraph(BufferView * bview,
        
        redoParagraphs(bview, selection.start, endpar);
        
-       clearSelection(bview);
+       clearSelection();
        setCursor(bview, selection.start.par(), selection.start.pos());
        selection.cursor = cursor;
        setCursor(bview, selection.end.par(), selection.end.pos());
@@ -1705,7 +1706,7 @@ void LyXText::cutSelection(BufferView * bview, bool doclear)
        cursor = selection.start;
 
        // need a valid cursor. (Lgb)
-       clearSelection(bview);
+       clearSelection();
 
        setCursor(bview, cursor.par(), cursor.pos());
        selection.cursor = cursor;
@@ -1764,7 +1765,7 @@ void LyXText::pasteSelection(BufferView * bview)
        redoParagraphs(bview, cursor, endpar);
        
        setCursor(bview, cursor.par(), cursor.pos());
-       clearSelection(bview);
+       clearSelection();
    
        selection.cursor = cursor;
        setCursor(bview, actpar, pos);
@@ -1834,7 +1835,7 @@ void LyXText::insertStringAsLines(BufferView * bview, string const & str)
        setCursorParUndo(bview);
        
        // only to be sure, should not be neccessary
-       clearSelection(bview);
+       clearSelection();
        
        bview->buffer()->insertStringAsLines(par, pos, current_font, str);
 
@@ -2536,6 +2537,11 @@ void LyXText::status(BufferView * bview, LyXText::text_status st) const
                status_ = st;
                if (inset_owner && st != UNCHANGED) {
                        bview->text->status(bview, NEED_VERY_LITTLE_REFRESH);
+                       if (!bview->text->refresh_row) {
+                               bview->text->refresh_row = bview->text->cursor.row();
+                               bview->text->refresh_y = bview->text->cursor.y() -
+                                       bview->text->cursor.row()->baseline();
+                       }
                }
        }
 #endif