To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=57866
User tl changed the following:
What |Old value |New value
================================================================================
Assigned to|tl |khong
--------------------------------------------------------------------------------
Summary|Wrong line break (brackets|Wrong line break (brackets
|and non-breaking spaces) |and non-breaking spaces)
|when auto hyphenation is |when auto hyphenation is
|ON |ON
--------------------------------------------------------------------------------
------- Additional comments from [EMAIL PROTECTED] Mon Nov 14 04:25:54 -0800
2005 -------
tl->khong: I've debugged the i18npool code for getLineBreak a bit:
+ LineBreakResults lbr;
+
+ loadICUBreakIterator(rLocale, LOAD_LINE_BREAKITERATOR, 0, "line",
Text);
+
+ if (aBreakIterator->isBoundary(nStartPos)) { //Line boundary break
+ lbr.breakIndex = nStartPos;
+ lbr.breakType = BreakType::WORDBOUNDARY;
+ } else if (hOptions.rHyphenator.is()) { //Hyphenation break
+ <a> Boundary wBoundary = getWordBoundary( Text, nStartPos, rLocale,
+ WordType::DICTIONARY_WORD, false);
+ Reference< linguistic2::XHyphenatedWord > aHyphenatedWord;
+ aHyphenatedWord =
hOptions.rHyphenator->hyphenate(Text.copy(wBoundary.startPos,
+ wBoundary.endPos - wBoundary.startPos), rLocale,
+ (sal_Int16) (hOptions.hyphenIndex - wBoundary.startPos),
hOptions.aHyphenationOptions);
+ if (aHyphenatedWord.is()) {
+ lbr.rHyphenatedWord = aHyphenatedWord;
+ if(wBoundary.startPos + aHyphenatedWord->getHyphenationPos() +
1 < nMinBreakPos )
+ lbr.breakIndex = -1;
+ else
+ lbr.breakIndex = wBoundary.startPos;
//aHyphenatedWord->getHyphenationPos();
+ <b> lbr.breakType = BreakType::HYPHENATION;
+ } else {
+ <1> lbr.breakIndex = aBreakIterator->preceding(nStartPos);
+ lbr.breakType = BreakType::WORDBOUNDARY;;
+ }
+ } else { //word boundary break
+ <2> lbr.breakIndex = aBreakIterator->preceding(nStartPos);
+ lbr.breakType = BreakType::WORDBOUNDARY;
+ }
+
+ return lbr;
+
When "automatic hyphenation" is disabled the code runs into <2> and when it is
enabled it runs into <1>. However even if 'nStartPos' has the same value the
result is different!
It seems the code between <a> and <b> somehow effects the state of the
breakiterator leading to a different result.
Also FME said that 'aBreakIterator->preceding(nStartPos)' is implemented as a
cache and he thinks at some time he has seen it to not always return the same
value...
Either way it looks like a problem of the ICU breakiterator.
Please have a look thanks!
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]