diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-01 12:24:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-02 07:48:21 +0000 |
commit | c0f9bdd3e644e3ebf690aff9eb1aeec4f16dbf27 (patch) | |
tree | e5bb6d31a17587452dde579803286f68ffc73672 /io/source/stm/omark.cxx | |
parent | 52360bf8dd567598593cb212ac85f0c919315618 (diff) |
unnecessary use of OUStringBuffer in throwing exceptions
Change-Id: Iec1473264426f19c31e72260dfce9494389e474f
Reviewed-on: https://gerrit.libreoffice.org/33788
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'io/source/stm/omark.cxx')
-rw-r--r-- | io/source/stm/omark.cxx | 48 |
1 files changed, 18 insertions, 30 deletions
diff --git a/io/source/stm/omark.cxx b/io/source/stm/omark.cxx index dc9fbb8b260a..551012f9b483 100644 --- a/io/source/stm/omark.cxx +++ b/io/source/stm/omark.cxx @@ -212,11 +212,9 @@ void OMarkableOutputStream::deleteMark(sal_Int32 Mark) map<sal_Int32,sal_Int32,less<sal_Int32> >::iterator ii = m_mapMarks.find( Mark ); if( ii == m_mapMarks.end() ) { - OUStringBuffer buf( 128 ); - buf.append( "MarkableOutputStream::deleteMark unknown mark (" ); - buf.append( Mark ); - buf.append( ")"); - throw IllegalArgumentException( buf.makeStringAndClear(), *this, 0); + throw IllegalArgumentException( + "MarkableOutputStream::deleteMark unknown mark (" + OUString::number(Mark) + ")", + *this, 0); } else { m_mapMarks.erase( ii ); @@ -230,11 +228,9 @@ void OMarkableOutputStream::jumpToMark(sal_Int32 nMark) map<sal_Int32,sal_Int32,less<sal_Int32> >::iterator ii = m_mapMarks.find( nMark ); if( ii == m_mapMarks.end() ) { - OUStringBuffer buf( 128 ); - buf.append( "MarkableOutputStream::jumpToMark unknown mark (" ); - buf.append( nMark ); - buf.append( ")"); - throw IllegalArgumentException( buf.makeStringAndClear(), *this, 0); + throw IllegalArgumentException( + "MarkableOutputStream::jumpToMark unknown mark (" + OUString::number(nMark) + ")", + *this, 0); } else { m_nCurrentPos = (*ii).second; @@ -256,11 +252,9 @@ sal_Int32 OMarkableOutputStream::offsetToMark(sal_Int32 nMark) if( ii == m_mapMarks.end() ) { - OUStringBuffer buf( 128 ); - buf.append( "MarkableOutputStream::offsetToMark unknown mark (" ); - buf.append( nMark ); - buf.append( ")"); - throw IllegalArgumentException( buf.makeStringAndClear(), *this, 0); + throw IllegalArgumentException( + "MarkableOutputStream::offsetToMark unknown mark (" + OUString::number(nMark) + ")", + *this, 0); } return m_nCurrentPos - (*ii).second; } @@ -650,11 +644,9 @@ void OMarkableInputStream::deleteMark(sal_Int32 Mark) map<sal_Int32,sal_Int32,less<sal_Int32> >::iterator ii = m_mapMarks.find( Mark ); if( ii == m_mapMarks.end() ) { - OUStringBuffer buf( 128 ); - buf.append( "MarkableInputStream::deleteMark unknown mark (" ); - buf.append( Mark ); - buf.append( ")"); - throw IllegalArgumentException( buf.makeStringAndClear(), *this , 0 ); + throw IllegalArgumentException( + "MarkableInputStream::deleteMark unknown mark (" + OUString::number(Mark) + ")", + *this , 0 ); } else { m_mapMarks.erase( ii ); @@ -669,11 +661,9 @@ void OMarkableInputStream::jumpToMark(sal_Int32 nMark) if( ii == m_mapMarks.end() ) { - OUStringBuffer buf( 128 ); - buf.append( "MarkableInputStream::jumpToMark unknown mark (" ); - buf.append( nMark ); - buf.append( ")"); - throw IllegalArgumentException( buf.makeStringAndClear(), *this , 0 ); + throw IllegalArgumentException( + "MarkableInputStream::jumpToMark unknown mark (" + OUString::number(nMark) + ")", + *this , 0 ); } else { @@ -695,11 +685,9 @@ sal_Int32 OMarkableInputStream::offsetToMark(sal_Int32 nMark) if( ii == m_mapMarks.end() ) { - OUStringBuffer buf( 128 ); - buf.append( "MarkableInputStream::offsetToMark unknown mark (" ); - buf.append( nMark ); - buf.append( ")"); - throw IllegalArgumentException( buf.makeStringAndClear(), *this , 0 ); + throw IllegalArgumentException( + "MarkableInputStream::offsetToMark unknown mark (" + OUString::number(nMark) + ")", + *this, 0 ); } return m_nCurrentPos - (*ii).second; } |