Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


こんにちは。田中です。

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

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 info@tanaka-cs.co.jp
     http://tanaka-cs.co.jp

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

--
Unsubscribe instructions: E-mail to discuss+unsubscribe@ja.libreoffice.org
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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.