]> git.lyx.org Git - features.git/commitdiff
fix bug 1815
authorAndré Pönitz <poenitz@gmx.net>
Sun, 17 Jul 2005 14:23:33 +0000 (14:23 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sun, 17 Jul 2005 14:23:33 +0000 (14:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10285 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/insettabular.C
src/insets/insettext.C
src/tabular.C

index 1bdec8e659e9b72251b6c63b047b22aea722c47d..c096b0992390dd64bdcfd5f8ff175b656053df63 100644 (file)
@@ -501,7 +501,6 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
                if (sl == cur.top()) {
                        cmd = FuncRequest(LFUN_FINISHED_RIGHT);
                        cur.undispatched();
-                       resetPos(cur);
                }
                break;
 
@@ -514,7 +513,6 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
                if (sl == cur.top()) {
                        cmd = FuncRequest(LFUN_FINISHED_LEFT);
                        cur.undispatched();
-                       resetPos(cur);
                }
                break;
 
@@ -527,12 +525,10 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
                                cur.idx() = tabular.getCellBelow(cur.idx());
                                cur.pit() = 0;
                                cur.pos() = 0;
-                               resetPos(cur);
                        }
                if (sl == cur.top()) {
                        cmd = FuncRequest(LFUN_FINISHED_DOWN);
                        cur.undispatched();
-                       resetPos(cur);
                }
                break;
 
@@ -545,12 +541,10 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
                                cur.idx() = tabular.getCellAbove(cur.idx());
                                cur.pit() = cur.lastpit();
                                cur.pos() = cur.lastpos();
-                               resetPos(cur);
                        }
                if (sl == cur.top()) {
                        cmd = FuncRequest(LFUN_FINISHED_UP);
                        cur.undispatched();
-                       resetPos(cur);
                }
                break;
 
@@ -567,7 +561,6 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
 //             }
 //             cur.par() = 0;
 //             cur.pos() = 0;
-//             resetPos(cur);
 //             break;
 //     }
 //
@@ -587,7 +580,6 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
 //             }
 //             cur.par() = cur.lastpar();
 //             cur.pos() = cur.lastpos();
-//             resetPos(cur);
 //             break;
 //     }
 
@@ -772,10 +764,10 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
        default:
                // we try to handle this event in the insets dispatch function.
                cell(cur.idx())->dispatch(cur, cmd);
-               resetPos(cur);
                break;
        }
 
+       resetPos(cur);
        InsetTabularMailer(*this).updateDialog(&cur.bv());
 }
 
index 97cb7096990a41370732c32c09d853d21a2f7c8d..cf1b64320f8cad283ff8dff46f42e122002224e4 100644 (file)
@@ -190,16 +190,19 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
        // update our idea of where we are
        setPosCache(pi, x, y);
 
-       //BufferView * bv = pi.base.bv;
-       ////bv->hideCursor();
-
        text_.draw(pi, x + border_, y);
 
        if (drawFrame_) {
                int const w = text_.width() + 2 * border_;
                int const a = text_.ascent() + border_;
                int const h = a + text_.descent() + border_;
-               pi.pain.rectangle(x, y - a, w, h, frameColor());
+               int const ww = pi.base.bv->workWidth();
+               if (w > ww - 40)  {
+                       pi.pain.line(0, y - a, ww, y - a, frameColor());
+                       pi.pain.line(0, y - a + h, ww, y - a + h, frameColor());
+               } else {
+                       pi.pain.rectangle(x, y - a, w, h, frameColor());
+               }
        }
 }
 
index bde0dc4f78c869bdd83e536433e7396925e72308..c0c2e9a8a0f9659d826d330a136891ec2b85fc4d 100644 (file)
@@ -800,7 +800,7 @@ void LyXTabular::recalculateMulticolumnsOfColumn(col_type column)
        // always will have the whole rest of the width of the cell.
        if (column > (columns_ - 2))
                return;
-       for(row_type row = 0; row < rows_; ++row) {
+       for (row_type row = 0; row < rows_; ++row) {
                int mc = cell_info[row][column].multicolumn;
                int nmc = cell_info[row][column+1].multicolumn;
                // we only have to update multicolumns which do not have this