diff options
Diffstat (limited to 'scribus/text/storytext.cpp')
| -rw-r--r-- | scribus/text/storytext.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scribus/text/storytext.cpp b/scribus/text/storytext.cpp index 76285a9..062015a 100644 --- a/scribus/text/storytext.cpp +++ b/scribus/text/storytext.cpp @@ -637,6 +637,28 @@ int StoryText::length() const return d->len; } +QString StoryText::plainText() const +{ + if (length() <= 0) + return QString(); + + QChar ch; + QString result; + + uint 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; +} + QChar StoryText::text() const { return text(d->cursorPosition); |
