summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-06-10 08:55:10 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-06-10 15:04:33 +0200
commitaa6993e35c38c8be81da326ef41afc980ccc3ef3 (patch)
treeb76c4f552f39dc6a553a6f489d6382f857c66f92 /sw
parent29525b020c3599e2786e04fec1aef0094a36874d (diff)
add test for hyphenation related crash
of: commit f050103c3324d878b310f37429ea3580a8230905 Date: Fri Jun 7 20:14:15 2024 +0100 stale hyphenation data after skipping blanks Change-Id: I9743d67b49db054968e9f13c5fc6a13136953733 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168606 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/layout/data/crashHyphen.fodt31
-rw-r--r--sw/qa/extras/layout/layout3.cxx6
2 files changed, 37 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/crashHyphen.fodt b/sw/qa/extras/layout/data/crashHyphen.fodt
new file mode 100644
index 000000000000..6cdd2ccc45e6
--- /dev/null
+++ b/sw/qa/extras/layout/data/crashHyphen.fodt
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:settings>
+ <config:config-item-set config:name="ooo:configuration-settings">
+ <config:config-item config:name="JustifyLinesWithShrinking" config:type="boolean">true</config:config-item>
+ </config:config-item-set>
+ </office:settings>
+ <office:font-face-decls>
+ <style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:default-style style:family="paragraph">
+ <style:paragraph-properties fo:text-align="justify" style:justify-single-word="false" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict"/>
+ <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Sans" fo:font-size="14pt" fo:language="en" fo:country="US" style:letter-kerning="false" fo:hyphenate="true" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false" loext:hyphenation-no-last-word="false" loext:hyphenation-word-char-count="5" loext:hyphenation-zone="no-limit"/>
+ </style:default-style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties fo:page-width="82mm" fo:page-height="83mm" style:print-orientation="portrait" fo:margin-top="1cm" fo:margin-bottom="1cm" fo:margin-left="1cm" fo:margin-right="1cm"/>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
+ </office:master-styles>
+ <office:body>
+ <office:text>
+ <text:p>He heard quiet steps behind; </text:p>
+ </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx
index af480f970164..ab4bb1d52829 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -2843,6 +2843,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf161368)
assertXPath(pExportDump, "//page[1]/body/txt[3]/SwParaPortion/SwLineLayout"_ostr, 1);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestCrashHyphenation)
+{
+ //just care it doesn't crash/assert
+ createSwDoc("crashHyphen.fodt");
+}
+
} // end of anonymous namespace
CPPUNIT_PLUGIN_IMPLEMENT();