]> git.lyx.org Git - features.git/commitdiff
more 'value' semantics for paragraphs
authorAndré Pönitz <poenitz@gmx.net>
Thu, 18 Mar 2004 16:12:51 +0000 (16:12 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 18 Mar 2004 16:12:51 +0000 (16:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8504 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/cursor.C
src/lyxfind.C
src/lyxfunc.C
src/paragraph.C
src/undo.C

index f706a06d6c06d2ab0073fef857aa2c9d0b6cbaf0..58f1d633ad29fea8604efcfcd2f570d1439ef153 100644 (file)
@@ -933,7 +933,7 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd0)
 
 bool BufferView::Pimpl::dispatch(FuncRequest const & cmd)
 {
-       //lyxerr << "*** BufferView::Pimpl: request: " << cmd << std::endl;
+       //lyxerr << "BufferView::Pimpl::dispatch  cmd: " << cmd << std::endl;
        // Make sure that the cached BufferView is correct.
        lyxerr[Debug::ACTION] << "BufferView::Pimpl::Dispatch:"
                << " action[" << cmd.action << ']'
index 3049ea89d552dcdd1c6fbec01656dbebc124fd06..3f209657a186cba2a642aed28e03ac4e9e35605c 100644 (file)
@@ -118,7 +118,7 @@ DispatchResult LCursor::dispatch(FuncRequest const & cmd0)
        LCursor safe = *this;
 
        for ( ; size(); pop()) {
-               lyxerr << "\nLCursor::dispatch: cmd: " << cmd0 << endl << *this << endl;
+               //lyxerr << "\nLCursor::dispatch: cmd: " << cmd0 << endl << *this << endl;
                BOOST_ASSERT(pos() <= lastpos());
                BOOST_ASSERT(idx() <= lastidx());
                BOOST_ASSERT(par() <= lastpar());
index 6613798d87741e9584c0df4eb827b3240aa93bc5..66b4849de103671d23105b148c0bb147a2c0aba8 100644 (file)
@@ -112,6 +112,8 @@ void find(BufferView * bv, FuncRequest const & ev)
        if (!bv || ev.action != LFUN_WORD_FIND)
                return;
 
+       lyxerr << "find called, cmd: " << ev << std::endl;
+
        // data is of the form
        // "<search>
        //  <casesensitive> <matchword> <forward>"
index 3a4545e67be54d866cf5fdc3798b435eee41e098..2394391649eb3a0f02a077d5674a4ce482aca910 100644 (file)
@@ -577,8 +577,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose)
                        if (!argument.empty()) {
                                last_search = argument;
                                searched_string = argument;
-                       } else
+                       } else {
                                searched_string = last_search;
+                       }
 
                        if (searched_string.empty())
                                break;
index 71df78078a54f9dde82c74f4ed438d2f6de090e4..2be105b73b34677e7989a48cd9562a8ee61985fd 100644 (file)
@@ -74,16 +74,12 @@ Paragraph::Paragraph()
 
 
 Paragraph::Paragraph(Paragraph const & par)
-       : y(0), height(0), text_(par.text_), begin_of_body_(par.begin_of_body_),
+       :       itemdepth(par.itemdepth), insetlist(par.insetlist),
+               rows(par.rows), y(par.y), height(par.height),
+               width(par.width), layout_(par.layout_),
+               text_(par.text_), begin_of_body_(par.begin_of_body_),
          pimpl_(new Paragraph::Pimpl(*par.pimpl_, this))
 {
-       itemdepth = 0;
-       // this is because of the dummy layout of the paragraphs that
-       // follow footnotes
-       layout_ = par.layout();
-
-       // copy everything behind the break-position to the new paragraph
-       insetlist = par.insetlist;
        InsetList::iterator it = insetlist.begin();
        InsetList::iterator end = insetlist.end();
        for (; it != end; ++it)
@@ -99,22 +95,24 @@ void Paragraph::operator=(Paragraph const & par)
 
        lyxerr << "Paragraph::operator=()" << endl;
 
-       text_ = par.text_;
-
-       delete pimpl_;
-       pimpl_ = new Pimpl(*par.pimpl_, this);
-
        itemdepth = par.itemdepth;
-       // this is because of the dummy layout of the paragraphs that
-       // follow footnotes
-       layout_ = par.layout();
 
-       // copy everything behind the break-position to the new paragraph
        insetlist = par.insetlist;
        InsetList::iterator it = insetlist.begin();
        InsetList::iterator end = insetlist.end();
        for (; it != end; ++it)
                it->inset = it->inset->clone().release();
+
+       rows = par.rows;
+       y = par.y;
+       height = par.height;
+       width = par.width;
+       layout_ = par.layout();
+       text_ = par.text_;
+       begin_of_body_ = par.begin_of_body_;
+
+       delete pimpl_;
+       pimpl_ = new Pimpl(*par.pimpl_, this);
 }
 
 
index ab798f3dfe8d32c6d60eedb02da7bef9a09f4310..24c1f39a3dc5e60ecc03576dbf2126c5984aefe0 100644 (file)
@@ -214,9 +214,9 @@ void recordUndo(Undo::undo_kind kind,
        Buffer * buf = cur.bv().buffer();
        recordUndo(kind, cur, first, last, buf->undostack());
        buf->redostack().clear();
-       //lyxerr << "undostack:\n";
-       //for (size_t i = 0, n = buf->undostack().size(); i != n && i < 6; ++i)
-       //      lyxerr << "  " << i << ": " << buf->undostack()[i] << std::endl;
+       lyxerr << "undostack:\n";
+       for (size_t i = 0, n = buf->undostack().size(); i != n && i < 6; ++i)
+               lyxerr << "  " << i << ": " << buf->undostack()[i] << std::endl;
 }