]> git.lyx.org Git - lyx.git/commitdiff
Some more small fixes. Hopefully we'll get there soon!
authorJürgen Vigna <jug@sad.it>
Fri, 3 Aug 2001 13:09:59 +0000 (13:09 +0000)
committerJürgen Vigna <jug@sad.it>
Fri, 3 Aug 2001 13:09:59 +0000 (13:09 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2412 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/insets/ChangeLog
src/insets/insettext.C
src/screen.C
src/text2.C

index adac2acda212a2097f33d43f32cc5a23e4bcf702..dbd3f0828e3ef69001adeff7b31dc597452b77d5 100644 (file)
@@ -981,6 +981,9 @@ void BufferView::Pimpl::update()
                        bv_->text->status(bv_, st);
                        screen_->update(bv_->text, bv_);
                }
+               // do this here instead of in the screen::update because of
+               // the above loop!
+               bv_->text->status(bv_, LyXText::UNCHANGED);
                if (fitc)
                        fitCursor();
        }
index 5abd08ff411e3d5126903b10e3ffa344c4e51f86..a622e98094332fdc128f650a045155cde90addb3 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-03  Juergen Vigna  <jug@sad.it>
+
+       * insettext.C (setFont): don't call for a draw update if we're just
+       changing the cursor font!
+
 2001-08-02  Juergen Vigna  <jug@sad.it>
 
        * insettext.C (draw): clear the background with the right color if
index 483a7a8731aa4b3ec4fb82c0e2752efa0705df32..227ce17817ad31ed4eff96cfdb7ad5f8087d2687 100644 (file)
@@ -1579,6 +1579,10 @@ void InsetText::setFont(BufferView * bv, LyXFont const & font, bool toggleall,
                the_locking_inset->setFont(bv, font, toggleall, selectall);
                return;
        }
+       if ((!par->next() && !par->size()) || !cpar(bv)->size()) {
+               getLyXText(bv)->setFont(bv, font, toggleall);
+               return;
+       }
        bool clear = false;
        if (!lt) {
                lt = getLyXText(bv);
index ba1dc7dec4b6a537f86fd216343e1e3a730da336..c9590cf578aed6885ba16dd2624d9d7f9c37019b 100644 (file)
@@ -432,7 +432,7 @@ bool LyXScreen::fitCursor(LyXText * text, BufferView * bv)
 
    
 void LyXScreen::update(LyXText * text, BufferView * bv,
-                      int y_offset, int x_offset)
+                       int y_offset, int x_offset)
 {
        switch (text->status()) {
        case LyXText::NEED_MORE_REFRESH:
@@ -440,7 +440,10 @@ void LyXScreen::update(LyXText * text, BufferView * bv,
                int const y = max(int(text->refresh_y - text->first), 0);
                drawFromTo(text, bv, y, owner.height(), y_offset, x_offset);
                text->refresh_y = 0;
-               text->status(bv, LyXText::UNCHANGED);
+               // otherwise this is called ONLY from BufferView_pimpl(update)
+               // or we should see to set this flag accordingly
+               if (text != bv->text)
+                       text->status(bv, LyXText::UNCHANGED);
                expose(0, y, owner.workWidth(), owner.height() - y);
        }
        break;
@@ -452,7 +455,10 @@ void LyXScreen::update(LyXText * text, BufferView * bv,
                // this because if we had a major update the refresh_row could
                // have been set to 0!
                if (text->refresh_row) {
-                       text->status(bv, LyXText::UNCHANGED);
+                       // otherwise this is called ONLY from BufferView_pimpl(update)
+                       // or we should see to set this flag accordingly
+                       if (text != bv->text)
+                               text->status(bv, LyXText::UNCHANGED);
                        expose(0, text->refresh_y - text->first + y_offset,
                                   owner.workWidth(), text->refresh_row->height());
                }
index 938d9fd3a201fea559db7fc53fa9f8fff6538588..91d5b03c61a2ae8d84bd7475289bf3ca971d1918 100644 (file)
@@ -675,10 +675,12 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
                // Determine basis font
                LyXFont layoutfont;
                if (cursor.pos() < beginningOfMainBody(bview->buffer(),
-                                                      cursor.par()))
+                                                      cursor.par()))
+               {
                        layoutfont = getFont(bview->buffer(), cursor.par(),-2);
-               else
+               } else {
                        layoutfont = getFont(bview->buffer(), cursor.par(),-1);
+               }
                // Update current font
                real_current_font.update(font, toggleall);
 
@@ -697,12 +699,12 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
        // and sel_end cursor
    
        setUndo(bview, Undo::EDIT,
-               selection.start.par(),
-               selection.end.par()->next()); 
+               selection.start.par(), selection.end.par()->next()); 
        freezeUndo();
        cursor = selection.start;
        while (cursor.par() != selection.end.par() ||
-              (cursor.pos() < selection.end.pos())) {
+              (cursor.pos() < selection.end.pos()))
+       {
                if (cursor.pos() < cursor.par()->size()) {
                        // an open footnote should behave
                        // like a closed one
@@ -726,7 +728,7 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
        clearSelection();
        setSelection(bview);
        setCursor(bview, tmpcursor.par(), tmpcursor.pos(), true,
-                 tmpcursor.boundary());
+                 tmpcursor.boundary());
 }