diff options
author | Noel Grandin <noel@peralex.com> | 2014-01-16 12:40:11 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-01-22 22:00:39 +0000 |
commit | d803483f6a5938b0d0708b8db74b30c511dd8e31 (patch) | |
tree | 6f75da8815e03744e6ff94f3502a93c896e07bf0 /svl | |
parent | dd34ecba1048549d122a759cd5c7f743f5899d73 (diff) |
convert more SvStream::operator<< calls
.. to more explicit SvStream::Write* calls
This was done using another run of the clang rewriter, and then
a lot of hand tweaking to fix all the places where the rewriter
did not play nice with various macros.
Change-Id: I7bcab93851c8dfb59cde6bc76290c6484d88fb18
Reviewed-on: https://gerrit.libreoffice.org/7494
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/filerec/filerec.cxx | 8 | ||||
-rw-r--r-- | svl/source/items/cntwall.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/ctypeitm.cxx | 2 | ||||
-rw-r--r-- | svl/source/items/poolio.cxx | 48 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 14 |
5 files changed, 38 insertions, 38 deletions
diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx index a38a3466a282..bec5a6fcc144 100644 --- a/svl/source/filerec/filerec.cxx +++ b/svl/source/filerec/filerec.cxx @@ -43,15 +43,15 @@ static void lclWriteMiniHeader(SvStream *p, sal_uInt32 nPreTag, sal_uInt32 nStartPos, sal_uInt32 nEndPos) { - (*p) << ( sal_uInt32(nPreTag) | - sal_uInt32(nEndPos-nStartPos-SFX_REC_HEADERSIZE_MINI) << 8 ); + (*p).WriteUInt32( sal_uInt32(nPreTag) | + sal_uInt32(nEndPos-nStartPos-SFX_REC_HEADERSIZE_MINI) << 8 ); } static void lclWriteHeader(SvStream *p, sal_uInt32 nRecType, sal_uInt32 nContentTag, sal_uInt32 nContentVer) { - (*p) << ( sal_uInt32(nRecType) | + (*p).WriteUInt32( sal_uInt32(nRecType) | ( sal_uInt32(nContentVer) << 8 ) | - ( sal_uInt32(nContentTag) << 16 ) ); + ( sal_uInt32(nContentTag) << 16 ) ); } #define SFX_REC_CONTENT_HEADER(nContentVer,n1StStartPos,nCurStartPos) \ diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx index 731394df8a42..585e6bb08eea 100644 --- a/svl/source/items/cntwall.cxx +++ b/svl/source/items/cntwall.cxx @@ -115,13 +115,13 @@ SfxPoolItem* CntWallpaperItem::Create( SvStream& rStream, sal_uInt16 nVersion) c // ----------------------------------------------------------------------- SvStream& CntWallpaperItem::Store( SvStream& rStream, sal_uInt16 ) const { - rStream << CNTWALLPAPERITEM_STREAM_MAGIC; + rStream.WriteUInt32( CNTWALLPAPERITEM_STREAM_MAGIC ); writeUnicodeString(rStream, _aURL); // !!! Color stream operators do not work - they discard any // transparency info !!! // ??? Why the hell Color::Write(...) isn't const ??? (const_cast< CntWallpaperItem* >(this))->_nColor.Write( rStream, sal_True ); - rStream << _nStyle; + rStream.WriteUInt16( _nStyle ); return rStream; } diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx index 48509dbf9fb7..061f45913006 100644 --- a/svl/source/items/ctypeitm.cxx +++ b/svl/source/items/ctypeitm.cxx @@ -88,7 +88,7 @@ SvStream & CntContentTypeItem::Store(SvStream & rStream, sal_uInt16) const // CntContentTypeItem used to be derived from CntStringItem, so take that // into account: writeUnicodeString(rStream, GetValue()); - rStream << CNTSTRINGITEM_STREAM_MAGIC << sal_Bool(sal_False); + rStream.WriteUInt32( CNTSTRINGITEM_STREAM_MAGIC ).WriteUChar( sal_Bool(sal_False) ); return rStream; } diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index f63327b66558..0eb0add9ae54 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -117,15 +117,15 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const pImp->bStreaming = sal_True; if ( !pStoreMaster ) { - rStream << ( rStream.GetVersion() >= SOFFICE_FILEFORMAT_50 + rStream.WriteUInt16( rStream.GetVersion() >= SOFFICE_FILEFORMAT_50 ? SFX_ITEMPOOL_TAG_STARTPOOL_5 - : SFX_ITEMPOOL_TAG_STARTPOOL_4 ); - rStream << SFX_ITEMPOOL_VER_MAJOR << SFX_ITEMPOOL_VER_MINOR; - rStream << SFX_ITEMPOOL_TAG_TRICK4OLD; + : SFX_ITEMPOOL_TAG_STARTPOOL_4 ); + rStream.WriteUInt8( SFX_ITEMPOOL_VER_MAJOR ).WriteUInt8( SFX_ITEMPOOL_VER_MINOR ); + rStream.WriteUInt16( SFX_ITEMPOOL_TAG_TRICK4OLD ); // SfxStyleSheet-Bug umgehen - rStream << sal_uInt16(0); // Version - rStream << sal_uInt16(0); // Count (2. Schleife f"allt sonst auf die Fresse) + rStream.WriteUInt16( sal_uInt16(0) ); // Version + rStream.WriteUInt16( sal_uInt16(0) ); // Count (2. Schleife f"allt sonst auf die Fresse) } // jeder Pool ist als ganzes ein Record @@ -135,7 +135,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const // Einzel-Header (Version des Inhalts und Name) { SfxMiniRecordWriter aPoolHeaderRec( &rStream, SFX_ITEMPOOL_REC_HEADER); - rStream << pImp->nVersion; + rStream.WriteUInt16( pImp->nVersion ); SfxPoolItem::writeByteString(rStream, pImp->aName); } @@ -146,18 +146,18 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const { aVerRec.NewContent(); SfxPoolVersion_ImplPtr pVer = pImp->aVersions[nVerNo]; - rStream << pVer->_nVer << pVer->_nStart << pVer->_nEnd; + rStream.WriteUInt16( pVer->_nVer ).WriteUInt16( pVer->_nStart ).WriteUInt16( pVer->_nEnd ); sal_uInt16 nCount = pVer->_nEnd - pVer->_nStart + 1; sal_uInt16 nNewWhich = 0; for ( sal_uInt16 n = 0; n < nCount; ++n ) { nNewWhich = pVer->_pMap[n]; - rStream << nNewWhich; + rStream.WriteUInt16( nNewWhich ); } // Workaround gegen Bug in SetVersionMap der 312 if ( SOFFICE_FILEFORMAT_31 == pImp->mnFileFormatVersion ) - rStream << sal_uInt16(nNewWhich+1); + rStream.WriteUInt16( sal_uInt16(nNewWhich+1) ); } } @@ -189,11 +189,11 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const // eigene Kennung, globale Which-Id und Item-Version sal_uInt16 nSlotId = GetSlotId( (*ppDefItem)->Which(), sal_False ); aWhichIdsRec.NewContent(nSlotId, 0); - rStream << (*ppDefItem)->Which(); - rStream << nItemVersion; + rStream.WriteUInt16( (*ppDefItem)->Which() ); + rStream.WriteUInt16( nItemVersion ); const sal_uInt32 nCount = ::std::min<size_t>( (*itrArr)->size(), SAL_MAX_UINT32 ); DBG_ASSERT(nCount, "ItemArr is empty"); - rStream << nCount; + rStream.WriteUInt32( nCount ); // Items an sich schreiben SfxMultiMixRecordWriter aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS, 0 ); @@ -206,10 +206,10 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const aItemsRec.NewContent((sal_uInt16)j, 'X' ); if ( pItem->GetRefCount() == SFX_ITEMS_SPECIAL ) - rStream << (sal_uInt16) pItem->GetKind(); + rStream.WriteUInt16( (sal_uInt16) pItem->GetKind() ); else { - rStream << (sal_uInt16) pItem->GetRefCount(); + rStream.WriteUInt16( (sal_uInt16) pItem->GetRefCount() ); if( pItem->GetRefCount() > SFX_ITEMS_OLD_MAXREF ) rStream.SetError( ERRCODE_IO_NOTSTORABLEINBINARYFORMAT ); } @@ -258,8 +258,8 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const // eigene Kennung, globale Kennung, Version sal_uInt16 nSlotId = GetSlotId( pDefaultItem->Which(), sal_False ); aDefsRec.NewContent( nSlotId, 0 ); - rStream << pDefaultItem->Which(); - rStream << nItemVersion; + rStream.WriteUInt16( pDefaultItem->Which() ); + rStream.WriteUInt16( nItemVersion ); // Item an sich pDefaultItem->Store( rStream, nItemVersion ); @@ -1171,13 +1171,13 @@ bool SfxItemPool::StoreSurrogate if ( pItem ) { bool bRealSurrogate = IsItemFlag(*pItem, SFX_ITEM_POOLABLE); - rStream << ( bRealSurrogate + rStream.WriteUInt32( bRealSurrogate ? GetSurrogate( pItem ) - : SFX_ITEMS_DIRECT ); + : SFX_ITEMS_DIRECT ); return bRealSurrogate; } - rStream << SFX_ITEMS_NULL; + rStream.WriteUInt32( SFX_ITEMS_NULL ); return sal_True; } @@ -1510,16 +1510,16 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, if ( USHRT_MAX == nItemVersion ) return sal_False; - rStream << rItem.Which() << nSlotId; + rStream.WriteUInt16( rItem.Which() ).WriteUInt16( nSlotId ); if ( bDirect || !pPool->StoreSurrogate( rStream, &rItem ) ) { - rStream << nItemVersion; - rStream << (sal_uInt32) 0L; // Platz fuer Laenge in Bytes + rStream.WriteUInt16( nItemVersion ); + rStream.WriteUInt32( (sal_uInt32) 0L ); // Platz fuer Laenge in Bytes sal_uLong nIStart = rStream.Tell(); rItem.Store(rStream, nItemVersion); sal_uLong nIEnd = rStream.Tell(); rStream.Seek( nIStart-4 ); - rStream << (sal_Int32) ( nIEnd-nIStart ); + rStream.WriteInt32( (sal_Int32) ( nIEnd-nIStart ) ); rStream.Seek( nIEnd ); } diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index edb013775d3a..e24ac9c75888 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -791,8 +791,8 @@ bool SvNumberFormatter::Save( SvStream& rStream ) const ImpSvNumMultipleWriteHeader aHdr( rStream ); // As of 364i we store what SYSTEM locale really was, before it was hard // coded LANGUAGE_SYSTEM. - rStream << (sal_uInt16) SV_NUMBERFORMATTER_VERSION; - rStream << (sal_uInt16) SvtSysLocale().GetLanguageTag().getLanguageType() << (sal_uInt16) IniLnge; + rStream.WriteUInt16( (sal_uInt16) SV_NUMBERFORMATTER_VERSION ); + rStream.WriteUInt16( (sal_uInt16) SvtSysLocale().GetLanguageTag().getLanguageType() ).WriteUInt16( (sal_uInt16) IniLnge ); const SvNumberFormatTable* pTable = &aFTable; SvNumberFormatTable::const_iterator it = pTable->begin(); @@ -805,18 +805,18 @@ bool SvNumberFormatter::Save( SvStream& rStream ) const if ( pEntry->GetUsed() || (pEntry->GetType() & NUMBERFORMAT_DEFINED) || pEntry->GetNewStandardDefined() || (it->first % SV_COUNTRY_LANGUAGE_OFFSET == 0) ) { - rStream << it->first - << (sal_uInt16) LANGUAGE_SYSTEM - << (sal_uInt16) pEntry->GetLanguage(); + rStream.WriteUInt32( it->first ) + .WriteUInt16( (sal_uInt16) LANGUAGE_SYSTEM ) + .WriteUInt16( (sal_uInt16) pEntry->GetLanguage() ); pEntry->Save(rStream, aHdr); } ++it; } - rStream << NUMBERFORMAT_ENTRY_NOT_FOUND; // end marker + rStream.WriteUInt32( NUMBERFORMAT_ENTRY_NOT_FOUND ); // end marker // as of SV_NUMBERFORMATTER_VERSION_YEAR2000 aHdr.StartEntry(); - rStream << (sal_uInt16) GetYear2000(); + rStream.WriteUInt16( (sal_uInt16) GetYear2000() ); aHdr.EndEntry(); return rStream.GetError() ? false : true; |