こんにちは。田中です。

ループの中で使っている箇所は他にもありました。

bool SwTxtNode::CountWords( SwDocStat& rStat,
                             sal_Int32 nStt, sal_Int32 nEnd ) const
の中です。こちらも無限ループになりうるような気がしていますが、
まだ再現方法を見つけていません。

i18nを修正すべき、という考え方もできますが、
言語毎?にルールを徹底するより、この2箇所で吸収した方が良い気がしています。

ご意見など有りましたら、頂きたいと思います。

以上、よろしくお願いします。



On 2014年12月14日 21:24, TANAKA Hidemune wrote:
こ んにちは。田中です。

http://ask.libreoffice.org/ja/question/41898/writerwinban-gahurizusuru/

Win版のWiterで、フリーズする問題に対処しました。
以下のパッチの通りです。

ループの箇所で無限ループに陥っていたので、
カーソル位置が変わっていなかったら抜けるようにしました。
環境によっては無駄な処理ですが、i18nの実装に依存せず、文脈的にも正しい と 思います。

これはbugzillaに起票されている不具合でしょうか?
パッチの投げ方がまだ分かっていません。
すみませんがご教示願います。


diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx
index bf468b9..55f3dec 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -191,8 +191,11 @@ sal_Int32 SwBreakIt::getGraphemeCount(const OUString& rText,
         else
         {
             sal_Int32 nCount2 = 1;
+            sal_Int32 nPosOld = nCurPos;
nCurPos = xBreak->nextCharacters(rText, nCurPos, lang::Locale(), i18n::CharacterIteratorMode::SKIPCELL, nCount2, nCount2);
+            if (nPosOld == nCurPos)
+                break;
         }
         ++nGraphemeCount;
     }




--
■□■□■□■□■□■□■□■□■□■□■□■

 株式会社 田中コンピューターサービス

    代表取締役 田中 秀宗
          TANAKA Hidemune

 本 社 東京都北区滝野川7丁目45番14号
 電 話 03-3576-7272
 FAX 03-3576-7272
 携 帯 090-6187-1418
 E-Mail [email protected]
     http://tanaka-cs.co.jp

■□■□■□■□■□■□■□■□■□■□■□■

--
Unsubscribe instructions: E-mail to [email protected]
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/ja/discuss/
All messages sent to this list will be publicly archived and cannot be deleted

メールによる返信