diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-12-03 09:23:43 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-09-25 02:10:19 -0700 |
commit | 629eac17fda6b875a87f96d86ba468359b73c29d (patch) | |
tree | b9f6bd81d2538689d6d3be6dd53a7eb185861983 /vcl | |
parent | 9d91e2b652922a362fdcf5f3716b48946d5865b3 (diff) |
Call getLineBreak with null XHyphenator unless TEXT_DRAW_WORDBREAK_HYPHENATION
So no longer instantiate XLinguServiceManager (which might e.g. bootstrap
Python) unless explicitly requested, which e.g. removes a noticable delay when
switching to the Options dialog's "Security" page (which causes size
calculations of FixedText controls that use TEXT_DRAW_WORDBREAK but not
TEXT_DRAW_WORDBREAK_HYPHENATION).
Change-Id: Ib0a28d3d7d7718faf6df7a138f5a86b8b2fd7713
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index a8cb7fc5e674..d7078881b8ca 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -4729,8 +4729,10 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, // get service provider uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); + bool bHyphenate = (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) + == TEXT_DRAW_WORDBREAK_HYPHENATION; uno::Reference< linguistic2::XHyphenator > xHyph; - if ( nStyle & TEXT_DRAW_WORDBREAK ) + if ( bHyphenate ) { uno::Reference< linguistic2::XLinguServiceManager2> xLinguMgr = linguistic2::LinguServiceManager::create(xContext); xHyph = xLinguMgr->getHyphenator(); @@ -4762,7 +4764,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, nBreakPos = (xub_StrLen)aLBR.breakIndex; if ( nBreakPos <= nPos ) nBreakPos = nSoftBreak; - if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) == TEXT_DRAW_WORDBREAK_HYPHENATION ) + if ( bHyphenate ) { // Whether hyphen or not: Put the word after the hyphen through // word boundary. |