diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-09-08 14:52:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-08 14:52:59 +0100 |
commit | ce9c390e1a100921fd4300d6acb602b4af2b7003 (patch) | |
tree | 90e3be5f1fab209aed9ec63abd24dd17c2d25a04 /sc | |
parent | 3b21a1657b314b72049e8881d7f21cf56fb72484 (diff) |
Related: fdo#38838 String::ReleaseBufferAccess is now no more
Change-Id: Ib5390183e3d98a23f9243debfe3624561ca92535
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 33eb3dae684d..85c0f917fc3e 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -3158,31 +3158,25 @@ void ScInterpreter::ScUpper() void ScInterpreter::ScPropper() { //2do: what to do with I18N-CJK ?!? - String aStr( GetString() ); - const xub_StrLen nLen = aStr.Len(); - // #i82487# don't try to write to empty string's BufferAccess - // (would crash now that the empty string is const) + OUStringBuffer aStr(GetString()); + const sal_Int32 nLen = aStr.getLength(); if ( nLen > 0 ) { - String aUpr( ScGlobal::pCharClass->uppercase( aStr ) ); - String aLwr( ScGlobal::pCharClass->lowercase( aStr ) ); - sal_Unicode* pStr = aStr.GetBufferAccess(); - const sal_Unicode* pUpr = aUpr.GetBuffer(); - const sal_Unicode* pLwr = aLwr.GetBuffer(); - *pStr = *pUpr; - xub_StrLen nPos = 1; + OUString aUpr(ScGlobal::pCharClass->uppercase(aStr.toString())); + OUString aLwr(ScGlobal::pCharClass->lowercase(aStr.toString())); + aStr[0] = aUpr[0]; + sal_Int32 nPos = 1; while( nPos < nLen ) { - OUString aTmpStr( pStr[nPos-1] ); + OUString aTmpStr( aStr[nPos-1] ); if ( !ScGlobal::pCharClass->isLetter( aTmpStr, 0 ) ) - pStr[nPos] = pUpr[nPos]; + aStr[nPos] = aUpr[nPos]; else - pStr[nPos] = pLwr[nPos]; - nPos++; + aStr[nPos] = aLwr[nPos]; + ++nPos; } - aStr.ReleaseBufferAccess( nLen ); } - PushString( aStr ); + PushString(aStr.makeStringAndClear()); } |