]> git.lyx.org Git - lyx.git/blobdiff - src/text2.C
More 'standard conformant blurb' nonsense.
[lyx.git] / src / text2.C
index 74219602a026f552d43cce3cc19c84845c65276e..e2ae52d49394c18648f6a4b8a1e51a190f2f36b4 100644 (file)
@@ -59,16 +59,13 @@ using std::pair;
 using lyx::pos_type;
 
 
-LyXText::LyXText(BufferView * bv)
+LyXText::LyXText(BufferView * bv, InsetText * inset, bool ininset,
+         ParagraphList & paragraphs)
        : height(0), width(0), anchor_y_(0),
-         inset_owner(0), the_locking_inset(0), bv_owner(bv)
-{}
-
-
-LyXText::LyXText(BufferView * bv, InsetText * inset)
-       : height(0), width(0), anchor_y_(0),
-         inset_owner(inset), the_locking_inset(0), bv_owner(bv)
-{}
+         inset_owner(inset), the_locking_inset(0), bv_owner(bv),
+         in_inset_(ininset), paragraphs_(paragraphs)
+{
+}
 
 
 void LyXText::init(BufferView * bview)
@@ -595,7 +592,8 @@ void LyXText::fullRebreak()
 
 void LyXText::metrics(MetricsInfo & mi, Dimension & dim)
 {
-       //lyxerr << "LyXText::metrics: width: " << mi.base.textwidth << endl;
+       //lyxerr << "LyXText::metrics: width: " << mi.base.textwidth
+       //      << " workWidth: " << workWidth() << endl;
        //Assert(mi.base.textwidth);
 
        // rebuild row cache
@@ -1630,11 +1628,10 @@ pos_type LyXText::getColumnNearX(ParagraphList::iterator pit,
 
 void LyXText::setCursorFromCoordinates(int x, int y)
 {
-       //LyXCursor old_cursor = cursor;
+       LyXCursor old_cursor = cursor;
        setCursorFromCoordinates(cursor, x, y);
        setCurrentFont();
-#warning DEPM disabled, otherwise crash when entering new table
-       //deleteEmptyParagraphMechanism(old_cursor);
+       deleteEmptyParagraphMechanism(old_cursor);
 }
 
 
@@ -1945,17 +1942,14 @@ bool LyXText::deleteEmptyParagraphMechanism(LyXCursor const & old_cursor)
 
 ParagraphList & LyXText::ownerParagraphs() const
 {
-       if (inset_owner) {
-               return inset_owner->paragraphs;
-       }
-       return bv_owner->buffer()->paragraphs;
+       return paragraphs_;
 }
 
 
 bool LyXText::isInInset() const
 {
        // Sub-level has non-null bv owner and non-null inset owner.
-       return inset_owner != 0 && bv_owner != 0;
+       return inset_owner != 0;
 }