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

Related fdo#46808: Fix pre-existing bug identified in previous commit

Assigning to dead xBreakIterator instead of m_xBreakIterator had been introduced
with 9f2fde7a "#i103496#: split svtools; improve
ConfitItems," and just fixing it does not cause any tests to start breaking for
me.

Change-Id: I9a26e8d3924bf15ae948c9c26b70f42f8f0d2f64
üst c0f865c9
...@@ -749,33 +749,27 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence( ...@@ -749,33 +749,27 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence(
{ {
// internal method; will always be called with locked mutex // internal method; will always be called with locked mutex
// FIXME! this is a bug, the xBreakIterator var is hiding an issue!
// But if I fix it, the sw/complex tests start failing.
uno::Reference< i18n::XBreakIterator > xBreakIterator;
if (!m_xBreakIterator.is()) if (!m_xBreakIterator.is())
{ {
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
xBreakIterator = i18n::BreakIterator::create(xContext); m_xBreakIterator = i18n::BreakIterator::create(xContext);
} }
sal_Int32 nTextLen = rText.getLength(); sal_Int32 nTextLen = rText.getLength();
sal_Int32 nEndPosition = nTextLen; sal_Int32 nEndPosition;
if (m_xBreakIterator.is()) sal_Int32 nTmpStartPos = nSentenceStartPos;
do
{ {
sal_Int32 nTmpStartPos = nSentenceStartPos; nEndPosition = nTextLen;
do if (nTmpStartPos < nTextLen)
{ nEndPosition = m_xBreakIterator->endOfSentence( rText, nTmpStartPos, rLocale );
if (nEndPosition < 0)
nEndPosition = nTextLen; nEndPosition = nTextLen;
if (nTmpStartPos < nTextLen)
nEndPosition = m_xBreakIterator->endOfSentence( rText, nTmpStartPos, rLocale );
if (nEndPosition < 0)
nEndPosition = nTextLen;
++nTmpStartPos; ++nTmpStartPos;
}
while (nEndPosition <= nSentenceStartPos && nEndPosition < nTextLen);
if (nEndPosition > nTextLen)
nEndPosition = nTextLen;
} }
while (nEndPosition <= nSentenceStartPos && nEndPosition < nTextLen);
if (nEndPosition > nTextLen)
nEndPosition = nTextLen;
return nEndPosition; return nEndPosition;
} }
......
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