summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-28 11:13:44 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-12-06 12:00:37 +0100
commit72bd0df107ee47c4d54fa88b4960d32ea03e9f69 (patch)
treef4ad346dbf636f32211298aace3a4a34957058f3 /sw/qa
parentd8c36a8771398327ba83884a2e0aa82a6d7c8492 (diff)
tdf#121658 Add option to not hyphenate words in CAPS
* Add checkbox to pagraph dialog * Store property in paragraph model * Move docx import/export from grabbag to paragraph model * Add ODF import/export * Add ODF unit test * Add layout test Change-Id: Id4e7c5a0ad145c042f862995d227c31ae2aa0abd Reviewed-on: https://gerrit.libreoffice.org/83979 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/layout/data/tdf121658.odtbin0 -> 19195 bytes
-rw-r--r--sw/qa/extras/layout/layout.cxx14
-rw-r--r--sw/qa/extras/odfexport/data/tdf121658.odtbin0 -> 20057 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx8
4 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf121658.odt b/sw/qa/extras/layout/data/tdf121658.odt
new file mode 100644
index 000000000000..b3429ff41af3
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf121658.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 9e8acad5ae89..6b4ab938f94c 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3564,6 +3564,20 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117982)
//the source document.
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf121658)
+{
+ uno::Reference<linguistic2::XHyphenator> xHyphenator = LinguMgr::GetHyphenator();
+ if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString())))
+ return;
+
+ createDoc("tdf121658.odt");
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+
+ // Only 2 hyphenated words should appear in the document (in the lowercase words).
+ // Uppercase words should not be hyphenated.
+ assertXPath(pXmlDoc, "//Special[@nType='PortionType::Hyphen']", 2);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/odfexport/data/tdf121658.odt b/sw/qa/extras/odfexport/data/tdf121658.odt
new file mode 100644
index 000000000000..1ab6f75c8de6
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf121658.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 0334a73debca..b407bdd3e820 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2307,5 +2307,13 @@ DECLARE_ODFEXPORT_TEST(tdf128504, "tdf128504.docx")
CPPUNIT_ASSERT(!visitedStyleName.equalsIgnoreAsciiCase("Visited Internet Link"));
}
+DECLARE_ODFEXPORT_TEST(tdf121658, "tdf121658.odt")
+{
+ uno::Reference<container::XNameAccess> xParaStyles(getStyles("ParagraphStyles"));
+ uno::Reference<beans::XPropertySet> xStyle1(xParaStyles->getByName(
+ "Standard"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xStyle1, "ParaHyphenationNoCaps"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */