diff options
author | Noel Grandin <noel@peralex.com> | 2013-09-06 12:01:31 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-09-11 09:45:30 +0200 |
commit | ac85b6cff11d193f5f71d11b1f3cc1c474653f59 (patch) | |
tree | c39ae299f09d993b963613b6af9869fbd0d8403e /editeng/source/editeng/edtspell.cxx | |
parent | bde5457dd634c70cef02565890e08e8669e1a437 (diff) |
convert SvxAutoCorrDoc from String to OUString
Also:
- simplify the return type of the GetPrevPara method, there is no
need return an OUString by pointer
- simply the ppPara parameter of the ChgAutoCorrWord method,
passing a pointer to a pointer to a value type is unnecessary.
Change-Id: I4a8c44fdab1cf68af88c34003827d1c20704f839
Diffstat (limited to 'editeng/source/editeng/edtspell.cxx')
-rw-r--r-- | editeng/source/editeng/edtspell.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index 6c2fdf741e09..787189c2a163 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -603,27 +603,27 @@ sal_Bool EdtAutoCorrDoc::Delete( sal_uInt16 nStt, sal_uInt16 nEnd ) return true; } -sal_Bool EdtAutoCorrDoc::Insert( sal_uInt16 nPos, const String& rTxt ) +sal_Bool EdtAutoCorrDoc::Insert( sal_uInt16 nPos, const OUString& rTxt ) { EditSelection aSel = EditPaM( pCurNode, nPos ); mpEditEngine->InsertText(aSel, rTxt); SAL_WARN_IF(nCursor < nPos, "editeng", "Cursor in the heart of the action?!"); - nCursor = nCursor + rTxt.Len(); + nCursor = nCursor + rTxt.getLength(); - if ( bAllowUndoAction && ( rTxt.Len() == 1 ) ) + if ( bAllowUndoAction && ( rTxt.getLength() == 1 ) ) ImplStartUndoAction(); bAllowUndoAction = false; return true; } -sal_Bool EdtAutoCorrDoc::Replace( sal_uInt16 nPos, const String& rTxt ) +sal_Bool EdtAutoCorrDoc::Replace( sal_uInt16 nPos, const OUString& rTxt ) { - return ReplaceRange( nPos, rTxt.Len(), rTxt ); + return ReplaceRange( nPos, rTxt.getLength(), rTxt ); } -sal_Bool EdtAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const String& rTxt ) +sal_Bool EdtAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const OUString& rTxt ) { // Actually a Replace introduce => corresponds to UNDO sal_uInt16 nEnd = nPos+nSourceLength; @@ -636,9 +636,9 @@ sal_Bool EdtAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength EditSelection(EditPaM(pCurNode, nPos), EditPaM(pCurNode, nEnd))); if ( nPos == nCursor ) - nCursor = nCursor + rTxt.Len(); + nCursor = nCursor + rTxt.getLength(); - if ( bAllowUndoAction && ( rTxt.Len() == 1 ) ) + if ( bAllowUndoAction && ( rTxt.getLength() == 1 ) ) ImplStartUndoAction(); bAllowUndoAction = false; @@ -691,7 +691,7 @@ sal_Bool EdtAutoCorrDoc::SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, return true; } -const String* EdtAutoCorrDoc::GetPrevPara( sal_Bool ) +OUString EdtAutoCorrDoc::GetPrevPara( sal_Bool ) { // Return previous paragraph, so that it can be determined, // whether the current word is at the beginning of a sentence. @@ -714,22 +714,22 @@ const String* EdtAutoCorrDoc::GetPrevPara( sal_Bool ) bBullet = true; } if ( bBullet ) - return NULL; + return OUString(); for ( sal_Int32 n = nPos; n; ) { n--; ContentNode* pNode = rNodes[n]; if ( pNode->Len() ) - return &pNode->GetString(); + return pNode->GetString(); } - return NULL; + return OUString(); } sal_Bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_uInt16& rSttPos, sal_uInt16 nEndPos, SvxAutoCorrect& rACorrect, - const String** ppPara ) + OUString* pPara ) { // Paragraph-start or a blank found, search for the word // shortcut in Auto @@ -754,8 +754,8 @@ sal_Bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_uInt16& rSttPos, nCursor -= ( nEndPos-rSttPos ); mpEditEngine->InsertText(aSel, pFnd->GetLong()); nCursor = nCursor + pFnd->GetLong().Len(); - if( ppPara ) - *ppPara = &pCurNode->GetString(); + if( pPara ) + *pPara = pCurNode->GetString(); bRet = true; } |