summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--i18nutil/source/utility/unicode.cxx2
-rw-r--r--shell/source/backends/desktopbe/desktopbackend.cxx2
-rw-r--r--vcl/source/control/field2.cxx7
-rw-r--r--vcl/source/outdev/text.cxx2
4 files changed, 8 insertions, 5 deletions
diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx
index 61ce7c04d2b2..5d8a70aa4d77 100644
--- a/i18nutil/source/utility/unicode.cxx
+++ b/i18nutil/source/utility/unicode.cxx
@@ -1198,7 +1198,7 @@ OUString ToggleUnicodeCodepoint::StringToReplace()
//if U+ notation used, strip off all extra chars added not in U+ notation
if( nUPlus != -1 )
{
- maInput = maInput.copy(nUPlus);
+ maInput.remove(0, nUPlus);
sIn = maInput.copy(2).toString();
nUPlus = sIn.indexOf("U+");
}
diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx
index 42bc6a8b3ce4..e6d160f4a6fc 100644
--- a/shell/source/backends/desktopbe/desktopbackend.cxx
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -198,7 +198,7 @@ OUString xdg_user_dir_lookup (const char *type)
continue;
if (relative)
{
- aUserDirBuf = OUStringBuffer(aHomeDirURL + "/");
+ aUserDirBuf = aHomeDirURL + "/";
}
else
{
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index a2c740b948ce..9fa92591f04f 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1963,8 +1963,11 @@ static bool ImplIsValidTimePortion( bool _bSkipInvalidCharacters, const OUString
static bool ImplCutTimePortion( OUStringBuffer& _rStr, sal_Int32 _nSepPos, bool _bSkipInvalidCharacters, short* _pPortion )
{
OUString sPortion(_rStr.getStr(), _nSepPos );
- _rStr = _nSepPos < _rStr.getLength()
- ? _rStr.copy( _nSepPos + 1 ) : OUStringBuffer();
+
+ if (_nSepPos < _rStr.getLength())
+ _rStr = _rStr.copy(_nSepPos + 1);
+ else
+ _rStr.truncate();
if ( !ImplIsValidTimePortion( _bSkipInvalidCharacters, sPortion ) )
return false;
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index fc4e3021f4d0..46eb2bdfd237 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1962,7 +1962,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice,
sal_Int32 nEraseChars = std::max<sal_Int32>(4, aStr.getLength() - (nIndex*4)/3);
while( nEraseChars < aStr.getLength() && _rLayout.GetTextWidth( aTmpStr.toString(), 0, aTmpStr.getLength() ) > nMaxWidth )
{
- aTmpStr = OUStringBuffer(aStr);
+ aTmpStr = aStr;
sal_Int32 i = (aTmpStr.getLength() - nEraseChars)/2;
aTmpStr.remove(i, nEraseChars++);
aTmpStr.insert(i, "...");