]> git.lyx.org Git - features.git/commitdiff
Small fixes (to earlier fixes ;)
authorJürgen Vigna <jug@sad.it>
Mon, 2 Oct 2000 11:50:36 +0000 (11:50 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 2 Oct 2000 11:50:36 +0000 (11:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1068 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
po/POTFILES.in
src/insets/insettabular.C
src/insets/insettext.C
src/screen.C

index a967e591564ad3c882540b0895ded0896be1fa9c..e9d5589d5a93a1b75d43f71e13c70aa99100ed1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-10-02  Juergen Vigna  <jug@sad.it>
+
+       * src/insets/insettext.C (SetFont): better support.
+
+       * src/insets/insettabular.C (draw): fixed drawing of single cell.
+
+       * src/screen.C (DrawOneRow): some uint refixes!
+
 2000-10-02  Allan Rae  <rae@lyx.org>
 
        * boost/.cvsignore: ignore Makefile as well
index f9dcbb6ad1c36da6a59f62d47afdbddad981d5e0..dc947f955bf92bb3dde6fba5dbf6cb5bd3df2edb 100644 (file)
@@ -64,6 +64,19 @@ src/frontends/xforms/FormPrint.C
 src/frontends/xforms/form_print.C
 src/frontends/xforms/FormRef.C
 src/frontends/xforms/form_ref.C
+src/frontends/xforms/forms/form_citation.C
+src/frontends/xforms/forms/form_copyright.C
+src/frontends/xforms/forms/form_document.C
+src/frontends/xforms/forms/form_error.C
+src/frontends/xforms/forms/form_graphics.C
+src/frontends/xforms/forms/form_index.C
+src/frontends/xforms/forms/form_paragraph.C
+src/frontends/xforms/forms/form_preferences.C
+src/frontends/xforms/forms/form_print.C
+src/frontends/xforms/forms/form_ref.C
+src/frontends/xforms/forms/form_tabular.C
+src/frontends/xforms/forms/form_toc.C
+src/frontends/xforms/forms/form_url.C
 src/frontends/xforms/FormTabular.C
 src/frontends/xforms/form_tabular.C
 src/frontends/xforms/FormToc.C
index 8fe7d70f658b9d1cf35b26f1fedef67d6b6209b1..35145299ee3a68097e34d3b8cf9d85057b1bf0bd 100644 (file)
@@ -280,16 +280,18 @@ void InsetTabular::draw(BufferView * bv, LyXFont const & font, int baseline,
     } else if (need_update == CELL) {
        nx = int(x);
        for(i = 0; (cell < actcell) && (i < tabular->rows()); ++i) {
-           nx = int(x);
            for(j = 0; (cell < actcell) && (j < tabular->columns()); ++j) {
                if (tabular->IsPartOfMultiColumn(i, j))
                    continue;
                nx += tabular->GetWidthOfColumn(cell);
                ++cell;
            }
-           baseline += tabular->GetDescentOfRow(i) +
-               tabular->GetAscentOfRow(i + 1) +
-               tabular->GetAdditionalHeight(cell);
+           if (tabular->row_of_cell(cell) > i) {
+               nx = int(x);
+               baseline += tabular->GetDescentOfRow(i) +
+                   tabular->GetAscentOfRow(i + 1) +
+                   tabular->GetAdditionalHeight(cell);
+           }
        }
        if (the_locking_inset == tabular->GetCellInset(cell)) {
            LyXText::text_status st = bv->text->status;
@@ -1019,7 +1021,7 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const
     cursor.pos(0);
        
     actcell = actrow = actcol = 0;
-    unsigned int ly = tabular->GetDescentOfRow(actrow);
+    int ly = tabular->GetDescentOfRow(actrow);
 
     // first search the right row
     while((ly < y) && (actrow < tabular->rows())) {
@@ -1033,7 +1035,7 @@ void InsetTabular::setPos(BufferView * bv, int x, int y) const
     actcell = tabular->GetCellNumber(actrow, actcol);
 
     // now search the right column
-    unsigned int lx = tabular->GetWidthOfColumn(actcell) -
+    int lx = tabular->GetWidthOfColumn(actcell) -
        tabular->GetAdditionalWidth(actcell);
     for(; !tabular->IsLastCellInRow(actcell) && (lx < x);
        ++actcell,lx += tabular->GetWidthOfColumn(actcell) +
index 9040338c6074c632d1d4a652e619be353527d686..bf2221af918dc3afd68d4b240635d110bfc22454 100644 (file)
@@ -273,7 +273,7 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
     if (!cleared && ((need_update==FULL) || (top_x!=int(x)) ||
                     (top_baseline!=baseline))) {
        int w =  insetWidth;
-       unsigned int h = insetAscent + insetDescent;
+       int h = insetAscent + insetDescent;
        int ty = baseline - insetAscent;
        
        if (ty < 0) {
@@ -1225,7 +1225,18 @@ UpdatableInset * InsetText::GetFirstLockingInsetOfType(Inset::Code c)
 
 void InsetText::SetFont(BufferView * bv, LyXFont const & font, bool toggleall)
 {
+    bv->text->SetUndo(bv->buffer(), Undo::EDIT,
+#ifndef NEW_INSETS
+             bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->previous,
+             bv->text->cursor.par()->ParFromPos(bv->text->cursor.pos())->next
+#else
+             bv->text->cursor.par()->previous,
+             bv->text->cursor.par()->next
+#endif
+           );
     TEXT(bv)->SetFont(bv, font, toggleall);
+    bv->fitCursor(TEXT(bv));
+    UpdateLocal(bv, CURSOR_PAR, true);
 }
 
 
index 477dba02798724c8505d9ff8b753a02907fb06c5..8887775dacc908d695b0152be9c8374e91ef07d5 100644 (file)
@@ -125,9 +125,10 @@ void LyXScreen::DrawOneRow(LyXText * text, Row * row, int y_text,
                           int y_offset, int x_offset)
 {
        int y = y_text - text->first + y_offset;
-      
-       if (y + row->height() > 0
-           && y - row->height() <= owner.height()) {
+
+       if (((y+row->height()) > 0) &&
+           ((y-row->height()) <= (int)owner.height()))
+       {
                // ok there is something visible
                LyXText::text_status st = text->status;
                do {
@@ -222,14 +223,14 @@ bool LyXScreen::FitManualCursor(LyXText * text,
   
        if (y + desc - text->first >= owner.height())
                newtop = y - 3 * owner.height() / 4;  // the scroll region must be so big!!
-       else if (y - asc < text->first
+       else if (y - asc < (int)text->first
                && text->first > 0) {
                newtop = y - owner.height() / 4;
        }
 
        newtop = max(newtop, 0); // can newtop ever be < 0? (Lgb)
   
-       if (newtop != text->first) {
+       if (newtop != (int)text->first) {
                Draw(text, newtop);
                text->first = newtop;
                return true;