[PATCH] Drop String.AppendAscii in editeng
Ricardo Montania (via Code Review)
gerrit at gerrit.libreoffice.org
Thu May 16 09:12:29 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3923
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/23/3923/1
Drop String.AppendAscii in editeng
Change-Id: I25df0e20e2da50e91139cefba74af2741e5fffb5
---
M editeng/source/misc/svxacorr.cxx
M editeng/source/outliner/outlvw.cxx
M include/editeng/svxacorr.hxx
3 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index eebf87c..c2f76ae 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1604,8 +1604,8 @@
{
OSL_ENSURE(pLangTable->find(eLang) == pLangTable->end(), "Language already exists ");
- String sUserDirFile( GetAutoCorrFileName( eLang, sal_True, sal_False ));
- String sShareDirFile( sUserDirFile );
+ OUString sUserDirFile( GetAutoCorrFileName( eLang, sal_True, sal_False ));
+ OUString sShareDirFile( sUserDirFile );
SvxAutoCorrectLanguageListsPtr pLists = 0;
@@ -1909,13 +1909,12 @@
return sal_False;
}
-String SvxAutoCorrect::GetAutoCorrFileName( LanguageType eLang,
+OUString SvxAutoCorrect::GetAutoCorrFileName( LanguageType eLang,
sal_Bool bNewFile, sal_Bool bTst ) const
{
- String sRet, sExt( LanguageTag( eLang ).getBcp47() );
+ OUString sRet, sExt( LanguageTag( eLang ).getBcp47() );
- sExt.Insert('_', 0);
- sExt.AppendAscii( ".dat" );
+ sExt = "_" + sExt + ".dat";
if( bNewFile )
( sRet = sUserAutoCorrFile ) += sExt;
else if( !bTst )
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index a76419e..2229857 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1312,7 +1312,7 @@
const EditView &rEditView )
{
// get text and locale for thesaurus look up
- String aText;
+ OUString aText;
EditEngine *pEditEngine = rEditView.GetEditEngine();
ESelection aTextSel( rEditView.GetSelection() );
if (!aTextSel.HasRange())
@@ -1320,17 +1320,15 @@
aText = pEditEngine->GetText( aTextSel );
aTextSel.Adjust();
LanguageType nLang = pEditEngine->GetLanguage( aTextSel.nStartPara, aTextSel.nStartPos );
- String aLangText( LanguageTag( nLang ).getBcp47() );
+ OUString aLangText( LanguageTag( nLang ).getBcp47() );
// set word and locale to look up as status value
- String aStatusVal( aText );
- aStatusVal.AppendAscii( "#" );
- aStatusVal += aLangText;
+ OUString aStatusVal= aText + "#" + aLangText;
rStatusVal = aStatusVal;
rLang = nLang;
- return aText.Len() > 0;
+ return aText.getLength() > 0;
}
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 4f54d8f..9d5774a 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -327,7 +327,7 @@
// Query/Set the name of the AutoCorrect file
// the default is "autocorr.dat"
- String GetAutoCorrFileName( LanguageType eLang = LANGUAGE_SYSTEM,
+ OUString GetAutoCorrFileName( LanguageType eLang = LANGUAGE_SYSTEM,
sal_Bool bNewFile = sal_False,
sal_Bool bTstUserExist = sal_False ) const;
--
To view, visit https://gerrit.libreoffice.org/3923
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I25df0e20e2da50e91139cefba74af2741e5fffb5
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Ricardo Montania <ricardo at linuxafundo.com.br>
More information about the LibreOffice
mailing list