Kaydet (Commit) 44a6eee8 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst d20dff14
......@@ -4679,8 +4679,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();
......@@ -4712,7 +4714,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.
......
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