summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-05-26 10:58:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-05-28 19:44:08 +0200
commitef513fd4b049b214a03fbe6e62a5ea43680a7a9b (patch)
tree82f2ce93bc8e5fde6dce8685b633c3d643c9f069 /comphelper
parent826f1bca40a01f0a249d5b6cbb7c39c11638a060 (diff)
remove unnecessary use of OString::getStr
Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/documentinfo.cxx12
-rw-r--r--comphelper/source/misc/mimeconfighelper.cxx34
-rw-r--r--comphelper/source/misc/scopeguard.cxx3
3 files changed, 19 insertions, 30 deletions
diff --git a/comphelper/source/misc/documentinfo.cxx b/comphelper/source/misc/documentinfo.cxx
index 4c2700c3f2f5..e309da6d74ed 100644
--- a/comphelper/source/misc/documentinfo.cxx
+++ b/comphelper/source/misc/documentinfo.cxx
@@ -147,17 +147,11 @@ namespace comphelper {
catch ( const Exception& )
{
css::uno::Any caught( ::cppu::getCaughtException() );
- OString sMessage( "caught an exception!" );
- sMessage += "\ntype : ";
- sMessage += OString( caught.getValueTypeName().getStr(), caught.getValueTypeName().getLength(), osl_getThreadTextEncoding() );
- sMessage += "\nmessage: ";
css::uno::Exception exception;
caught >>= exception;
- sMessage += OString( exception.Message.getStr(), exception.Message.getLength(), osl_getThreadTextEncoding() );
- sMessage += "\nin function:\n";
- sMessage += OSL_THIS_FUNC;
- sMessage += "\n";
- OSL_FAIL( sMessage.getStr() );
+ SAL_WARN( "comphelper", "caught an exception!\ntype : " << caught.getValueTypeName()
+ << "\nmessage: " << exception.Message
+ << "\nin function:\n" << OSL_THIS_FUNC);
}
return sTitle;
diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx
index b4d05a5fcd48..14e42fb9a022 100644
--- a/comphelper/source/misc/mimeconfighelper.cxx
+++ b/comphelper/source/misc/mimeconfighelper.cxx
@@ -84,30 +84,26 @@ uno::Sequence< sal_Int8 > MimeConfigurationHelper::GetSequenceClassIDRepresentat
if ( nLength == 36 )
{
OString aCharClassID = OUStringToOString( aClassID, RTL_TEXTENCODING_ASCII_US );
- const sal_Char* pString = aCharClassID.getStr();
- if ( pString )
- {
- uno::Sequence< sal_Int8 > aResult( 16 );
-
- sal_Int32 nStrPointer = 0;
- sal_Int32 nSeqInd = 0;
- while( nSeqInd < 16 && nStrPointer + 1 < nLength )
- {
- sal_uInt8 nDigit1 = GetDigit_Impl( pString[nStrPointer++] );
- sal_uInt8 nDigit2 = GetDigit_Impl( pString[nStrPointer++] );
+ uno::Sequence< sal_Int8 > aResult( 16 );
- if ( nDigit1 > 15 || nDigit2 > 15 )
- break;
+ sal_Int32 nStrPointer = 0;
+ sal_Int32 nSeqInd = 0;
+ while( nSeqInd < 16 && nStrPointer + 1 < nLength )
+ {
+ sal_uInt8 nDigit1 = GetDigit_Impl( aCharClassID[nStrPointer++] );
+ sal_uInt8 nDigit2 = GetDigit_Impl( aCharClassID[nStrPointer++] );
- aResult[nSeqInd++] = (sal_Int8)( nDigit1 * 16 + nDigit2 );
+ if ( nDigit1 > 15 || nDigit2 > 15 )
+ break;
- if ( nStrPointer < nLength && pString[nStrPointer] == '-' )
- nStrPointer++;
- }
+ aResult[nSeqInd++] = (sal_Int8)( nDigit1 * 16 + nDigit2 );
- if ( nSeqInd == 16 && nStrPointer == nLength )
- return aResult;
+ if ( nStrPointer < nLength && aCharClassID[nStrPointer] == '-' )
+ nStrPointer++;
}
+
+ if ( nSeqInd == 16 && nStrPointer == nLength )
+ return aResult;
}
return uno::Sequence< sal_Int8 >();
diff --git a/comphelper/source/misc/scopeguard.cxx b/comphelper/source/misc/scopeguard.cxx
index 6eeb7c8e166c..99e70581024b 100644
--- a/comphelper/source/misc/scopeguard.cxx
+++ b/comphelper/source/misc/scopeguard.cxx
@@ -33,8 +33,7 @@ ScopeGuard::~ScopeGuard()
}
catch (css::uno::Exception & exc) {
(void) exc; // avoid warning about unused variable
- OSL_FAIL( OUStringToOString( "UNO exception occurred: " + exc.Message,
- RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_WARN( "comphelper", "UNO exception occurred: " << exc.Message );
}
catch (...) {
OSL_FAIL( "unknown exception occurred!" );