diff options
32 files changed, 116 insertions, 92 deletions
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index bf73df07ec35..b6385180f532 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -368,16 +368,16 @@ sal_Bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { aParams.clear(); sal_uInt16 nParam; - aComment = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, + aComment = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); - aHelpFile = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, + aHelpFile = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); rStrm.ReadUInt32( nHelpId ).ReadUInt16( nParam ); while( nParam-- ) { sal_uInt16 nType, nFlags; sal_uInt32 nUserData = 0; - OUString aName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, + OUString aName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); rStrm.ReadUInt16( nType ).ReadUInt16( nFlags ); if( nVer > 1 ) diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx index 7c40c7868b4f..267a252f1901 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx @@ -302,7 +302,7 @@ sal_Bool SbxStdCollection::LoadData( SvStream& rStrm, sal_uInt16 nVer ) sal_Bool bRes = SbxCollection::LoadData( rStrm, nVer ); if( bRes ) { - aElemClass = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, + aElemClass = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); rStrm.ReadUChar( bAddRemoveOk ); } diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index 7095294d5abb..135fcc4c069c 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -635,8 +635,8 @@ sal_Bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer ) } sal_uInt32 nSize; OUString aDfltProp; - aClassName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, RTL_TEXTENCODING_ASCII_US); - aDfltProp = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, RTL_TEXTENCODING_ASCII_US); + aClassName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); + aDfltProp = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); sal_uIntPtr nPos = rStrm.Tell(); rStrm.ReadUInt32( nSize ); if( !LoadPrivateData( rStrm, nVer ) ) diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 25c3d652b7eb..5245d86b90d5 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -1420,7 +1420,7 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) case SbxSINGLE: { // Floats as ASCII - OUString aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(r, + OUString aVal = read_uInt16_lenPrefixed_uInt8s_ToOUString(r, RTL_TEXTENCODING_ASCII_US); double d; SbxDataType t; @@ -1436,7 +1436,7 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) case SbxDOUBLE: { // Floats as ASCII - OUString aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(r, + OUString aVal = read_uInt16_lenPrefixed_uInt8s_ToOUString(r, RTL_TEXTENCODING_ASCII_US); SbxDataType t; if( ImpScan( aVal, aData.nDouble, t, NULL ) != SbxERR_OK ) @@ -1464,7 +1464,7 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) } case SbxSTRING: { - OUString aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(r, + OUString aVal = read_uInt16_lenPrefixed_uInt8s_ToOUString(r, RTL_TEXTENCODING_ASCII_US); if( !aVal.isEmpty() ) aData.pOUString = new OUString( aVal ); diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index bc60b86549f6..fa1e66a487ae 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -512,7 +512,7 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { return sal_False; } - maName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, + maName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); sal_uInt32 nTemp; rStrm.ReadUInt32( nTemp ); @@ -522,7 +522,7 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { rStrm.SeekRel( -1L ); rStrm.ReadUInt16( nType ); - maName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, + maName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); sal_uInt32 nTemp; rStrm.ReadUInt32( nTemp ); @@ -548,7 +548,7 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) case SbxSINGLE: { // Floats as ASCII - aTmpString = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>( + aTmpString = read_uInt16_lenPrefixed_uInt8s_ToOUString( rStrm, RTL_TEXTENCODING_ASCII_US); double d; SbxDataType t; @@ -564,7 +564,7 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) case SbxDOUBLE: { // Floats as ASCII - aTmpString = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, + aTmpString = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); SbxDataType t; if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK ) @@ -575,7 +575,7 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) break; } case SbxSTRING: - aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, + aVal = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); break; case SbxEMPTY: diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 29a0a87d67c1..0c91733ac868 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -1312,7 +1312,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) ContentInfo* pC = CreateAndInsertContent(); // The Text... - OString aByteString = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStream); + OString aByteString = read_uInt16_lenPrefixed_uInt8s_ToOString(rIStream); pC->SetText(OStringToOUString(aByteString, eSrcEncoding)); // StyleName and Family... diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx index 40ae0ddd68ce..5c1bb40b9652 100644 --- a/idl/source/objects/bastype.cxx +++ b/idl/source/objects/bastype.cxx @@ -220,7 +220,7 @@ SvStream& WriteSvIdentifier(SvStream & rStm, const SvIdentifier & r ) SvStream& operator >> (SvStream & rStm, SvIdentifier & r ) { - r.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm)); + r.setString(read_uInt16_lenPrefixed_uInt8s_ToOString(rStm)); return rStm; } @@ -333,7 +333,7 @@ SvStream& WriteSvString(SvStream & rStm, const SvString & r ) SvStream& operator >> (SvStream & rStm, SvString & r ) { - r.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm)); + r.setString(read_uInt16_lenPrefixed_uInt8s_ToOString(rStm)); return rStm; } diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx index 170053a857ed..2d3b9c5c7075 100644 --- a/idl/source/objects/module.cxx +++ b/idl/source/objects/module.cxx @@ -57,9 +57,9 @@ void SvMetaModule::Load( SvPersistStream & rStm ) rStm >> aAttrList; // browser aIdlFileName = rStm.ReadUniOrByteString( rStm.GetStreamCharSet() ); - aHelpFileName.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm)); - aSlotIdFile.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm)); - aModulePrefix.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm)); + aHelpFileName.setString(read_uInt16_lenPrefixed_uInt8s_ToOString(rStm)); + aSlotIdFile.setString(read_uInt16_lenPrefixed_uInt8s_ToOString(rStm)); + aModulePrefix.setString(read_uInt16_lenPrefixed_uInt8s_ToOString(rStm)); // read compiler data sal_uInt16 nCmpLen; diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx index 55592dc6ee54..606e48ca6818 100644 --- a/idl/source/objects/object.cxx +++ b/idl/source/objects/object.cxx @@ -44,7 +44,7 @@ void SvClassElement::Load( SvPersistStream & rStm ) return; } if( nMask & 0x01 ) rStm >> aAutomation; - if( nMask & 0x02 ) aPrefix = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm); + if( nMask & 0x02 ) aPrefix = read_uInt16_lenPrefixed_uInt8s_ToOString(rStm); if( nMask & 0x04 ) { SvMetaClass * p; diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index b964f0f7ad54..c7a69a9ad176 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -1772,7 +1772,7 @@ void SvMetaEnumValue::Load( SvPersistStream & rStm ) OSL_FAIL( "wrong format" ); return; } - if( nMask & 0x01 ) aEnumValue = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm); + if( nMask & 0x01 ) aEnumValue = read_uInt16_lenPrefixed_uInt8s_ToOString(rStm); } void SvMetaEnumValue::Save( SvPersistStream & rStm ) @@ -1829,7 +1829,7 @@ void SvMetaTypeEnum::Load( SvPersistStream & rStm ) return; } if( nMask & 0x01 ) rStm >> aEnumValueList; - if( nMask & 0x02 ) aPrefix = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm); + if( nMask & 0x02 ) aPrefix = read_uInt16_lenPrefixed_uInt8s_ToOString(rStm); } void SvMetaTypeEnum::Save( SvPersistStream & rStm ) diff --git a/include/tools/inetmsg.hxx b/include/tools/inetmsg.hxx index 1f9e47715e71..0e954ca82792 100644 --- a/include/tools/inetmsg.hxx +++ b/include/tools/inetmsg.hxx @@ -73,8 +73,8 @@ public: friend SvStream& ReadINetMessageHeader ( SvStream& rStrm, INetMessageHeader& rHdr) { - rHdr.m_aName = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStrm); - rHdr.m_aValue = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStrm); + rHdr.m_aName = read_uInt16_lenPrefixed_uInt8s_ToOString(rStrm); + rHdr.m_aValue = read_uInt16_lenPrefixed_uInt8s_ToOString(rStrm); return rStrm; } }; diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index 670416376293..81ef96f86361 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -550,11 +550,17 @@ TOOLS_DLLPUBLIC OUString read_uInt16s_ToOUString(SvStream& rStrm, /// Attempt to read a pascal-style length (of type prefix) prefixed sequence of /// 16bit units to an OUString, returned OString's length is number of /// units successfully read. -template<typename prefix> -OUString read_lenPrefixed_uInt16s_ToOUString(SvStream& rStrm) +TOOLS_DLLPUBLIC inline OUString read_uInt16_lenPrefixed_uInt16s_ToOUString(SvStream& rStrm) { - prefix nUnits = 0; - rStrm >> nUnits; + sal_uInt16 nUnits = 0; + rStrm.ReadUInt16( nUnits ); + return read_uInt16s_ToOUString(rStrm, nUnits); +} + +TOOLS_DLLPUBLIC inline OUString read_uInt32_lenPrefixed_uInt16s_ToOUString(SvStream& rStrm) +{ + sal_uInt32 nUnits = 0; + rStrm.ReadUInt32( nUnits ); return read_uInt16s_ToOUString(rStrm, nUnits); } @@ -595,21 +601,39 @@ TOOLS_DLLPUBLIC OUString read_zeroTerminated_uInt8s_ToOUString(SvStream& rStrm, /// Attempt to read a pascal-style length (of type prefix) prefixed sequence of /// 8bit units to an OString, returned OString's length is number of units /// successfully read. -template<typename prefix> -OString read_lenPrefixed_uInt8s_ToOString(SvStream& rStrm) +TOOLS_DLLPUBLIC inline OString read_uInt16_lenPrefixed_uInt8s_ToOString(SvStream& rStrm) +{ + sal_uInt16 nUnits = 0; + rStrm.ReadUInt16( nUnits ); + return read_uInt8s_ToOString(rStrm, nUnits); +} + +TOOLS_DLLPUBLIC inline OString read_uInt8_lenPrefixed_uInt8s_ToOString(SvStream& rStrm) { - prefix nUnits = 0; - rStrm >> nUnits; + sal_uInt8 nUnits = 0; + rStrm.ReadUChar( nUnits ); + return read_uInt8s_ToOString(rStrm, nUnits); +} + +TOOLS_DLLPUBLIC inline OString read_uInt32_lenPrefixed_uInt8s_ToOString(SvStream& rStrm) +{ + sal_uInt32 nUnits = 0; + rStrm.ReadUInt32( nUnits ); return read_uInt8s_ToOString(rStrm, nUnits); } /// Attempt to read a pascal-style length (of type prefix) prefixed sequence of /// 8bit units to an OUString -template<typename prefix> -OUString read_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm, +TOOLS_DLLPUBLIC inline OUString read_uInt16_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm, + rtl_TextEncoding eEnc) +{ + return OStringToOUString(read_uInt16_lenPrefixed_uInt8s_ToOString(rStrm), eEnc); +} + +TOOLS_DLLPUBLIC inline OUString read_uInt8_lenPrefixed_uInt8s_ToOUString(SvStream& rStrm, rtl_TextEncoding eEnc) { - return OStringToOUString(read_lenPrefixed_uInt8s_ToOString<prefix>(rStrm), eEnc); + return OStringToOUString(read_uInt8_lenPrefixed_uInt8s_ToOString(rStrm), eEnc); } /// Attempt to write a prefixed sequence of nUnits 8bit units from an OString, diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index 2243ba4e900a..31d1c567ca7c 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -749,7 +749,7 @@ bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) // --- from 680/dr25 on: store strings as UTF-8 if (nVer >= AUTOFORMAT_ID_680DR25) { - aName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStream, + aName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStream, RTL_TEXTENCODING_UTF8); } else diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 37ce783a90fa..fdb812e92b9d 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -247,24 +247,24 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) sal_uInt16 nTemp16; - rDesign.m_aDesignName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, + rDesign.m_aDesignName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); rIn.ReadUInt16( nTemp16 ); rDesign.m_eMode = (HtmlPublishMode)nTemp16; rIn.ReadUChar( rDesign.m_bContentPage ); rIn.ReadUChar( rDesign.m_bNotes ); rIn.ReadUInt16( rDesign.m_nResolution ); - rDesign.m_aCompression = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, + rDesign.m_aCompression = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); rIn.ReadUInt16( nTemp16 ); rDesign.m_eFormat = (PublishingFormat)nTemp16; - rDesign.m_aAuthor = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, + rDesign.m_aAuthor = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); - rDesign.m_aEMail = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, + rDesign.m_aEMail = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); - rDesign.m_aWWW = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, + rDesign.m_aWWW = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); - rDesign.m_aMisc = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, + rDesign.m_aMisc = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); rIn.ReadUChar( rDesign.m_bDownload ); rIn.ReadUChar( rDesign.m_bCreated ); // not used @@ -280,9 +280,9 @@ SvStream& operator >> (SvStream& rIn, SdPublishingDesign& rDesign) rIn.ReadUInt16( nTemp16 ); rDesign.m_eScript = (PublishingScript)nTemp16; - rDesign.m_aURL = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, + rDesign.m_aURL = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); - rDesign.m_aCGI = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, + rDesign.m_aCGI = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); rIn.ReadUChar( rDesign.m_bAutoSlide ); diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 51e36cf714c8..9d3e66ab648c 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -3160,7 +3160,7 @@ OUString UCBStorage::GetLinkedFile( SvStream &rStream ) rStream.ReadUInt32( nBytes ); if( nBytes == 0x04034b50 ) { - OString aTmp = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream); + OString aTmp = read_uInt16_lenPrefixed_uInt8s_ToOString(rStream); if (aTmp.match("ContentURL=")) { aString = OStringToOUString(aTmp.copy(11), RTL_TEXTENCODING_UTF8); diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx index e35cdc60a254..49bb28e02ce8 100644 --- a/svl/source/items/cntwall.cxx +++ b/svl/source/items/cntwall.cxx @@ -70,7 +70,7 @@ CntWallpaperItem::CntWallpaperItem( sal_uInt16 which, SvStream& rStream, sal_uIn _aURL = readUnicodeString(rStream, false); // "Read" SfxWallpaperItem's string member _aFilter. - read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream); + read_uInt16_lenPrefixed_uInt8s_ToOString(rStream); } } diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 21e88751e2b7..3b873527a3ab 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -1919,7 +1919,7 @@ void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter, OUString SvNumberformat::LoadString( SvStream& rStream ) { rtl_TextEncoding eStream = rStream.GetStreamCharSet(); - OString aStr = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream); + OString aStr = read_uInt16_lenPrefixed_uInt8s_ToOString(rStream); sal_Char cStream = NfCurrencyEntry::GetEuroSymbol( eStream ); if (aStr.indexOf(cStream) < 0) { diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 16ca08ce81ff..a1d619ab2918 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -1160,7 +1160,7 @@ SvStream& ReadGraphicObject( SvStream& rIStm, GraphicObject& rGraphicObj ) if( bLink ) { - OUString aLink = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStm, RTL_TEXTENCODING_UTF8); + OUString aLink = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStm, RTL_TEXTENCODING_UTF8); rGraphicObj.SetLink(aLink); } else diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index c2c18fc7d68e..9cf2a4f493de 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -118,10 +118,10 @@ void IMapObject::Read( SvStream& rIStm, const OUString& rBaseURL ) rIStm.SeekRel( 2 ); rIStm.ReadUInt16( nReadVersion ); rIStm.ReadUInt16( nTextEncoding ); - aURL = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStm, nTextEncoding); - aAltText = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStm, nTextEncoding); + aURL = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStm, nTextEncoding); + aAltText = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStm, nTextEncoding); rIStm.ReadUChar( bActive ); - aTarget = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStm, nTextEncoding); + aTarget = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStm, nTextEncoding); // make URL absolute aURL = URIHelper::SmartRel2Abs( INetURLObject(rBaseURL), aURL, URIHelper::GetMaybeFileHdl(), true, false, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS ); @@ -136,7 +136,7 @@ void IMapObject::Read( SvStream& rIStm, const OUString& rBaseURL ) // from version 5 onwards an objectname could be available if ( nReadVersion >= 0x0005 ) - aName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStm, nTextEncoding); + aName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStm, nTextEncoding); } delete pCompat; @@ -991,10 +991,10 @@ void ImageMap::Read( SvStream& rIStm, const OUString& rBaseURL ) // read on version rIStm.SeekRel( 2 ); - aName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStm, osl_getThreadTextEncoding()); - read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStm); // Dummy + aName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStm, osl_getThreadTextEncoding()); + read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); // Dummy rIStm.ReadUInt16( nCount ); - read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStm); // Dummy + read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); // Dummy pCompat = new IMapCompat( rIStm, STREAM_READ ); diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 0175162dc874..732d8c16c5c7 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -211,7 +211,7 @@ void SgaObject::ReadData(SvStream& rIn, sal_uInt16& rReadVersion ) ReadGDIMetaFile( rIn, aThumbMtf ); } - OUString aTmpStr = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, RTL_TEXTENCODING_UTF8); + OUString aTmpStr = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); aURL = INetURLObject(aTmpStr); } @@ -308,10 +308,10 @@ void SgaObjectBmp::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) SgaObject::ReadData( rIn, rReadVersion ); rIn.SeekRel( 10 ); // 16, 16, 32, 16 - read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIn); //dummy + read_uInt16_lenPrefixed_uInt8s_ToOString(rIn); //dummy if( rReadVersion >= 5 ) - aTitle = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, RTL_TEXTENCODING_UTF8); + aTitle = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); } DBG_NAME(SgaObjectSound) @@ -385,7 +385,7 @@ void SgaObjectSound::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) rIn.ReadUInt16( nTmp16 ); eSoundType = (GalSoundType) nTmp16; if( rReadVersion >= 6 ) - aTitle = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, RTL_TEXTENCODING_UTF8); + aTitle = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); } } @@ -538,7 +538,7 @@ void SgaObjectSvDraw::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) SgaObject::ReadData( rIn, rReadVersion ); if( rReadVersion >= 5 ) - aTitle = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIn, RTL_TEXTENCODING_UTF8); + aTitle = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIn, RTL_TEXTENCODING_UTF8); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 0549d7f5cd91..fdf793a6958e 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -706,7 +706,7 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, sa { sal_uInt32 nThemeId = 0; - OString aTmpStr = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(*pIStm); + OString aTmpStr = read_uInt16_lenPrefixed_uInt8s_ToOString(*pIStm); aThemeName = OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); // execute a charakter conversion @@ -1384,7 +1384,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) rtl_TextEncoding nTextEncoding; rIStm.ReadUInt16( nVersion ); - OString aTmpStr = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStm); + OString aTmpStr = read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); rIStm.ReadUInt32( nCount ); if( nVersion >= 0x0004 ) @@ -1424,7 +1424,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) sal_uInt16 nTemp; rIStm.ReadUChar( bRel ); - OString aTempFileName = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStm); + OString aTempFileName = read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); rIStm.ReadUInt32( pObj->nOffset ); rIStm.ReadUInt16( nTemp ); pObj->eObjKind = (SgaObjKind) nTemp; diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index c5bdc95c1abf..8c601355183a 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -1891,7 +1891,7 @@ Err: OUString read_uInt8_BeltAndBracesString(SvStream& rStrm, rtl_TextEncoding eEnc) { - OUString aRet = read_lenPrefixed_uInt8s_ToOUString<sal_uInt8>(rStrm, eEnc); + OUString aRet = read_uInt8_lenPrefixed_uInt8s_ToOUString(rStrm, eEnc); rStrm.SeekRel(sizeof(sal_uInt8)); // skip null-byte at end return aRet; } @@ -3821,7 +3821,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen rArray.push_back(read_uInt16_PascalString(rStrm)); else { - OString aTmp = read_lenPrefixed_uInt8s_ToOString<sal_uInt8>(rStrm); + OString aTmp = read_uInt8_lenPrefixed_uInt8s_ToOString(rStrm); rArray.push_back(OStringToOUString(aTmp, eCS)); } @@ -3852,7 +3852,7 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen pValueArray->push_back(read_uInt16_PascalString(rStrm)); else { - OString aTmp = read_lenPrefixed_uInt8s_ToOString<sal_uInt8>(rStrm); + OString aTmp = read_uInt8_lenPrefixed_uInt8s_ToOString(rStrm); pValueArray->push_back(OStringToOUString(aTmp, eCS)); } } diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 50d5e5854a80..d83790bd727e 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -122,12 +122,12 @@ public: //by string contents inline OUString read_uInt8_PascalString(SvStream& rStrm, rtl_TextEncoding eEnc) { - return read_lenPrefixed_uInt8s_ToOUString<sal_uInt8>(rStrm, eEnc); + return read_uInt8_lenPrefixed_uInt8s_ToOUString(rStrm, eEnc); } inline OUString read_uInt16_PascalString(SvStream& rStrm) { - return read_lenPrefixed_uInt16s_ToOUString<sal_uInt16>(rStrm); + return read_uInt16_lenPrefixed_uInt16s_ToOUString(rStrm); } //Belt and Braces strings, i.e. Pascal-style strings followed by diff --git a/tools/qa/cppunit/test_stream.cxx b/tools/qa/cppunit/test_stream.cxx index 8389bcc1fb33..57c30e506eae 100644 --- a/tools/qa/cppunit/test_stream.cxx +++ b/tools/qa/cppunit/test_stream.cxx @@ -173,7 +173,7 @@ namespace char foo[] = "\3foobar"; SvMemoryStream aMemStream(foo, SAL_N_ELEMENTS(foo)-1, STREAM_READ); - OString aFoo = read_lenPrefixed_uInt8s_ToOString<sal_uInt8>(aMemStream); + OString aFoo = read_uInt8_lenPrefixed_uInt8s_ToOString(aMemStream); CPPUNIT_ASSERT(aFoo == "foo"); CPPUNIT_ASSERT(aMemStream.good()); CPPUNIT_ASSERT(!aMemStream.bad()); @@ -181,7 +181,7 @@ namespace aMemStream.Seek(0); foo[0] = 10; - aFoo = read_lenPrefixed_uInt8s_ToOString<sal_uInt8>(aMemStream); + aFoo = read_uInt8_lenPrefixed_uInt8s_ToOString(aMemStream); CPPUNIT_ASSERT(aFoo == "foobar"); CPPUNIT_ASSERT(!aMemStream.good()); CPPUNIT_ASSERT(!aMemStream.bad()); @@ -191,7 +191,7 @@ namespace aMemStream.Seek(0); foo[0] = 0; foo[1] = 3; - aFoo = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(aMemStream); + aFoo = read_uInt16_lenPrefixed_uInt8s_ToOString(aMemStream); CPPUNIT_ASSERT(aFoo == "oob"); CPPUNIT_ASSERT(aMemStream.good()); CPPUNIT_ASSERT(!aMemStream.bad()); @@ -203,7 +203,7 @@ namespace foo[1] = 0; foo[2] = 0; foo[3] = 0; - aFoo = read_lenPrefixed_uInt8s_ToOString<sal_uInt32>(aMemStream); + aFoo = read_uInt32_lenPrefixed_uInt8s_ToOString(aMemStream); CPPUNIT_ASSERT(aFoo == "bar"); CPPUNIT_ASSERT(aMemStream.good()); CPPUNIT_ASSERT(!aMemStream.bad()); diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 9d982e0bd4a5..4c239bc643b3 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -126,7 +126,7 @@ SvStream& INetMessage::operator>> (SvStream& rStrm) // Copy. rStrm.ReadUInt32( nTemp ); m_nDocSize = nTemp; - m_aDocName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, RTL_TEXTENCODING_UTF8); + m_aDocName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_UTF8); sal_uIntPtr i, n = 0; rStrm.ReadUInt32( nTemp ); @@ -1035,7 +1035,7 @@ SvStream& INetMIMEMessage::operator>> (SvStream& rStrm) m_nIndex[i] = nTemp; } - m_aBoundary = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStrm); + m_aBoundary = read_uInt16_lenPrefixed_uInt8s_ToOString(rStrm); rStrm.ReadUInt32( nTemp ); diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index bcd73c52ce2d..ea34d30fedf9 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1221,8 +1221,8 @@ OUString SvStream::ReadUniOrByteString( rtl_TextEncoding eSrcCharSet ) { // read UTF-16 string directly from stream ? if (eSrcCharSet == RTL_TEXTENCODING_UNICODE) - return read_lenPrefixed_uInt16s_ToOUString<sal_uInt32>(*this); - return read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(*this, eSrcCharSet); + return read_uInt32_lenPrefixed_uInt16s_ToOUString(*this); + return read_uInt16_lenPrefixed_uInt8s_ToOUString(*this, eSrcCharSet); } SvStream& SvStream::WriteUniOrByteString( const OUString& rStr, rtl_TextEncoding eDestCharSet ) diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 6b914d7dd8bb..b0e3a492ab83 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -792,7 +792,7 @@ SvStream& ReadAnimation( SvStream& rIStm, Animation& rAnimation ) rIStm.ReadUInt32( nTmp32 ); // Unused rIStm.ReadUInt32( nTmp32 ); // Unused rIStm.ReadUInt32( nTmp32 ); // Unused - read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStm); // Unused + read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); // Unused rIStm.ReadUInt16( nTmp16 ); // The rest to read rAnimation.Insert( aAnimBmp ); diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index 6cb0fd44d493..3df540f95d67 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -1304,7 +1304,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) sal_uInt8* pData; sal_Int32 nFollowingActionCount; - OString aComment = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStm); + OString aComment = read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); rIStm.ReadInt32( nValue ).ReadUInt32( nDataSize ); if( nDataSize ) diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx index 1ad4a4a8fbc0..044cde6977e2 100644 --- a/vcl/source/gdi/jobset.cxx +++ b/vcl/source/gdi/jobset.cxx @@ -283,8 +283,8 @@ SvStream& ReadJobSetup( SvStream& rIStream, JobSetup& rJobSetup ) rIStream.Seek( nFirstPos + sizeof( ImplOldJobSetupData ) + 4 + sizeof( Impl364JobSetupData ) + pJobData->mnDriverDataLen ); while( rIStream.Tell() < nFirstPos + nLen ) { - OUString aKey = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8); - OUString aValue = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8); + OUString aKey = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); + OUString aValue = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); if( aKey.equalsAscii( "COMPAT_DUPLEX_MODE" ) ) { if( aValue.equalsAscii( "DUPLEX_UNKNOWN" ) ) diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 09c4fccd300b..3c8b494ff542 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -1275,7 +1275,7 @@ void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) rIStm .ReadInt32( mnLen ); if ( aCompat.GetVersion() >= 2 ) // Version 2 - maStr = read_lenPrefixed_uInt16s_ToOUString<sal_uInt16>(rIStm); + maStr = read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm); } // ======================================================================== @@ -1455,7 +1455,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) if ( aCompat.GetVersion() >= 2 ) // Version 2 { - maStr = read_lenPrefixed_uInt16s_ToOUString<sal_uInt16>(rIStm); + maStr = read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm); if ( mnIndex + mnLen > maStr.getLength() ) { @@ -1551,7 +1551,7 @@ void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) rIStm .ReadInt32( mnLen ); if ( aCompat.GetVersion() >= 2 ) // Version 2 - maStr = read_lenPrefixed_uInt16s_ToOUString<sal_uInt16>(rIStm); + maStr = read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm); } // ======================================================================== @@ -1630,7 +1630,7 @@ void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) rIStm .ReadUInt16( mnStyle ); if ( aCompat.GetVersion() >= 2 ) // Version 2 - maStr = read_lenPrefixed_uInt16s_ToOUString<sal_uInt16>(rIStm); + maStr = read_uInt16_lenPrefixed_uInt16s_ToOUString(rIStm); } // ======================================================================== @@ -4224,7 +4224,7 @@ void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* ) { COMPAT( rIStm ); - maComment = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStm); + maComment = read_uInt16_lenPrefixed_uInt8s_ToOString(rIStm); rIStm.ReadInt32( mnValue ).ReadUInt32( mnDataSize ); SAL_INFO("vcl.gdi", "MetaCommentAction::Read " << maComment); diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index f0d9c59e77a8..4137c23ef85a 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -274,10 +274,10 @@ SvStream& ReadQueueInfo( SvStream& rIStream, QueueInfo& rInfo ) { VersionCompat aCompat( rIStream, STREAM_READ ); - rInfo.maPrinterName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8); - rInfo.maDriver = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8); - rInfo.maLocation = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8); - rInfo.maComment = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rIStream, RTL_TEXTENCODING_UTF8); + rInfo.maPrinterName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); + rInfo.maDriver = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); + rInfo.maLocation = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); + rInfo.maComment = read_uInt16_lenPrefixed_uInt8s_ToOUString(rIStream, RTL_TEXTENCODING_UTF8); rIStream.ReadUInt32( rInfo.mnStatus ); rIStream.ReadUInt32( rInfo.mnJobs ); diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index a3758f4b0dd1..86333f63e153 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -134,10 +134,10 @@ ImplFontAttrCache::ImplFontAttrCache( const OUString& rFileNameURL, const OUStri ImplDevFontAttributes aDFA; for(;;) { - aFontFileURL = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(aCacheFile, RTL_TEXTENCODING_UTF8); + aFontFileURL = read_uInt16_lenPrefixed_uInt8s_ToOUString(aCacheFile, RTL_TEXTENCODING_UTF8); if( aFontFileURL.isEmpty() ) break; - aDFA.SetFamilyName(read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(aCacheFile, RTL_TEXTENCODING_UTF8)); + aDFA.SetFamilyName(read_uInt16_lenPrefixed_uInt8s_ToOUString(aCacheFile, RTL_TEXTENCODING_UTF8)); short n; aCacheFile >> n; aDFA.SetWeight(static_cast<FontWeight>(n)); |