summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-08 16:34:47 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-08 20:44:25 +0100
commit7fd6d43c1dae1548aca5ae4ed6d63cbf7e10b7ea (patch)
treebfb79a7732e4948b871856a89c3affdc0877cc2a /editeng
parenta77a573883ce49d045159bdf3f8735594d1e81b4 (diff)
Related: fdo#38838 String::GetBufferAccess is now no more
Change-Id: I9fdd600fd0a530c0763875109eee6600e4a77879
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/misc/svxacorr.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index d49c229ce4b6..8e6003072bcc 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -90,7 +90,7 @@ static const sal_Char
// These characters are allowed in words: (for FnCptlSttSntnc)
static const sal_Char sImplWordChars[] = "-'";
-void EncryptBlockName_Imp( String& rName );
+OUString EncryptBlockName_Imp(const OUString& rName);
TYPEINIT0(SvxAutoCorrect)
@@ -1626,16 +1626,16 @@ sal_Bool SvxAutoCorrect::PutText( const com::sun::star::uno::Reference < com::su
return sal_False;
}
-void EncryptBlockName_Imp( String& rName )
+OUString EncryptBlockName_Imp(const OUString& rName)
{
- xub_StrLen nLen, nPos = 1;
- rName.Insert( '#', 0 );
- sal_Unicode* pName = rName.GetBufferAccess();
- for ( nLen = rName.Len(), ++pName; nPos < nLen; ++nPos, ++pName )
+ OUStringBuffer aName;
+ aName.append('#').append(rName);
+ for (sal_Int32 nLen = rName.getLength(), nPos = 1; nPos < nLen; ++nPos)
{
- if( lcl_IsInAsciiArr( "!/:.\\", *pName ))
- *pName &= 0x0f;
+ if (lcl_IsInAsciiArr( "!/:.\\", aName[nPos]))
+ aName[nPos] &= 0x0f;
}
+ return aName.makeStringAndClear();
}
/* This code is copied from SwXMLTextBlocks::GeneratePackageName */
@@ -2440,7 +2440,7 @@ sal_Bool SvxAutoCorrectLanguageLists::MakeCombinedChanges( std::vector<SvxAutoco
{
String aName( aWordToDelete.GetShort() );
if (xStorage->IsOLEStorage())
- EncryptBlockName_Imp( aName );
+ aName = EncryptBlockName_Imp(aName);
else
GeneratePackageName ( aWordToDelete.GetShort(), aName );
@@ -2465,7 +2465,7 @@ sal_Bool SvxAutoCorrectLanguageLists::MakeCombinedChanges( std::vector<SvxAutoco
// Still have to remove the Storage
String sStorageName( pWordToAdd->GetShort() );
if (xStorage->IsOLEStorage())
- EncryptBlockName_Imp( sStorageName );
+ sStorageName = EncryptBlockName_Imp(sStorageName);
else
GeneratePackageName ( pWordToAdd->GetShort(), sStorageName);
@@ -2513,7 +2513,7 @@ sal_Bool SvxAutoCorrectLanguageLists::PutText( const String& rShort, const Strin
// Still have to remove the Storage
String sStgNm( rShort );
if (xStg->IsOLEStorage())
- EncryptBlockName_Imp( sStgNm );
+ sStgNm = EncryptBlockName_Imp(sStgNm);
else
GeneratePackageName ( rShort, sStgNm);
@@ -2593,7 +2593,7 @@ sal_Bool SvxAutoCorrectLanguageLists::DeleteText( const String& rShort )
{
String aName( rShort );
if (xStg->IsOLEStorage())
- EncryptBlockName_Imp( aName );
+ aName = EncryptBlockName_Imp(aName);
else
GeneratePackageName ( rShort, aName );
if( xStg->IsContained( aName ) )