849,13 → 849,14 |
} |
|
|
int StoryText::nrOfParagraph(uint index) const |
uint StoryText::nrOfParagraph(int pos) const |
{ |
int result = 0; |
uint result = 0; |
StoryText* that = const_cast<StoryText *>(this); |
bool lastWasPARSEP = true; |
index = qMin(index, (uint) that->length()); |
for (uint i=0; i < index; ++i) { |
pos = qMin(pos, that->length()); |
for (int i=0; i < pos; ++i) |
{ |
lastWasPARSEP = that->d->at(i)->ch == SpecialChars::PARSEP; |
if (lastWasPARSEP) |
++result; |
868,7 → 869,8 |
uint result = 0; |
StoryText* that = const_cast<StoryText *>(this); |
bool lastWasPARSEP = true; |
for (int i=0; i < length(); ++i) { |
for (int i=0; i < length(); ++i) |
{ |
lastWasPARSEP = that->d->at(i)->ch == SpecialChars::PARSEP; |
if (lastWasPARSEP) |
++result; |
882,7 → 884,8 |
return 0; |
|
StoryText* that = const_cast<StoryText *>(this); |
for (int i=0; i < length(); ++i) { |
for (int i=0; i < length(); ++i) |
{ |
if (that->d->at(i)->ch == SpecialChars::PARSEP && ! --index) |
return i + 1; |
} |
893,7 → 896,8 |
{ |
++index; |
StoryText* that = const_cast<StoryText *>(this); |
for (int i=0; i < length(); ++i) { |
for (int i=0; i < length(); ++i) |
{ |
if (that->d->at(i)->ch == SpecialChars::PARSEP && ! --index) |
return i; |
} |