diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/fpdftext/cpdf_textpage.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp index 0a7a39fff5..d528c6994f 100644 --- a/core/fpdftext/cpdf_textpage.cpp +++ b/core/fpdftext/cpdf_textpage.cpp @@ -1226,20 +1226,17 @@ bool CPDF_TextPage::IsHyphen(wchar_t curChar) const { return false; auto iter = curText.rbegin(); - for (; iter != curText.rend() && *iter == 0x20; iter++) { + for (; (iter + 1) != curText.rend() && *iter == 0x20; iter++) { // Do nothing } - if (iter != curText.rend()) { - if (!IsHyphenCode(*iter)) - return false; + if (!IsHyphenCode(*iter)) + return false; + + if ((iter + 1) != curText.rend()) { iter++; if (FXSYS_iswalpha(*iter) && FXSYS_iswalpha(*iter)) return true; - } else { - iter--; - if (!IsHyphenCode(*iter)) - return false; } const PAGECHAR_INFO* preInfo; |