Kaydet (Commit) 8d80832a authored tarafından Caolán McNamara's avatar Caolán McNamara

xContext only needed for bHyphenate case

Change-Id: I5c1d7d43fb26c4adf14de6395e40833eaa3d0164
Reviewed-on: https://gerrit.libreoffice.org/39669Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst f95f0ce1
...@@ -472,19 +472,17 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, ...@@ -472,19 +472,17 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
rLineInfo.Clear(); rLineInfo.Clear();
if ( !rStr.isEmpty() && (nWidth > 0) ) if ( !rStr.isEmpty() && (nWidth > 0) )
{ {
css::uno::Reference < css::i18n::XBreakIterator > xBI; const bool bHyphenate = (nStyle & DrawTextFlags::WordBreakHyphenation) == DrawTextFlags::WordBreakHyphenation;
// get service provider
css::uno::Reference< css::uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
bool bHyphenate = (nStyle & DrawTextFlags::WordBreakHyphenation)
== DrawTextFlags::WordBreakHyphenation;
css::uno::Reference< css::linguistic2::XHyphenator > xHyph; css::uno::Reference< css::linguistic2::XHyphenator > xHyph;
if ( bHyphenate ) if (bHyphenate)
{ {
css::uno::Reference< css::linguistic2::XLinguServiceManager2> xLinguMgr = css::linguistic2::LinguServiceManager::create(xContext); // get service provider
css::uno::Reference<css::uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLinguMgr = css::linguistic2::LinguServiceManager::create(xContext);
xHyph = xLinguMgr->getHyphenator(); xHyph = xLinguMgr->getHyphenator();
} }
css::uno::Reference<css::i18n::XBreakIterator> xBI;
sal_Int32 nPos = 0; sal_Int32 nPos = 0;
sal_Int32 nLen = rStr.getLength(); sal_Int32 nLen = rStr.getLength();
while ( nPos < nLen ) while ( nPos < nLen )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment