diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-01-19 11:11:43 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-01-19 12:19:13 +0000 |
commit | 1b6fa616087e7415be9dc7113bbd8bf381aadd70 (patch) | |
tree | 56b6734afa99a07c8f0a861492914a5e512041ec /sw/source/uibase/lingu | |
parent | 968f6a7f0293c08a73807603f3cb294e4b50bad8 (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).
Change-Id: I71d4b040a2d4692ae6eb92807dbbbb42b077a0f8
Reviewed-on: https://gerrit.libreoffice.org/33303
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/source/uibase/lingu')
-rw-r--r-- | sw/source/uibase/lingu/hyp.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/uibase/lingu/hyp.cxx b/sw/source/uibase/lingu/hyp.cxx index 3b2385f80e35..8f96c7fa9481 100644 --- a/sw/source/uibase/lingu/hyp.cxx +++ b/sw/source/uibase/lingu/hyp.cxx @@ -118,7 +118,7 @@ SwHyphWrapper::~SwHyphWrapper() { if( nPageCount ) ::EndProgress( pView->GetDocShell() ); - if( bInfoBox ) + if( bInfoBox && !Application::IsHeadlessModeEnabled() ) ScopedVclPtrInstance<InfoBox>(&pView->GetEditWin(), SW_RESSTR(STR_HYP_OK))->Execute(); } |