[Libreoffice-commits] core.git: sw/qa

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 4 13:57:55 UTC 2019


 sw/qa/extras/layout/layout.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 329e489434b0037cb605f6f43d1c18fd8789e126
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Dec 3 12:50:26 2019 +0100
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Wed Dec 4 14:57:03 2019 +0100

    Simplify check for hyphenation support
    
    Change-Id: I9e45143d6dda313d105949cfae64ee39990de132
    Reviewed-on: https://gerrit.libreoffice.org/84331
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 8524a4e0e033..d0d598ee9a1a 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -22,6 +22,7 @@
 #include <editeng/fontitem.hxx>
 #include <editeng/fhgtitem.hxx>
 #include <editeng/postitem.hxx>
+#include <editeng/unolingu.hxx>
 #include <fmtanchr.hxx>
 #include <fmtfsize.hxx>
 #include <fmtcntnt.hxx>
@@ -2597,13 +2598,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118672)
     xmlDocPtr pXmlDoc = parseLayoutDump();
 
     // Check if we have hyphenation support, otherwise can't test SwHyphPortion.
-    uno::Reference<linguistic2::XLinguServiceManager2> xLinguServiceManager
-        = linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext());
-    uno::Sequence<lang::Locale> aLocales
-        = xLinguServiceManager->getAvailableLocales("com.sun.star.linguistic2.Hyphenator");
-    if (std::none_of(aLocales.begin(), aLocales.end(), [](const lang::Locale& rLocale) {
-            return rLocale.Language == "en" && rLocale.Country == "US";
-        }))
+    uno::Reference<linguistic2::XHyphenator> xHyphenator = LinguMgr::GetHyphenator();
+    if (!xHyphenator->hasLocale(lang::Locale("en", "US", OUString())))
         return;
 
     const OUString aLine1(


More information about the Libreoffice-commits mailing list