diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-06 21:43:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-07 09:40:57 +0200 |
commit | 8d80832a91520ae43f420f244bba278ead7689bc (patch) | |
tree | a503f2f2e811bc15840beaea45d2d41eddb1cc1e /vcl | |
parent | f95f0ce163743706a3670c6e33593023c22af2ff (diff) |
xContext only needed for bHyphenate case
Change-Id: I5c1d7d43fb26c4adf14de6395e40833eaa3d0164
Reviewed-on: https://gerrit.libreoffice.org/39669
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/text.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 7d4a729f3bd6..ba9208d5ba1c 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -472,19 +472,17 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, rLineInfo.Clear(); if ( !rStr.isEmpty() && (nWidth > 0) ) { - css::uno::Reference < css::i18n::XBreakIterator > xBI; - // get service provider - css::uno::Reference< css::uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); - - bool bHyphenate = (nStyle & DrawTextFlags::WordBreakHyphenation) - == DrawTextFlags::WordBreakHyphenation; + const bool bHyphenate = (nStyle & DrawTextFlags::WordBreakHyphenation) == DrawTextFlags::WordBreakHyphenation; 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(); } + css::uno::Reference<css::i18n::XBreakIterator> xBI; sal_Int32 nPos = 0; sal_Int32 nLen = rStr.getLength(); while ( nPos < nLen ) |