Simplify check for hyphenation support

Change-Id: I9e45143d6dda313d105949cfae64ee39990de132
Reviewed-on: https://gerrit.libreoffice.org/84331
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
Samuel Mehrbrodt 2019-12-03 12:50:26 +01:00
parent cd7241e3d2
commit 329e489434

View file

@ -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(