diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-24 09:05:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-24 16:53:55 +0000 |
commit | 45350532879f8b33741fa1ac012aa43a776ebdf5 (patch) | |
tree | ef18a5e4ebff8f3097abc267b7f05ec7324d50cc /vcl | |
parent | all direct OUString readers are current little endian streams (diff) | |
download | core-45350532879f8b33741fa1ac012aa43a776ebdf5.tar.gz core-45350532879f8b33741fa1ac012aa43a776ebdf5.zip |
use read_lenPrefixed_uInt16s_ToOUString instead of hand-rolled loops
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/metaact.cxx | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 12113b7ec014..2d0c94c479ec 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -1283,18 +1283,7 @@ void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) rIStm >> mnLen; if ( aCompat.GetVersion() >= 2 ) // Version 2 - { - sal_uInt16 nLen(0); - rIStm >> nLen; - rtl::OUStringBuffer aBuffer(nLen); - while ( nLen-- ) - { - sal_uInt16 nChar; - rIStm >> nChar; - aBuffer.append(nChar); - } - maStr = aBuffer.makeStringAndClear(); - } + maStr = read_lenPrefixed_uInt16s_ToOUString<sal_uInt16>(rIStm); } // ======================================================================== @@ -1480,16 +1469,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) if ( aCompat.GetVersion() >= 2 ) // Version 2 { - sal_uInt16 nLen(0); - rIStm >> nLen; - rtl::OUStringBuffer aBuffer(nLen); - while ( nLen-- ) - { - sal_uInt16 nChar; - rIStm >> nChar; - aBuffer.append(nChar); - } - maStr = aBuffer.makeStringAndClear(); + maStr = read_lenPrefixed_uInt16s_ToOUString<sal_uInt16>(rIStm); if ( mnIndex + mnLen > maStr.getLength() ) { @@ -1591,18 +1571,7 @@ void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) rIStm >> mnLen; if ( aCompat.GetVersion() >= 2 ) // Version 2 - { - sal_uInt16 nLen(0); - rIStm >> nLen; - rtl::OUStringBuffer aBuffer(nLen); - while ( nLen-- ) - { - sal_uInt16 nChar; - rIStm >> nChar; - aBuffer.append(nChar); - } - maStr = aBuffer.makeStringAndClear(); - } + maStr = read_lenPrefixed_uInt16s_ToOUString<sal_uInt16>(rIStm); } // ======================================================================== @@ -1687,18 +1656,7 @@ void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) rIStm >> mnStyle; if ( aCompat.GetVersion() >= 2 ) // Version 2 - { - sal_uInt16 nLen(0); - rIStm >> nLen; - rtl::OUStringBuffer aBuffer(nLen); - while ( nLen-- ) - { - sal_uInt16 nChar; - rIStm >> nChar; - aBuffer.append(nChar); - } - maStr = aBuffer.makeStringAndClear(); - } + maStr = read_lenPrefixed_uInt16s_ToOUString<sal_uInt16>(rIStm); } // ======================================================================== |