remove commented code and reindent

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6393 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-03-08 15:58:28 +00:00
parent 16b018a136
commit 65f548906a
2 changed files with 123 additions and 166 deletions

View File

@ -1,3 +1,7 @@
2003-03-08 Lars Gullik Bjønnes <larsbj@gullik.net>
* CutAndPaste.C: remove commented code and reindent.
2003-03-08 John Levon <levon@movementarian.org>
* lyxfunc.h:

View File

@ -191,9 +191,7 @@ bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
Paragraph * newpar = new Paragraph(*tmppar, false);
// reset change info
newpar->cleanChanges();
#if 1
newpar->setInsetOwner(0);
#endif
paragraphs.push_back(newpar);
tmppar = tmppar->next();
@ -211,14 +209,6 @@ bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
while (back.size() > tmpi2) {
back.erase(back.size() - 1);
}
#if 0
// this paragraph's are of noone's owner!
ParagraphList::iterator it = paragraphs.begin();
ParagraphList::iterator end = paragraphs.end();
for (; it != end; ++it)
it->setInsetOwner(0);
#endif
}
return true;
}
@ -233,42 +223,6 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
if (pos > (*par)->size())
pos = (*par)->size();
#if 0
// Paragraph * tmpbuf;
Paragraph * tmppar = *par;
int tmppos = pos;
// There are two cases: cutbuffer only one paragraph or many
if (!buf->next()) {
// only within a paragraph
Paragraph * tmpbuf = new Paragraph(*buf, false);
// Some provisions should be done here for checking
// if we are inserting at the beginning of a
// paragraph. If there are a space at the beginning
// of the text to insert and we are inserting at
// the beginning of the paragraph the space should
// be removed.
while (buf->size()) {
// This is an attempt to fix the
// "never insert a space at the
// beginning of a paragraph" problem.
if (!tmppos && buf->isLineSeparator(0)) {
buf->erase(0);
} else {
buf->cutIntoMinibuffer(current_view->buffer()->params, 0);
buf->erase(0);
if (tmppar->insertFromMinibuffer(tmppos))
++tmppos;
}
}
delete buf;
buf = tmpbuf;
*endpar = tmppar->next();
pos = tmppos;
} else
#endif
{
// many paragraphs
// make a copy of the simple cut_buffer
@ -324,8 +278,7 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
tmpbuf->setInsetOwner((*par)->inInset());
for (pos_type i = 0; i < tmpbuf->size(); ++i) {
if (tmpbuf->getChar(i) == Paragraph::META_INSET) {
if (!(*par)->insetAllowed(tmpbuf->getInset(i)->lyxCode()))
{
if (!(*par)->insetAllowed(tmpbuf->getInset(i)->lyxCode())) {
tmpbuf->erase(i--);
}
} else {
@ -340,6 +293,7 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
}
tmpbuf = tmpbuf->next();
}
// now reset it to 0
paragraphs.begin()->previous(0);
@ -396,7 +350,6 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
}
// restore the simple cut buffer
paragraphs = simple_cut_clone;
}
return true;
}