summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2014-05-29 08:35:07 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-05-30 08:20:32 -0500
commit577582d382a9b66b8f59ecb8cb6b070805a695e9 (patch)
treea7bf7c803d99d0800ad7509d70678cadd3fe489f
parentf58fa2cf44b7fbac85c260919ae902206f69ea7b (diff)
fdo#79372 fix hyphenation (remove fdo#56392 fix, except hard hyphen part)
Change-Id: Ia2f482fb7737e61cfc42966dbc7af6e1cdb3b41d Reviewed-on: https://gerrit.libreoffice.org/9543 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--i18npool/source/breakiterator/breakiterator_unicode.cxx22
1 files changed, 3 insertions, 19 deletions
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index 3bb2e3ef7c54..b2d99d2292ae 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -372,29 +372,13 @@ LineBreakResults SAL_CALL BreakIterator_Unicode::getLineBreak(
if (line.aBreakIterator->preceding(nStartPos + 1) == nStartPos) { //Line boundary break
lbr.breakIndex = nStartPos;
lbr.breakType = BreakType::WORDBOUNDARY;
- } else if (hOptions.rHyphenator.is()) { //Hyphenation break
- sal_Int32 boundary_with_punctuation = (line.aBreakIterator->next() != BreakIterator::DONE) ? line.aBreakIterator->current() : 0;
- line.aBreakIterator->preceding(nStartPos + 1); // reset to check correct hyphenation of "word-word"
-
- sal_Int32 nStartPosWordEnd = nStartPos;
- while (line.aBreakIterator->current() < nStartPosWordEnd && u_ispunct((sal_uInt32)Text[nStartPosWordEnd])) // starting punctuation
- nStartPosWordEnd --;
-
- Boundary wBoundary = getWordBoundary( Text, nStartPosWordEnd, rLocale,
+ } else if (hOptions.rHyphenator.is()) { //Hyphenation break, FIXME: fdo#56392
+ Boundary wBoundary = getWordBoundary( Text, nStartPos, rLocale,
WordType::DICTIONARY_WORD, false);
-
- nStartPosWordEnd = wBoundary.endPos;
- while (nStartPosWordEnd < Text.getLength() && (u_ispunct((sal_uInt32)Text[nStartPosWordEnd]))) // ending punctuation
- nStartPosWordEnd ++;
- nStartPosWordEnd = nStartPosWordEnd - wBoundary.endPos;
- if (hOptions.hyphenIndex - wBoundary.startPos < nStartPosWordEnd) nStartPosWordEnd = hOptions.hyphenIndex - wBoundary.startPos;
-#define SPACE 0x0020
- while (boundary_with_punctuation > wBoundary.endPos && Text[--boundary_with_punctuation] == SPACE);
- if (boundary_with_punctuation != 0) boundary_with_punctuation += 1 - wBoundary.endPos;
uno::Reference< linguistic2::XHyphenatedWord > aHyphenatedWord;
aHyphenatedWord = hOptions.rHyphenator->hyphenate(Text.copy(wBoundary.startPos,
wBoundary.endPos - wBoundary.startPos), rLocale,
- (sal_Int16) (hOptions.hyphenIndex - wBoundary.startPos - nStartPosWordEnd), hOptions.aHyphenationOptions);
+ (sal_Int16) (hOptions.hyphenIndex - wBoundary.startPos), hOptions.aHyphenationOptions);
if (aHyphenatedWord.is()) {
lbr.rHyphenatedWord = aHyphenatedWord;
if(wBoundary.startPos + aHyphenatedWord->getHyphenationPos() + 1 < nMinBreakPos )