diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-01-19 11:11:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-19 15:59:38 +0000 |
commit | bb895db932ac8ed5b8c2d221ac7268b2d787194d (patch) | |
tree | e72e9cb86ad8b3df5ee91b0ba241ca1d445603df /sw/source/uibase/inc | |
parent | 573f8134af891beef3fdb1bd3181fbde1314bd9f (diff) |
tdf#105417 sw hyphenation: avoid infinite loop on zero-length last line
This hang happened when the user executed Tools -> Language ->
Hyphenation -> Hyphenate All.
This problem is visible only if all of these conditions are met:
- a line in a paragraph has a word that already contains a soft-hyphen,
but not at the position where the automatic hyphenation would insert
it
- the last line ends with a word that can be hyphenated
- there is a fly frame in the document
In this case it happens during hyphenation that the layout has an
additional empty line at the end (which is removed by the time the
layout finishes), so we hit the case when SwTextFormatter::Hyphenate()
skips the "if( m_pCurr->PrtWidth() && m_pCurr->GetLen() )" block.
Normally hyphenation terminates when it iterates over the portions of the
line and no overrun nor any existing hyphen portion are seen, but in
this case that never happened. Fix the problem by terminating not only
when we reach the end of the portion iteration, but also when the
portion list is non-existing (has zero length).
(cherry picked from commit 1b6fa616087e7415be9dc7113bbd8bf381aadd70)
Conflicts:
sw/qa/extras/uiwriter/uiwriter.cxx
Change-Id: I71d4b040a2d4692ae6eb92807dbbbb42b077a0f8
Reviewed-on: https://gerrit.libreoffice.org/33307
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase/inc')
-rw-r--r-- | sw/source/uibase/inc/hyp.hxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/uibase/inc/hyp.hxx b/sw/source/uibase/inc/hyp.hxx index 24942e31c680..e12638fa6575 100644 --- a/sw/source/uibase/inc/hyp.hxx +++ b/sw/source/uibase/inc/hyp.hxx @@ -23,10 +23,11 @@ #include <tools/link.hxx> #include <editeng/splwrap.hxx> #include <com/sun/star/linguistic2/XHyphenator.hpp> +#include <swdllapi.h> class SwView; -class SwHyphWrapper : public SvxSpellWrapper { +class SW_DLLPUBLIC SwHyphWrapper : public SvxSpellWrapper { private: SwView* pView; sal_uInt16 nPageCount; // page count for progress view |