diff options
author | sgeerken <devnull@localhost> | 2012-06-28 00:01:45 +0200 |
---|---|---|
committer | sgeerken <devnull@localhost> | 2012-06-28 00:01:45 +0200 |
commit | 58490120ea350edce68376db3e111f34a8f48552 (patch) | |
tree | 6cca436543903e140e944d96007155aba074e61a /dw/hyphenator.cc | |
parent | a8b898689f534f8218d707aa4c41292903126b27 (diff) |
Getting rid of the old method ...
Diffstat (limited to 'dw/hyphenator.cc')
-rw-r--r-- | dw/hyphenator.cc | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/dw/hyphenator.cc b/dw/hyphenator.cc index f6f85009..d9c43e5e 100644 --- a/dw/hyphenator.cc +++ b/dw/hyphenator.cc @@ -127,16 +127,13 @@ bool Hyphenator::isHyphenationCandidate (const char *word) } /** - * Given a word, returns a list of pieces, broken at the possible - * hyphenation points. + * Given a word, returns a list of the possible hyphenation points. */ -Vector <String> *Hyphenator::_hyphenateWord(const char *word) +int *Hyphenator::hyphenateWord(const char *word, int *numBreaks) { - Vector <String> *pieces = new Vector <String> (1, true); - if (!isHyphenationCandidate (word)) { - pieces->put (new String (word)); - return pieces; + *numBreaks = 0; + return NULL; } // If the word is an exception, get the stored points. @@ -186,6 +183,7 @@ Vector <String> *Hyphenator::_hyphenateWord(const char *word) points.put (new Integer (0), points.size () - 3); // Examine the points to build the pieces list. + Vector <String> *pieces = new Vector <String> (1, true); char temp[strlen (word) + 1], *ptemp = temp; int n = lout::misc::min ((int)strlen (word), points.size () - 2); @@ -203,13 +201,7 @@ Vector <String> *Hyphenator::_hyphenateWord(const char *word) *ptemp = 0; pieces->put (new String (temp)); - - return pieces; -} -int *Hyphenator::hyphenateWord(const char *word, int *numBreaks) -{ - Vector <String> *pieces = _hyphenateWord (word); *numBreaks = pieces->size () - 1; int *breakPos; if (numBreaks == 0) |