diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-17 12:06:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-17 12:07:40 +0100 |
commit | 28bff60322098e0238f369feefc50ee524ba66f0 (patch) | |
tree | bb63cd3a12eed072c414b63317734c36dd539864 /vcl | |
parent | 713592e5e923498dac21f09b11dfecd180accf5b (diff) |
defer GetBreakIterator as long as possible
Change-Id: Ib149c5cfd20e63b60c997eaa8ae2e6fa2c172beb
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 65660ec6516b..0de2ffd6cae1 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -641,7 +641,6 @@ uno::Reference < i18n::XExtendedInputSequenceChecker > TextEngine::GetInputSeque sal_Bool TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const { - uno::Reference< i18n::XBreakIterator > xBI = ((TextEngine *) this)->GetBreakIterator(); SvtCTLOptions aCTLOptions; // get the index that really is first @@ -650,11 +649,16 @@ sal_Bool TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextS if (nMaxPos < nFirstPos) nFirstPos = nMaxPos; - sal_Bool bIsSequenceChecking = + bool bIsSequenceChecking = aCTLOptions.IsCTLFontEnabled() && aCTLOptions.IsCTLSequenceChecking() && - nFirstPos != 0 && /* first char needs not to be checked */ - xBI.is() && i18n::ScriptType::COMPLEX == xBI->getScriptType( OUString( c ), 0 ); + nFirstPos != 0; /* first char needs not to be checked */ + + if (bIsSequenceChecking) + { + uno::Reference< i18n::XBreakIterator > xBI = const_cast<TextEngine *>(this)->GetBreakIterator(); + bIsSequenceChecking = xBI.is() && i18n::ScriptType::COMPLEX == xBI->getScriptType( OUString( c ), 0 ); + } return bIsSequenceChecking; } |