summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-09-02 23:15:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-09-05 10:54:19 +0100
commit2e28244ad3cf526b99b1e555526b26bf89c5ce8d (patch)
tree7f9a24da525ced2845e97d6a013576094d3a417a /svtools
parent5fc869912893826d615661fbd88bf9cdbd60690f (diff)
bIsCompressed is always false
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/filterutils.cxx38
1 files changed, 12 insertions, 26 deletions
diff --git a/svtools/source/misc/filterutils.cxx b/svtools/source/misc/filterutils.cxx
index 3f47efb48c2c..d0d481a81988 100644
--- a/svtools/source/misc/filterutils.cxx
+++ b/svtools/source/misc/filterutils.cxx
@@ -10,41 +10,27 @@ namespace svt
using namespace ::com::sun::star;
- rtl::OUString lcl_createStringFromArray( const char* pcCharArr, sal_uInt32 nBufSize, bool bIsCompressed )
+ rtl::OUString lcl_createStringFromArray( const char* pcCharArr, sal_uInt32 nBufSize )
{
rtl::OUStringBuffer aBuffer;
- if( bIsCompressed )
+ // buffer contains Little-Endian Unicode
+ sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufSize ) / 2;
+ aBuffer.setLength( nStrLen );
+ const char* pcCurrChar = pcCharArr;
+ for( sal_Int32 nChar = 0; nChar < nStrLen; ++nChar )
{
- // buffer contains compressed Unicode, not encoded bytestring
- sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufSize );
- aBuffer.setLength( nStrLen );
- const char* pcCurrChar = pcCharArr;
- for( sal_Int32 nChar = 0; nChar < nStrLen; ++nChar, ++pcCurrChar )
- /* *pcCurrChar may contain negative values and therefore MUST be
- casted to unsigned char, before assigned to a sal_Unicode. */
- aBuffer.setCharAt( nChar, static_cast< unsigned char >( *pcCurrChar ) );
- }
- else
- {
- // buffer contains Little-Endian Unicode
- sal_Int32 nStrLen = static_cast< sal_Int32 >( nBufSize ) / 2;
- aBuffer.setLength( nStrLen );
- const char* pcCurrChar = pcCharArr;
- for( sal_Int32 nChar = 0; nChar < nStrLen; ++nChar )
- {
- /* *pcCurrChar may contain negative values and therefore MUST be
- casted to unsigned char, before assigned to a sal_Unicode. */
- sal_Unicode cChar = static_cast< unsigned char >( *pcCurrChar++ );
- cChar |= (static_cast< unsigned char >( *pcCurrChar++ ) << 8);
- aBuffer.setCharAt( nChar, cChar );
- }
+ /* *pcCurrChar may contain negative values and therefore MUST be
+ casted to unsigned char, before assigned to a sal_Unicode. */
+ sal_Unicode cChar = static_cast< unsigned char >( *pcCurrChar++ );
+ cChar |= (static_cast< unsigned char >( *pcCurrChar++ ) << 8);
+ aBuffer.setCharAt( nChar, cChar );
}
return aBuffer.makeStringAndClear();
}
rtl::OUString BinFilterUtils::CreateOUStringFromUniStringArray( const char* pcCharArr, sal_uInt32 nBufSize )
{
- return lcl_createStringFromArray( pcCharArr, nBufSize, false );
+ return lcl_createStringFromArray( pcCharArr, nBufSize );
}
//........................................................................
} // namespace svt