summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-08 09:41:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-08 10:41:06 +0000
commit27a673ac52e02f921ae78d409d0becc85bb7f602 (patch)
tree42ec69c2708df550a425b58a536a14f78f140d57 /vcl
parent193ec57c899c6941675a86b7a24d6af60e410938 (diff)
coverity#1371289 Missing move assignment operator
Change-Id: Idc26faf904f0c89cfd66f53bb311d8ce9b41eaab
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/field2.cxx7
-rw-r--r--vcl/source/outdev/text.cxx2
2 files changed, 6 insertions, 3 deletions
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, "...");