office-gobmx/sw/qa
Miklos Vajna 1b6fa61608 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>
2017-01-19 12:19:13 +00:00
..
complex
core New loplugin:externvar: sw 2017-01-09 15:40:22 +01:00
extras tdf#105417 sw hyphenation: avoid infinite loop on zero-length last line 2017-01-19 12:19:13 +00:00
python Fix check_index to be more pythonic. 2017-01-17 06:32:42 +00:00
unit
unoapi
README

You can find different types of Writer tests here, the following directories
are available:

- core:
  - filters-test: loads different file types (see SwFiltersTest::testCVEs() for
    the list of supported filter types), and only makes sure Writer does not
    crash. To add new tests, you just need to drop in the test files to the
    relevant directory, no code change is necessary.
  - uwriter: this test has access to private Writer symbols, add new tests here
    if you need that.
- extras:
  - see its own README -- executes import and export filters and asserts the
    UNO model to verify the resulting document is the expected one.
  - also, any new C++ test that links to libsw (but does not need access to
    private Writer symbols) should go in this directory, whether using the UNO
    API or the internal one.
- complex: JUnit-based tests using the UNO API
- unoapi: JUnit-based test trying to get/set every UNO property, etc.