* tabs are evil

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22273 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stefan Schimanski 2007-12-23 01:27:04 +00:00
parent 3308ebfbf6
commit 926befadd8

View File

@ -561,15 +561,15 @@ bool MathMacroTemplate::notifyCursorLeaves(Cursor & cur)
void MathMacroTemplate::removeArguments(Cursor & cur, int from, int to) { void MathMacroTemplate::removeArguments(Cursor & cur, int from, int to) {
for (DocIterator it = doc_iterator_begin(*this); it; it.forwardChar()) { for (DocIterator it = doc_iterator_begin(*this); it; it.forwardChar()) {
if (!it.nextInset()) if (!it.nextInset())
continue; continue;
if (it.nextInset()->lyxCode() != MATHMACROARG_CODE) if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
continue; continue;
MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset()); MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset());
int n = arg->number() - 1; int n = arg->number() - 1;
if (from <= n && n <= to) { if (from <= n && n <= to) {
int cellSlice = cur.find(it.cell()); int cellSlice = cur.find(it.cell());
if (cellSlice != -1 && cur[cellSlice].pos() > it.pos()) if (cellSlice != -1 && cur[cellSlice].pos() > it.pos())
--cur[cellSlice].pos(); --cur[cellSlice].pos();
it.cell().erase(it.pos()); it.cell().erase(it.pos());
} }
@ -582,9 +582,9 @@ void MathMacroTemplate::removeArguments(Cursor & cur, int from, int to) {
void MathMacroTemplate::shiftArguments(size_t from, int by) { void MathMacroTemplate::shiftArguments(size_t from, int by) {
for (DocIterator it = doc_iterator_begin(*this); it; it.forwardChar()) { for (DocIterator it = doc_iterator_begin(*this); it; it.forwardChar()) {
if (!it.nextInset()) if (!it.nextInset())
continue; continue;
if (it.nextInset()->lyxCode() != MATHMACROARG_CODE) if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
continue; continue;
MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset()); MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset());
if (arg->number() >= from + 1) if (arg->number() >= from + 1)
arg->setNumber(arg->number() + by); arg->setNumber(arg->number() + by);