diff options
Diffstat (limited to 'comphelper/source/misc/mimeconfighelper.cxx')
-rw-r--r-- | comphelper/source/misc/mimeconfighelper.cxx | 34 |
1 files changed, 15 insertions, 19 deletions
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 >(); |