]> git.lyx.org Git - features.git/commitdiff
Fixed the display bug for text-insets we still had and now ERT-insets do
authorJürgen Vigna <jug@sad.it>
Thu, 2 Mar 2000 18:30:01 +0000 (18:30 +0000)
committerJürgen Vigna <jug@sad.it>
Thu, 2 Mar 2000 18:30:01 +0000 (18:30 +0000)
break on LyX-Window width as the rest of the text does.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@583 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/insets/inset.C
src/insets/insetert.C
src/insets/insettext.C
src/insets/insettext.h
src/insets/lyxinset.h

index f1b17ae886bf1c7974381da667d01388c96d1409..0c3ecbe56564bcfafe1a7d69876e4fd6da366e1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-03-03  Juergen Vigna  <jug@sad.it>
+
+       * src/insets/insetert.C (InsetERT): Now ERT-insets break row
+       automatically with the width of the LyX-Window
+
+       * src/insets/insettext.C (computeTextRows): fixed update bug in
+       displaying text-insets (scrollvalues where not initialized!)
+
 2000-03-02  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * src/mathed/math_utils.C (MathedLookupBOP): using only res->id ==
index dc81e399acffa845959f46d77c44bc60d967fae0..02b733c9a76b7461824fde8fa946a2175eeaf508 100644 (file)
@@ -112,7 +112,7 @@ void UpdatableInset::Edit(BufferView * bv, int, int, unsigned int)
 {
     LyXFont
        font;
-//    bview = bv;
+
     scx = 0;
 
     mx_scx=abs((width(bv->getPainter(), font) - bv->paperWidth())/2);
index 386dbd26adb247dc16e53b086854fd032ca82cdf..698ff3435a7db3e7316029e8553a783aea28c186 100644 (file)
@@ -25,6 +25,7 @@ InsetERT::InsetERT(Buffer * bf)
 {
        closed = true;
        nomotion = false;
+       autoBreakRows = true;
 }
 
 
index 38d2cf1f21a467d4ddc9f673df2758e7655af64f..082e2e10481749f1594453d574c89041e56b27e8 100644 (file)
@@ -63,6 +63,8 @@ InsetText::InsetText(Buffer * buf)
     interline_space = 1;
     no_selection = false;
     init_inset = true;
+    maxAscent = maxDescent = insetWidth = 0;
+    autoBreakRows = false;
 }
 
 
@@ -77,6 +79,8 @@ InsetText::InsetText(InsetText const & ins, Buffer * buf)
     interline_space = 1;
     no_selection = false;
     init_inset = true;
+    maxAscent = maxDescent = insetWidth = 0;
+    autoBreakRows = false;
 }
 
 
@@ -1068,7 +1072,7 @@ void InsetText::computeTextRows(Painter & pain) const
     row.pos      = 0;
     row.baseline = 0;
     rows.push_back(row);
-    if (maxWidth < 0) {
+    if (!autoBreakRows) {
        for(p = 0; p < par->Last(); ++p) {
            insetWidth += SingleWidth(pain, par, p);
            SingleHeight(pain, par, p, asc, desc);
@@ -1084,11 +1088,13 @@ void InsetText::computeTextRows(Painter & pain) const
        rows.push_back(row);
        return;
     }
+
     bool is_first_word_in_row = true;
 
     int cw,
        lastWordWidth = 0;
 
+    maxWidth = buffer->getUser()->paperWidth();
     for(p = 0; p < par->Last(); ++p) {
        cw = SingleWidth(pain, par, p);
        width += cw;
index b1b1ae94dd81e2a9c50844b23df02aa8df0937fd..f3bfbd8629fe844bd508199165f7da2b977e1bd2 100644 (file)
@@ -129,13 +129,15 @@ protected:
     ///
     LyXFont real_current_font;
     ///
-    int maxWidth;
+    mutable int maxWidth;
     ///
     mutable int maxAscent;
     ///
     mutable int maxDescent;
     ///
     mutable int insetWidth;
+    ///
+    bool autoBreakRows;
 
 private:
     ///
index 5c3b3ee9083810f42ee3a6825c5bc30d63260b56..9bcc94243c342a7cc0236affb641d4d95f92e1df 100644 (file)
@@ -206,6 +206,8 @@ public:
                return (b) ? DISPATCHED: FINISHED;
        }
 
+       ///
+       UpdatableInset() { scx = mx_scx = 0; }
        ///
        //virtual ~UpdatableInset() {}
        ///