diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-09-08 21:10:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-09-08 21:11:47 +0100 |
commit | 11df18b7a92fb02ea7decd594485e8c73fe61278 (patch) | |
tree | a34254ba7b06b8991a036346d8b43f2904a1b12d /sw | |
parent | 89833d454258485dfcf1d52e1f2ddedfc3e9cb5c (diff) |
Resolves: fdo#40449 spellchecking tried to keep a reference to a temporary
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/inc/scriptinfo.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 28 |
2 files changed, 15 insertions, 15 deletions
diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx index fd0ac6a14a9b..f55c77ef733d 100644 --- a/sw/source/core/inc/scriptinfo.hxx +++ b/sw/source/core/inc/scriptinfo.hxx @@ -55,7 +55,7 @@ class SwScanner { rtl::OUString aWord; const SwTxtNode& rNode; - const rtl::OUString& rText; + const rtl::OUString aText; const LanguageType* pLanguage; const ModelToViewHelper::ConversionMap* pConversionMap; sal_Int32 nStartPos; diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index fe9175b3fe15..f63826ce01e9 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -664,9 +664,9 @@ XubString SwTxtNode::GetCurWord( xub_StrLen nPos ) const SwScanner::SwScanner( const SwTxtNode& rNd, const rtl::OUString& rTxt, const LanguageType* pLang, const ModelToViewHelper::ConversionMap* pConvMap, sal_uInt16 nType, sal_Int32 nStart, sal_Int32 nEnde, sal_Bool bClp ) - : rNode( rNd ), rText( rTxt), pLanguage( pLang ), pConversionMap( pConvMap ), nLen( 0 ), nWordType( nType ), bClip( bClp ) + : rNode( rNd ), aText( rTxt), pLanguage( pLang ), pConversionMap( pConvMap ), nLen( 0 ), nWordType( nType ), bClip( bClp ) { - OSL_ENSURE( !rText.isEmpty(), "SwScanner: EmptyString" ); + OSL_ENSURE( !aText.isEmpty(), "SwScanner: EmptyString" ); nStartPos = nBegin = nStart; nEndPos = nEnde; @@ -693,13 +693,13 @@ sal_Bool SwScanner::NextWord() while ( true ) { // skip non-letter characters: - while ( nBegin < rText.getLength() ) + while ( nBegin < aText.getLength() ) { - if ( !lcl_IsSkippableWhiteSpace( rText[nBegin] ) ) + if ( !lcl_IsSkippableWhiteSpace( aText[nBegin] ) ) { if ( !pLanguage ) { - const sal_uInt16 nNextScriptType = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin ); + const sal_uInt16 nNextScriptType = pBreakIt->GetBreakIter()->getScriptType( aText, nBegin ); ModelToViewHelper::ModelPosition aModelBeginPos = ModelToViewHelper::ConvertToModelPosition( pConversionMap, nBegin ); const sal_Int32 nBeginModelPos = aModelBeginPos.mnPos; aCurrLang = rNode.GetLang( nBeginModelPos, 1, nNextScriptType ); @@ -708,7 +708,7 @@ sal_Bool SwScanner::NextWord() if ( nWordType != i18n::WordType::WORD_COUNT ) { rCC.setLocale( pBreakIt->GetLocale( aCurrLang ) ); - if ( rCC.isLetterNumeric( rText[nBegin] ) ) + if ( rCC.isLetterNumeric( aText[nBegin] ) ) break; } else @@ -717,11 +717,11 @@ sal_Bool SwScanner::NextWord() ++nBegin; } - if ( nBegin >= rText.getLength() || nBegin >= nEndPos ) + if ( nBegin >= aText.getLength() || nBegin >= nEndPos ) return sal_False; // get the word boundaries - aBound = pBreakIt->GetBreakIter()->getWordBoundary( rText, nBegin, + aBound = pBreakIt->GetBreakIter()->getWordBoundary( aText, nBegin, pBreakIt->GetLocale( aCurrLang ), nWordType, sal_True ); OSL_ENSURE( aBound.endPos >= aBound.startPos, "broken aBound result" ); @@ -754,8 +754,8 @@ sal_Bool SwScanner::NextWord() OSL_ENSURE( aBound.endPos >= nBegin, "Unexpected aBound result" ); // restrict boundaries to script boundaries and nEndPos - const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin ); - rtl::OUString aTmpWord = rText.copy( nBegin, aBound.endPos - nBegin ); + const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( aText, nBegin ); + rtl::OUString aTmpWord = aText.copy( nBegin, aBound.endPos - nBegin ); const sal_Int32 nScriptEnd = nBegin + pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript ); const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd ); @@ -765,7 +765,7 @@ sal_Bool SwScanner::NextWord() if ( aBound.startPos < nBegin ) { // search from nBegin backwards until the next script change - aTmpWord = rText.copy( aBound.startPos, + aTmpWord = aText.copy( aBound.startPos, nBegin - aBound.startPos + 1 ); nScriptBegin = aBound.startPos + pBreakIt->GetBreakIter()->beginOfScript( aTmpWord, nBegin - aBound.startPos, @@ -777,8 +777,8 @@ sal_Bool SwScanner::NextWord() } else { - const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, aBound.startPos ); - rtl::OUString aTmpWord = rText.copy( aBound.startPos, + const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( aText, aBound.startPos ); + rtl::OUString aTmpWord = aText.copy( aBound.startPos, aBound.endPos - aBound.startPos ); const sal_Int32 nScriptEnd = aBound.startPos + pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript ); @@ -800,7 +800,7 @@ sal_Bool SwScanner::NextWord() if( ! nLen ) return sal_False; - aWord = rText.copy( nBegin, nLen ); + aWord = aText.copy( nBegin, nLen ); return sal_True; } |