From 72bd0df107ee47c4d54fa88b4960d32ea03e9f69 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Thu, 28 Nov 2019 11:13:44 +0100 Subject: 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 --- sw/qa/extras/layout/data/tdf121658.odt | Bin 0 -> 19195 bytes sw/qa/extras/layout/layout.cxx | 14 ++++++++++++++ sw/qa/extras/odfexport/data/tdf121658.odt | Bin 0 -> 20057 bytes sw/qa/extras/odfexport/odfexport.cxx | 8 ++++++++ 4 files changed, 22 insertions(+) create mode 100644 sw/qa/extras/layout/data/tdf121658.odt create mode 100644 sw/qa/extras/odfexport/data/tdf121658.odt (limited to 'sw/qa/extras') 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 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf121658.odt 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 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 Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf121658.odt 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 xParaStyles(getStyles("ParagraphStyles")); + uno::Reference xStyle1(xParaStyles->getByName( + "Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, getProperty(xStyle1, "ParaHyphenationNoCaps")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3