[Libreoffice-commits] core.git: cppcanvas/source idl/inc include/filter include/tools sc/inc sc/source starmath/source svl/source sw/source vcl/source

Noel Grandin noel at peralex.com
Wed Feb 12 20:45:45 CET 2014


 cppcanvas/source/inc/implrenderer.hxx |    4 ++--
 idl/inc/bastype.hxx                   |    2 +-
 include/filter/msfilter/mstoolbar.hxx |    2 +-
 include/tools/stream.hxx              |   24 ------------------------
 sc/inc/bigrange.hxx                   |    2 +-
 sc/source/filter/inc/formel.hxx       |   12 ++++++------
 sc/source/filter/inc/lotimpop.hxx     |   18 +++++++++---------
 sc/source/filter/inc/xlescher.hxx     |   11 +++++------
 starmath/source/eqnolefilehdr.hxx     |   16 ++++++++--------
 svl/source/inc/poolio.hxx             |    6 +++---
 sw/source/filter/ww8/ww8scan.cxx      |   16 ++++++++--------
 vcl/source/filter/wmf/enhwmf.cxx      |   12 ++++++++++++
 12 files changed, 56 insertions(+), 69 deletions(-)

New commits:
commit 0c7f35277575fee8594737f5b2842dfac2c6d04f
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Feb 7 11:53:18 2014 +0200

    remove SvStream::operator>> methods
    
    in favour of ReadXXX methods.
    
    Change-Id: Ic2c0a7b6b92ff4c236ae99b39d77f3d935b301e3
    Reviewed-on: https://gerrit.libreoffice.org/7915
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx
index 1d76ed7..1762645 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -164,8 +164,8 @@ static float GetSwapFloat( SvStream& rSt )
                     rXForm.eDx = GetSwapFloat( rIn );
                     rXForm.eDy = GetSwapFloat( rIn );
 #else
-                    rIn >> rXForm.eM11 >> rXForm.eM12 >> rXForm.eM21 >> rXForm.eM22
-                        >> rXForm.eDx >> rXForm.eDy;
+                    rIn.ReadFloat( rXForm.eM11 ).ReadFloat( rXForm.eM12 ).ReadFloat( rXForm.eM21 ).ReadFloat( rXForm.eM22 )
+                       .ReadFloat( rXForm.eDx ).ReadFloat( rXForm.eDy );
 #endif
                 }
                 return rIn;
diff --git a/idl/inc/bastype.hxx b/idl/inc/bastype.hxx
index 4c7b2da..94d6d40 100644
--- a/idl/inc/bastype.hxx
+++ b/idl/inc/bastype.hxx
@@ -65,7 +65,7 @@ public:
     friend SvStream& WriteSvint(SvStream & rStm, const Svint & r )
                 { SvUINT32::Write( rStm, (sal_uInt32)r.nVal ); rStm.WriteUInt8( r.bSet ); return rStm; }
     friend SvStream& operator >> (SvStream & rStm, Svint & r )
-                { r.nVal = (int)SvUINT32::Read( rStm ); rStm >> r.bSet ; return rStm; }
+                { r.nVal = (int)SvUINT32::Read( rStm ); rStm.ReadUChar( r.bSet ); return rStm; }
 };
 
 
diff --git a/include/filter/msfilter/mstoolbar.hxx b/include/filter/msfilter/mstoolbar.hxx
index f258783..f4d6c37 100644
--- a/include/filter/msfilter/mstoolbar.hxx
+++ b/include/filter/msfilter/mstoolbar.hxx
@@ -310,7 +310,7 @@ public:
     sal_Int16 top;
     sal_Int16 right;
     sal_Int16 bottom;
-    bool Read( SvStream &rS ) { rS >> left >> top >> right >> bottom; return true; }
+    bool Read( SvStream &rS ) { rS.ReadInt16( left ).ReadInt16( top ).ReadInt16( right ).ReadInt16( bottom ); return true; }
     void Print( FILE* fo );
 };
 
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 81ef96f..546cf99 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -300,30 +300,6 @@ public:
                         { eLineDelimiter = eLineEnd; }
     LineEnd         GetLineDelimiter() const { return eLineDelimiter; }
 
-    SvStream&       operator>>( sal_uInt16& rUInt16 )
-                        { return ReadUInt16(rUInt16); }
-    SvStream&       operator>>( sal_uInt32& rUInt32 )
-                        { return ReadUInt32(rUInt32); }
-    SvStream&       operator>>( sal_uInt64& rUInt64 )
-                        { return ReadUInt64(rUInt64); }
-    SvStream&       operator>>( sal_Int16& rInt16 )
-                        { return ReadInt16(rInt16); }
-    SvStream&       operator>>( sal_Int32& rInt32 )
-                        { return ReadInt32(rInt32); }
-    SvStream&       operator>>( sal_Int64& rInt64 ) SAL_DELETED_FUNCTION;
-    SvStream&       operator>>( signed char& rChar )
-                        { return ReadSChar(rChar); }
-    SvStream&       operator>>( char& rChar )
-                        { return ReadChar(rChar); }
-    SvStream&       operator>>( unsigned char& rChar )
-                        { return ReadUChar(rChar); }
-    SvStream&       operator>>( float& rFloat )
-                        { return ReadFloat(rFloat); }
-    SvStream&       operator>>( double& rDouble )
-                        { return ReadDouble(rDouble); }
-    SvStream&       operator>>( SvStream& rStream )
-                        { return ReadStream(rStream); }
-
     SvStream&       ReadUInt16( sal_uInt16& rUInt16 );
     SvStream&       ReadUInt32( sal_uInt32& rUInt32 );
     SvStream&       ReadUInt64( sal_uInt64& rUInt64 );
diff --git a/sc/inc/bigrange.hxx b/sc/inc/bigrange.hxx
index 5166d83..b301011 100644
--- a/sc/inc/bigrange.hxx
+++ b/sc/inc/bigrange.hxx
@@ -140,7 +140,7 @@ inline SvStream& WriteScBigAddress( SvStream& rStream, const ScBigAddress& rAdr
 
 inline SvStream& ReadScBigAddress( SvStream& rStream, ScBigAddress& rAdr )
 {
-    rStream >> rAdr.nCol >> rAdr.nRow >> rAdr.nTab;
+    rStream.ReadInt32( rAdr.nCol ).ReadInt32( rAdr.nRow ).ReadInt32( rAdr.nTab );
     return rStream;
 }
 
diff --git a/sc/source/filter/inc/formel.hxx b/sc/source/filter/inc/formel.hxx
index faf61b7..f397067 100644
--- a/sc/source/filter/inc/formel.hxx
+++ b/sc/source/filter/inc/formel.hxx
@@ -146,37 +146,37 @@ inline void LotusConverterBase::Ignore( const long nSeekRel )
 
 inline void LotusConverterBase::Read( sal_Char& nByte )
 {
-    aIn >> nByte;
+    aIn.ReadChar( nByte );
     nBytesLeft--;
 }
 
 inline void LotusConverterBase::Read( sal_uInt8& nByte )
 {
-    aIn >> nByte;
+    aIn.ReadUChar( nByte );
     nBytesLeft--;
 }
 
 inline void LotusConverterBase::Read( sal_uInt16& nUINT16 )
 {
-    aIn >> nUINT16;
+    aIn.ReadUInt16( nUINT16 );
     nBytesLeft -= 2;
 }
 
 inline void LotusConverterBase::Read( sal_Int16& nINT16 )
 {
-    aIn >> nINT16;
+    aIn.ReadInt16( nINT16 );
     nBytesLeft -= 2;
 }
 
 inline void LotusConverterBase::Read( double& fDouble )
 {
-    aIn >> fDouble;
+    aIn.ReadDouble( fDouble );
     nBytesLeft -= 8;
 }
 
 inline void LotusConverterBase::Read( sal_uInt32& nUINT32 )
 {
-    aIn >> nUINT32;
+    aIn.ReadUInt32( nUINT32 );
     nBytesLeft -= 4;
 }
 
diff --git a/sc/source/filter/inc/lotimpop.hxx b/sc/source/filter/inc/lotimpop.hxx
index ed1c492..5b7fbe0 100644
--- a/sc/source/filter/inc/lotimpop.hxx
+++ b/sc/source/filter/inc/lotimpop.hxx
@@ -90,12 +90,12 @@ public:
 inline void ImportLotus::Read( ScAddress& rAddr )
 {
     sal_uInt16 nRow;
-    *pIn >> nRow;
+    pIn->ReadUInt16( nRow );
     rAddr.SetRow( static_cast<SCROW>(nRow) );
     sal_uInt8 nByte;
-    *pIn >> nByte;
+    pIn->ReadUChar( nByte );
     rAddr.SetTab( static_cast<SCTAB>(nByte) );
-    *pIn >> nByte;
+    pIn->ReadUChar( nByte );
     rAddr.SetCol( static_cast<SCCOL>(nByte) );
 }
 
@@ -109,31 +109,31 @@ inline void ImportLotus::Read( ScRange& rRange )
 
 inline void ImportLotus::Read( sal_Char& r )
 {
-    *pIn >> r;
+    pIn->ReadChar( r );
 }
 
 
 inline void ImportLotus::Read( sal_uInt8& r )
 {
-    *pIn >> r;
+    pIn->ReadUChar( r );
 }
 
 
 inline void ImportLotus::Read( sal_uInt16& r )
 {
-    *pIn >> r;
+    pIn->ReadUInt16( r );
 }
 
 
 inline void ImportLotus::Read( sal_Int16& r )
 {
-    *pIn >> r;
+    pIn->ReadInt16( r );
 }
 
 
 inline void ImportLotus::Read( sal_uInt32& r )
 {
-    *pIn >> r;
+    pIn->ReadUInt32( r );
 }
 
 
@@ -145,7 +145,7 @@ inline void ImportLotus::Read( double& r )
 
 inline void ImportLotus::Read( LotAttrWK3& r )
 {
-    *pIn >> r.nFont >> r.nFontCol >> r.nBack >> r.nLineStyle;
+    pIn->ReadUChar( r.nFont ).ReadUChar( r.nFontCol ).ReadUChar( r.nBack ).ReadUChar( r.nLineStyle );
 }
 
 
diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx
index 498fb1c..f99c602 100644
--- a/sc/source/filter/inc/xlescher.hxx
+++ b/sc/source/filter/inc/xlescher.hxx
@@ -304,16 +304,15 @@ struct XclObjAnchor : public XclRange
 };
 
 
-template< typename StreamType >
-StreamType& operator>>( StreamType& rStrm, XclObjAnchor& rAnchor )
+inline SvStream& operator>>( SvStream& rStrm, XclObjAnchor& rAnchor )
 {
     sal_uInt16 tmpFirstRow, tmpTY, tmpLastRow, tmpBY;
 
     rStrm
-        >> rAnchor.maFirst.mnCol >> rAnchor.mnLX
-        >> tmpFirstRow >> tmpTY
-        >> rAnchor.maLast.mnCol  >> rAnchor.mnRX
-        >> tmpLastRow  >> tmpBY;
+       .ReadUInt16( rAnchor.maFirst.mnCol ).ReadUInt16( rAnchor.mnLX )
+       .ReadUInt16( tmpFirstRow ).ReadUInt16( tmpTY )
+       .ReadUInt16( rAnchor.maLast.mnCol ).ReadUInt16( rAnchor.mnRX )
+       .ReadUInt16( tmpLastRow ).ReadUInt16( tmpBY );
 
     rAnchor.maFirst.mnRow = static_cast<sal_uInt32> (tmpFirstRow);
     rAnchor.mnTY = static_cast<sal_uInt32> (tmpTY);
diff --git a/starmath/source/eqnolefilehdr.hxx b/starmath/source/eqnolefilehdr.hxx
index 000a72b..e2704b8 100644
--- a/starmath/source/eqnolefilehdr.hxx
+++ b/starmath/source/eqnolefilehdr.hxx
@@ -47,14 +47,14 @@ public:
 
     inline void Read(SvStorageStream *pS)
     {
-        *pS >> nCBHdr;
-        *pS >> nVersion;
-        *pS >> nCf;
-        *pS >> nCBObject;
-        *pS >> nReserved1;
-        *pS >> nReserved2;
-        *pS >> nReserved3;
-        *pS >> nReserved4;
+        pS->ReadUInt16( nCBHdr );
+        pS->ReadUInt32( nVersion );
+        pS->ReadUInt16( nCf );
+        pS->ReadUInt32( nCBObject );
+        pS->ReadUInt32( nReserved1 );
+        pS->ReadUInt32( nReserved2 );
+        pS->ReadUInt32( nReserved3 );
+        pS->ReadUInt32( nReserved4 );
     }
     inline void Write(SvStorageStream *pS)
     {
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index 53c0de0..9bb29f9 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -150,7 +150,7 @@ struct SfxItemPool_Impl
 
 #define CHECK_FILEFORMAT( rStream, nTag ) \
     {   sal_uInt16 nFileTag; \
-        rStream >> nFileTag; \
+        rStream.ReadUInt16( nFileTag ); \
         if ( nTag != nFileTag ) \
         { \
             OSL_FAIL( #nTag ); /*! s.u. */ \
@@ -163,7 +163,7 @@ struct SfxItemPool_Impl
 
 #define CHECK_FILEFORMAT_RELEASE( rStream, nTag, pPointer ) \
    {   sal_uInt16 nFileTag; \
-       rStream >> nFileTag; \
+       rStream.ReadUInt16( nFileTag ); \
        if ( nTag != nFileTag ) \
         { \
            OSL_FAIL( #nTag ); /*! s.u. */ \
@@ -177,7 +177,7 @@ struct SfxItemPool_Impl
 
 #define CHECK_FILEFORMAT2( rStream, nTag1, nTag2 ) \
     {   sal_uInt16 nFileTag; \
-        rStream >> nFileTag; \
+        rStream.ReadUInt16( nFileTag ); \
         if ( nTag1 != nFileTag && nTag2 != nFileTag ) \
         { \
             OSL_FAIL( #nTag1 ); /*! s.u. */ \
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 8c60135..d6edbcd 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -79,20 +79,20 @@ namespace
         documents) where in error 8bit strings are used instead of 16bits
         strings for style names.
     */
-    template<typename C> bool TestBeltAndBraces(SvStream& rStrm)
+    bool TestBeltAndBraces(SvStream& rStrm)
     {
         bool bRet = false;
         sal_uInt32 nOldPos = rStrm.Tell();
-        C nBelt(0);
-        rStrm >> nBelt;
-        nBelt *= sizeof(C);
-        if (rStrm.good() && (rStrm.remainingSize() >= (nBelt + sizeof(C))))
+        sal_Unicode nBelt(0);
+        rStrm.ReadUInt16( nBelt );
+        nBelt *= sizeof(sal_Unicode);
+        if (rStrm.good() && (rStrm.remainingSize() >= (nBelt + sizeof(sal_Unicode))))
         {
             rStrm.SeekRel(nBelt);
             if (rStrm.good())
             {
-                C cBraces(0);
-                rStrm >> cBraces;
+                sal_Unicode cBraces(0);
+                rStrm.ReadUInt16( cBraces );
                 if (rStrm.good() && cBraces == 0)
                     bRet = true;
             }
@@ -6085,7 +6085,7 @@ WW8_STD* WW8Style::Read1Style( short& rSkip, OUString* pString, short* pcbStd )
                 case 8:
                     // handle Unicode-String with leading length short and
                     // trailing zero
-                    if (TestBeltAndBraces<sal_Unicode>(rSt))
+                    if (TestBeltAndBraces(rSt))
                     {
                         *pString = read_uInt16_BeltAndBracesString(rSt);
                         rSkip -= (pString->getLength() + 2) * 2;
diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index 53c5bdc..c06497b 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -398,6 +398,18 @@ void EnhWMFReader::ReadAndDrawPolyLine()
     }
 }
 
+// these are referenced from inside the templates
+
+SvStream& operator>>(SvStream& rStream, sal_Int16 &n)
+{
+    return rStream.ReadInt16(n);
+}
+
+SvStream& operator>>(SvStream& rStream, sal_Int32 &n)
+{
+    return rStream.ReadInt32(n);
+}
+
 /**
  * Reads a poly polygon from the WMF file and draws it.
  * The \<class T> parameter refers to the type of the points. (e.g. sal_uInt16 or sal_uInt32)


More information about the Libreoffice-commits mailing list