Token deleteNext/deletePrevious parameters

This commit is contained in:
Daniel Marjamäki 2019-07-13 15:47:53 +02:00
parent bf9edc00c2
commit cff462c6ef
2 changed files with 10 additions and 10 deletions

View File

@ -220,9 +220,9 @@ std::string Token::strValue() const
return ret;
}
void Token::deleteNext(unsigned long index)
void Token::deleteNext(int count)
{
while (mNext && index) {
while (mNext && count > 0) {
Token *n = mNext;
// #8154 we are about to be unknown -> destroy the link to us
@ -231,7 +231,7 @@ void Token::deleteNext(unsigned long index)
mNext = n->next();
delete n;
--index;
--count;
}
if (mNext)
@ -240,9 +240,9 @@ void Token::deleteNext(unsigned long index)
mTokensFrontBack->back = this;
}
void Token::deletePrevious(unsigned long index)
void Token::deletePrevious(int count)
{
while (mPrevious && index) {
while (mPrevious && count > 0) {
Token *p = mPrevious;
// #8154 we are about to be unknown -> destroy the link to us
@ -251,7 +251,7 @@ void Token::deletePrevious(unsigned long index)
mPrevious = p->previous();
delete p;
--index;
--count;
}
if (mPrevious)

View File

@ -185,14 +185,14 @@ public:
}
/**
* Unlink and delete the next 'index' tokens.
* Unlink and delete the next 'count' tokens.
*/
void deleteNext(unsigned long index = 1);
void deleteNext(int count = 1);
/**
* Unlink and delete the previous 'index' tokens.
* Unlink and delete the previous 'count' tokens.
*/
void deletePrevious(unsigned long index = 1);
void deletePrevious(int count = 1);
/**
* Swap the contents of this token with the next token.