diff options
| author | jghali <jghali@11d20701-8431-0410-a711-e3c959e3b870> | 2012-07-03 21:45:33 +0000 |
|---|---|---|
| committer | jghali <jghali@11d20701-8431-0410-a711-e3c959e3b870> | 2012-07-03 21:45:33 +0000 |
| commit | 276f258e5dfbe286db4cc4b48c6bc82d6b96a0d0 (patch) | |
| tree | 582d8596e632f1f178fe05589beb6909153ddc01 /scribus/text/storytext.cpp | |
| parent | a54210afd8b14ce32a77fce552aa6201d0173f8e (diff) | |
| download | scribus-276f258e5dfbe286db4cc4b48c6bc82d6b96a0d0.tar.gz scribus-276f258e5dfbe286db4cc4b48c6bc82d6b96a0d0.tar.xz scribus-276f258e5dfbe286db4cc4b48c6bc82d6b96a0d0.zip | |
#9110: Non-breakable spaces export as underscores
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17673 11d20701-8431-0410-a711-e3c959e3b870
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); |
