mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-23 00:38:01 +00:00
duplicated code, ParIterator::operator=
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7002 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6c5a9c421e
commit
81a967c573
@ -1,3 +1,10 @@
|
||||
|
||||
2003-05-22 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* undo_funcs.C: remove duplicated code
|
||||
|
||||
* iterator.[Ch]: operator=
|
||||
|
||||
2003-05-22 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||
|
||||
* tabular.C (SetMultiColumn): ws changes
|
||||
|
@ -88,6 +88,13 @@ ParIterator::ParIterator(ParIterator const & pi)
|
||||
{}
|
||||
|
||||
|
||||
void ParIterator::operator=(ParIterator const & pi)
|
||||
{
|
||||
ParIterator tmp(pi);
|
||||
pimpl_.swap(tmp.pimpl_);
|
||||
}
|
||||
|
||||
|
||||
ParIterator & ParIterator::operator++()
|
||||
{
|
||||
while (!pimpl_->positions.empty()) {
|
||||
|
@ -25,6 +25,8 @@ public:
|
||||
///
|
||||
ParIterator(ParIterator const &);
|
||||
///
|
||||
void operator=(ParIterator const &);
|
||||
///
|
||||
ParIterator & operator++();
|
||||
///
|
||||
ParagraphList::iterator operator*() const;
|
||||
|
@ -123,7 +123,7 @@ bool textHandleUndo(BufferView * bv, Undo & undo)
|
||||
}
|
||||
// this surprisingly fills the undo! (Andre')
|
||||
size_t par = 0;
|
||||
//while (deletepar && deletepar != *behind) {
|
||||
//while (deletepar && deletepar != *behind)
|
||||
while (deletepar != *behind) {
|
||||
deletelist.push_back(&*deletepar);
|
||||
++deletepar;
|
||||
@ -222,46 +222,29 @@ bool textHandleUndo(BufferView * bv, Undo & undo)
|
||||
ParIterator tmppar =
|
||||
bv->buffer()->getParFromID(undo.number_of_cursor_par);
|
||||
|
||||
if (it) {
|
||||
if (tmppar != end) {
|
||||
LyXText * t;
|
||||
Inset * it = tmppar->inInset();
|
||||
if (it) {
|
||||
FuncRequest cmd(bv, LFUN_INSET_EDIT, "left");
|
||||
it->localDispatch(cmd);
|
||||
t = it->getLyXText(bv);
|
||||
} else {
|
||||
t = bv->text;
|
||||
}
|
||||
t->setCursorIntern(*tmppar, undo.cursor_pos);
|
||||
// Clear any selection and set the selection
|
||||
// cursor for an evt. new selection.
|
||||
t->clearSelection();
|
||||
t->selection.cursor = t->cursor;
|
||||
t->updateCounters();
|
||||
bv->fitCursor();
|
||||
if (tmppar != end) {
|
||||
LyXText * t;
|
||||
Inset * it = tmppar->inInset();
|
||||
if (it) {
|
||||
FuncRequest cmd(bv, LFUN_INSET_EDIT, "left");
|
||||
it->localDispatch(cmd);
|
||||
t = it->getLyXText(bv);
|
||||
} else {
|
||||
t = bv->text;
|
||||
}
|
||||
t->setCursorIntern(*tmppar, undo.cursor_pos);
|
||||
// Clear any selection and set the selection
|
||||
// cursor for an evt. new selection.
|
||||
t->clearSelection();
|
||||
t->selection.cursor = t->cursor;
|
||||
t->updateCounters();
|
||||
}
|
||||
|
||||
if (it) {
|
||||
bv->fitCursor();
|
||||
bv->updateInset(it);
|
||||
bv->text->setCursorIntern(bv->text->cursor.par(),
|
||||
bv->text->cursor.pos());
|
||||
} else {
|
||||
if (tmppar != end) {
|
||||
LyXText * t;
|
||||
Inset * it = tmppar->inInset();
|
||||
if (it) {
|
||||
FuncRequest cmd(bv, LFUN_INSET_EDIT, "left");
|
||||
it->localDispatch(cmd);
|
||||
t = it->getLyXText(bv);
|
||||
} else {
|
||||
t = bv->text;
|
||||
}
|
||||
t->setCursorIntern(*tmppar, undo.cursor_pos);
|
||||
// Clear any selection and set the selection
|
||||
// cursor for an evt. new selection.
|
||||
t->clearSelection();
|
||||
t->selection.cursor = t->cursor;
|
||||
t->updateCounters();
|
||||
}
|
||||
}
|
||||
|
||||
// And here it's safe enough to delete all removed paragraphs.
|
||||
|
Loading…
x
Reference in New Issue
Block a user