summaryrefslogtreecommitdiffstats
path: root/scribus/text
diff options
context:
space:
mode:
Diffstat (limited to 'scribus/text')
-rw-r--r--scribus/text/storytext.cpp14
-rw-r--r--scribus/text/storytext.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/scribus/text/storytext.cpp b/scribus/text/storytext.cpp
index 531744a..d85eee5 100644
--- a/scribus/text/storytext.cpp
+++ b/scribus/text/storytext.cpp
@@ -1154,6 +1154,20 @@ int StoryText::prevWord(int pos)
--pos;
return wordBoundaries.indexOf(text(pos)) < 0 ? pos + 1 : pos;
}
+
+int StoryText::endOfWord(int pos) const
+{
+ int len = length();
+ while (pos < len)
+ {
+ if(text(pos).isLetter())
+ ++pos;
+ else
+ break;
+ }
+ return pos;
+}
+
int StoryText::nextSentence(int pos)
{
int len = length();
diff --git a/scribus/text/storytext.h b/scribus/text/storytext.h
index 381e96c..b7757be 100644
--- a/scribus/text/storytext.h
+++ b/scribus/text/storytext.h
@@ -202,6 +202,7 @@ class SCRIBUS_API StoryText : public QObject, public SaxIO
int prevChar(int pos);
int nextWord(int pos);
int prevWord(int pos);
+ int endOfWord(int pos) const;
int nextSentence(int pos);
int prevSentence(int pos);
int nextParagraph(int pos);