mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 06:49:56 +00:00
more 'value' semantics for paragraphs
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8504 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7688a62d7e
commit
7892c861f9
@ -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 << ']'
|
||||
|
@ -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());
|
||||
|
@ -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>"
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user