Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 21732 → Rev 21733

/trunk/Scribus/scribus/text/storytext.cpp
82,7 → 82,6
{
d = other.d;
d->refs++;
m_text = other.m_text;
if (m_doc) {
m_doc->paragraphStyles().connect(this, SLOT(invalidateAll()));
157,7 → 156,6
m_doc = other.m_doc;
d = other.d;
m_text = other.m_text;
if (m_doc) {
m_doc->paragraphStyles().connect(this, SLOT(invalidateAll()));
310,7 → 308,6
 
d->clear();
d->len = 0;
m_text.clear();
invalidateAll();
}
 
553,7 → 550,6
m_selLast = -1;
}
invalidate(pos, length());
m_text.remove(pos, len);
}
 
void StoryText::trim()
610,8 → 606,7
 
for (int i = 0; i < txt.length(); ++i) {
ScText * item = new ScText(clone);
QChar tmpch = txt.at(i);
item->ch = tmpch;
item->ch= txt.at(i);
item->setContext(cStyleContext);
d->insert(pos + i, item);
d->len++;
618,12 → 613,10
if (item->ch == SpecialChars::PARSEP) {
// qDebug() << QString("new PARSEP %2 at %1").arg(pos).arg(paragraphStyle(pos).name());
insertParSep(pos + i);
tmpch = QLatin1Char('\n');
}
if (d->cursorPosition >= static_cast<uint>(pos + i)) {
d->cursorPosition += 1;
}
m_text += tmpch;
}
 
d->len = d->count();
676,14 → 669,10
d->insert(index, item);
d->len++;
if (item->ch == SpecialChars::PARSEP)
{
insertParSep(index);
ch = QLatin1Char('\n');
}
if (d->cursorPosition >= static_cast<uint>(index))
d->cursorPosition += 1;
++inserted;
m_text += ch;
}
}
 
712,9 → 701,6
}
invalidate(pos, pos + 1);
if (ch == SpecialChars::PARSEP)
ch = QLatin1Char('\n');
m_text[pos] = ch;
}
 
int StoryText::replaceWord(int pos, QString newWord)
820,8 → 806,25
 
QString StoryText::plainText() const
{
return m_text;
if (length() <= 0)
return QString();
 
QChar ch;
QString result;
 
int len = length();
result.reserve(len);
 
StoryText* that(const_cast<StoryText*>(this));
for (int i = 0; i < len; ++i) {
ch = that->d->at(i)->ch;
if (ch == SpecialChars::PARSEP)
ch = QLatin1Char('\n');
result += ch;
}
 
return result;
}
#if 0
QChar StoryText::text() const
{
/trunk/Scribus/scribus/text/storytext.h
281,8 → 281,6
ScText * item(uint index);
const ScText * item(uint index) const;
void fixSurrogateSelection();
// storage for plain text
QString m_text;
 
//public:
// ScText * item_p(uint index) { return item(index); }