diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-05-20 23:51:08 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-05-25 14:54:59 +0000 |
commit | d472b00b2ae5a65b5088f2cf4ffc7c326287392e (patch) | |
tree | e7a022761c43eabd0d3a48d04453e41b9b203adb | |
parent | f7f24221d84415f15257385c9136b85d7c071150 (diff) |
Lightproof: do not return invalid nBehindEndOfSentencePosition
For a paragraph with a space at the end, this assertion is triggered:
linguistic/source/gciterator.cxx:162: lcl_SkipWhiteSpaces: illegal
arguments
Cause is the loop in doProofReading that gets the last character of the
paragraph and increments nStartOfNextSentencePosition even if it's
already at end of the text.
(regression from 080424980483bcc29a3556cf1a681c45cd5c50fc)
Reviewed-on: https://gerrit.libreoffice.org/15834
Reviewed-by: László Németh <nemeth@numbertext.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 8952e8055690417e60d75e4e4adf3c85a1029e7c)
Lightproof: do not return invalid nBehindEndOfSentencePosition
Copy bugfix to localized Lightproof.py
(cherry picked from commit cdb3172a438c7c56c4700edf7d771ede5cdf3402)
Change-Id: I58bd10d168f75f9d365cb33c0ade770750ff57ef
(cherry picked from commit 6fd73ad03417565305084524cf32cea089e83e87)
Reviewed-on: https://gerrit.libreoffice.org/15862
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | en/Lightproof.py | 2 | ||||
-rw-r--r-- | hu_HU/Lightproof.py | 2 | ||||
-rw-r--r-- | pt_BR/Lightproof.py | 2 | ||||
-rw-r--r-- | ru_RU/Lightproof.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/en/Lightproof.py b/en/Lightproof.py index e7cde2f..3003810 100644 --- a/en/Lightproof.py +++ b/en/Lightproof.py @@ -121,7 +121,7 @@ class Lightproof( unohelper.Base, XProofreader, XServiceInfo, XServiceName, XSer if 'PYUNO_LOGLEVEL' in os.environ: print(traceback.format_exc()) - l = rText[nSuggestedSentenceEndPos:nSuggestedSentenceEndPos+1] + l = rText[aRes.nStartOfNextSentencePosition:aRes.nStartOfNextSentencePosition+1] while l == " ": aRes.nStartOfNextSentencePosition = aRes.nStartOfNextSentencePosition + 1 l = rText[aRes.nStartOfNextSentencePosition:aRes.nStartOfNextSentencePosition+1] diff --git a/hu_HU/Lightproof.py b/hu_HU/Lightproof.py index e5936b8..daeddeb 100644 --- a/hu_HU/Lightproof.py +++ b/hu_HU/Lightproof.py @@ -122,7 +122,7 @@ class Lightproof( unohelper.Base, XProofreader, XServiceInfo, XServiceName, XSer if 'PYUNO_LOGLEVEL' in os.environ: print(traceback.format_exc()) - l = rText[nSuggestedSentenceEndPos:nSuggestedSentenceEndPos+1] + l = rText[aRes.nStartOfNextSentencePosition:aRes.nStartOfNextSentencePosition+1] while l == " ": aRes.nStartOfNextSentencePosition = aRes.nStartOfNextSentencePosition + 1 l = rText[aRes.nStartOfNextSentencePosition:aRes.nStartOfNextSentencePosition+1] diff --git a/pt_BR/Lightproof.py b/pt_BR/Lightproof.py index 44f6934..8064fee 100644 --- a/pt_BR/Lightproof.py +++ b/pt_BR/Lightproof.py @@ -122,7 +122,7 @@ class Lightproof( unohelper.Base, XProofreader, XServiceInfo, XServiceName, XSer if 'PYUNO_LOGLEVEL' in os.environ: print(traceback.format_exc()) - l = rText[nSuggestedSentenceEndPos:nSuggestedSentenceEndPos+1] + l = rText[aRes.nStartOfNextSentencePosition:aRes.nStartOfNextSentencePosition+1] while l == " ": aRes.nStartOfNextSentencePosition = aRes.nStartOfNextSentencePosition + 1 l = rText[aRes.nStartOfNextSentencePosition:aRes.nStartOfNextSentencePosition+1] diff --git a/ru_RU/Lightproof.py b/ru_RU/Lightproof.py index 4af25f8..198b762 100644 --- a/ru_RU/Lightproof.py +++ b/ru_RU/Lightproof.py @@ -122,7 +122,7 @@ class Lightproof( unohelper.Base, XProofreader, XServiceInfo, XServiceName, XSer if 'PYUNO_LOGLEVEL' in os.environ: print(traceback.format_exc()) - l = rText[nSuggestedSentenceEndPos:nSuggestedSentenceEndPos+1] + l = rText[aRes.nStartOfNextSentencePosition:aRes.nStartOfNextSentencePosition+1] while l == " ": aRes.nStartOfNextSentencePosition = aRes.nStartOfNextSentencePosition + 1 l = rText[aRes.nStartOfNextSentencePosition:aRes.nStartOfNextSentencePosition+1] |