Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 23983 → Rev 23984

/trunk/Scribus/scribus/text/storytext.cpp
473,7 → 473,7
void StoryText::insert(int pos, const StoryText& other, bool onlySelection)
{
if (pos < 0)
pos += length()+1;
pos += length() + 1;
CharStyle cstyle(charStyle(pos));
ParagraphStyle pstyle(paragraphStyle(pos));
482,6 → 482,8
ParagraphStyle otherDefault(other.defaultStyle());
otherDefault.eraseStyle(defaultStyle());
int oldPos = pos;
int oldLen = length();
int otherStart = onlySelection? other.startOfSelection() : 0;
int otherEnd = onlySelection? other.endOfSelection() : other.length();
int cstyleStart = otherStart;
542,6 → 544,8
applyStyle(pos, other.paragraphStyle(otherEnd-1));
}
}
if ((d->selLast >= d->selFirst) && (d->selFirst <= oldPos) && (oldPos <= d->selLast))
d->selLast += (length() - oldLen);
invalidate(pos, length());
}
 
678,7 → 682,7
void StoryText::insertChars(int pos, const QString& txt, bool applyNeighbourStyle) //, const CharStyle & charstyle)
{
if (pos < 0)
pos += length()+1;
pos += length() + 1;
 
assert(pos >= 0);
assert(pos <= length());
713,6 → 717,8
}
 
d->len = d->count();
if ((d->selLast >= d->selFirst) && (d->selFirst <= pos) && (pos <= d->selLast))
d->selLast += txt.length();
invalidate(pos, pos + txt.length());
}
 
719,7 → 725,7
void StoryText::insertCharsWithSoftHyphens(int pos, const QString& txt, bool applyNeighbourStyle)
{
if (pos < 0)
pos += length()+1;
pos += length() + 1;
 
assert(pos >= 0);
assert(pos <= length());
732,7 → 738,7
ScText clone;
if (applyNeighbourStyle)
{
int referenceChar = qMax(0, qMin(pos, length()-1));
int referenceChar = qMax(0, qMin(pos, length() - 1));
clone.applyCharStyle(charStyle(referenceChar));
clone.setEffects(ScStyle_Default);
}
771,6 → 777,8
}
 
d->len = d->count();
if ((d->selLast >= d->selFirst) && (d->selFirst <= pos) && (pos <= d->selLast))
d->selLast += inserted;
invalidate(pos, pos + inserted);
}