diff options
author | Noel Grandin <noel@peralex.com> | 2014-02-05 10:41:04 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-02-12 15:31:40 +0000 |
commit | 15535e32ddcfee451d4dbc9be9de0b8c9f9d78d4 (patch) | |
tree | db4badc477cea1ecd51f5fab82ce0f24ae20f155 /filter | |
parent | 7accbd8c0d7f1d0b87748f0de599c4d8b469a61e (diff) |
convert SvStream::operator>> methods to ReadXXX methods
First, I updated the clang rewriter to do the conversion.
Then I lightly hand-tweaked the output for the few places where
the rewriter messed up, mostly when dealing with calls on "this".
Change-Id: I40a6a977959cd97415c678eafc8507de8aa3b1a9
Reviewed-on: https://gerrit.libreoffice.org/7879
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'filter')
20 files changed, 632 insertions, 641 deletions
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx index ff2f3e74e01b..5f3b43dc2659 100644 --- a/filter/source/graphicfilter/eos2met/eos2met.cxx +++ b/filter/source/graphicfilter/eos2met/eos2met.cxx @@ -566,11 +566,11 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap) // read header of the Windows-BMP file: aTemp.SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); aTemp.Seek(18); - aTemp >> nWidth >> nHeight; + aTemp.ReadUInt32( nWidth ).ReadUInt32( nHeight ); aTemp.SeekRel(2); - aTemp >> nBitsPerPixel; + aTemp.ReadUInt16( nBitsPerPixel ); aTemp.SeekRel(8); - aTemp >> nResX >> nResY; + aTemp.ReadUInt32( nResX ).ReadUInt32( nResY ); aTemp.SeekRel(8); nNumColors=1<<nBitsPerPixel; @@ -584,7 +584,7 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap) for (i=0; i<nNumColors; i++) { - aTemp >> nb >> ng >> nr; aTemp.SeekRel(1); + aTemp.ReadUChar( nb ).ReadUChar( ng ).ReadUChar( nr ); aTemp.SeekRel(1); aPal[ (sal_uInt16) i ] = BitmapColor( nr, ng, nb ); } diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 70cdef846230..18896b063a79 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -498,10 +498,10 @@ GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Boo sal_uInt32 nOrigPos = nPSStreamPos = rStream.Tell(); sal_uInt16 nOldFormat = rStream.GetNumberFormatInt(); rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - rStream >> nSignature; + rStream.ReadUInt32( nSignature ); if ( nSignature == 0xc6d3d0c5 ) { - rStream >> nPSStreamPos >> nPSSize >> nPosWMF >> nSizeWMF; + rStream.ReadUInt32( nPSStreamPos ).ReadUInt32( nPSSize ).ReadUInt32( nPosWMF ).ReadUInt32( nSizeWMF ); // first we try to get the metafile grafix @@ -516,7 +516,7 @@ GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Boo } else { - rStream >> nPosTIFF >> nSizeTIFF; + rStream.ReadUInt32( nPosTIFF ).ReadUInt32( nSizeTIFF ); // else we have to get the tiff grafix @@ -584,7 +584,7 @@ GraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem*, sal_Boo { while ( bIsValid && ( nBitsLeft != 7 ) ) { - rStream >> nByte; + rStream.ReadChar( nByte ); switch ( nByte ) { case 0x0a : diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index d85eb5d6dfb1..25feb0c196ca 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -728,7 +728,7 @@ Color OS2METReader::GetPaletteColor(sal_uInt32 nIndex) sal_uInt16 OS2METReader::ReadBigEndianWord() { sal_uInt8 nLo,nHi; - *pOS2MET >> nHi >> nLo; + pOS2MET->ReadUChar( nHi ).ReadUChar( nLo ); return (((sal_uInt16)nHi)<<8)|(((sal_uInt16)nLo)&0x00ff); } @@ -736,7 +736,7 @@ sal_uLong OS2METReader::ReadBigEndian3BytesLong() { sal_uInt16 nLo; sal_uInt8 nHi; - *pOS2MET >> nHi; + pOS2MET->ReadUChar( nHi ); nLo=ReadBigEndianWord(); return ((((sal_uLong)nHi)<<16)&0x00ff0000)|((sal_uLong)nLo); } @@ -745,7 +745,7 @@ sal_uLong OS2METReader::ReadLittleEndian3BytesLong() { sal_uInt8 nHi,nMed,nLo; - *pOS2MET >> nLo >> nMed >> nHi; + pOS2MET->ReadUChar( nLo ).ReadUChar( nMed ).ReadUChar( nHi ); return ((((sal_uLong)nHi)&0xff)<<16)|((((sal_uLong)nMed)&0xff)<<8)|(((sal_uLong)nLo)&0xff); } @@ -753,8 +753,8 @@ long OS2METReader::ReadCoord(sal_Bool b32) { sal_Int32 l; - if (b32) *pOS2MET >> l; - else { short s;*pOS2MET >> s; l=(sal_Int32)s; } + if (b32) pOS2MET->ReadInt32( l ); + else { short s;pOS2MET->ReadInt16( s ); l=(sal_Int32)s; } return l; } @@ -827,8 +827,8 @@ void OS2METReader::ReadRelLine(sal_Bool bGivenPos, sal_uInt16 nOrderLen) *pOS2MET >> nunsignedbyte; aP0.Y()+=(sal_Int8)nunsignedbyte; #else sal_Int8 nsignedbyte; - *pOS2MET >> nsignedbyte; aP0.X()+=(long)nsignedbyte; - *pOS2MET >> nsignedbyte; aP0.Y()-=(long)nsignedbyte; + pOS2MET->ReadSChar( nsignedbyte ); aP0.X()+=(long)nsignedbyte; + pOS2MET->ReadSChar( nsignedbyte ); aP0.Y()-=(long)nsignedbyte; #endif aCalcBndRect.Union(Rectangle(aP0,Size(1,1))); aPolygon.SetPoint(aP0,i); @@ -850,7 +850,7 @@ void OS2METReader::ReadBox(sal_Bool bGivenPos) Point P0; long nHRound,nVRound; - *pOS2MET >> nFlags; + pOS2MET->ReadUChar( nFlags ); pOS2MET->SeekRel(1); if ( bGivenPos ) @@ -912,7 +912,7 @@ void OS2METReader::ReadBitBlt() long nt; pOS2MET->SeekRel(4); - *pOS2MET >> nID; + pOS2MET->ReadUInt32( nID ); pOS2MET->SeekRel(4); aP1=ReadPoint(); aP2=ReadPoint(); if (aP1.X() > aP2.X()) { nt=aP1.X(); aP1.X()=aP2.X(); aP2.X()=nt; } @@ -954,7 +954,7 @@ void OS2METReader::ReadChrStr(sal_Bool bGivenPos, sal_Bool bMove, sal_Bool bExtr pOS2MET->SeekRel(2); ReadPoint( sal_False ); ReadPoint( sal_False ); - *pOS2MET >> nLen; + pOS2MET->ReadUInt16( nLen ); } else { @@ -967,7 +967,7 @@ void OS2METReader::ReadChrStr(sal_Bool bGivenPos, sal_Bool bMove, sal_Bool bExtr } pChr = new char[nLen+1]; for (i=0; i<nLen; i++) - *pOS2MET >> pChr[i]; + pOS2MET->ReadChar( pChr[i] ); pChr[nLen] = 0; OUString aStr( (const sal_Char*)pChr, strlen(pChr), osl_getThreadTextEncoding() ); SetRasterOp(aAttr.eChrMix); @@ -1062,8 +1062,8 @@ void OS2METReader::ReadFullArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize) if (nQ<0) nQ=-nQ; if (nR<0) nR=-nR; if (nS<0) nS=-nS; - if (nOrderSize>=4) *pOS2MET >> nMul; - else { *pOS2MET >> nMulS; nMul=((sal_uLong)nMulS)<<8; } + if (nOrderSize>=4) pOS2MET->ReadUInt32( nMul ); + else { pOS2MET->ReadUInt16( nMulS ); nMul=((sal_uLong)nMulS)<<8; } if (nMul!=0x00010000) { nP=(nP*nMul)>>16; nQ=(nQ*nMul)>>16; @@ -1112,8 +1112,8 @@ void OS2METReader::ReadPartialArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize) if (nQ<0) nQ=-nQ; if (nR<0) nR=-nR; if (nS<0) nS=-nS; - if (nOrderSize>=12) *pOS2MET >> nMul; - else { *pOS2MET >> nMulS; nMul=((sal_uLong)nMulS)<<8; } + if (nOrderSize>=12) pOS2MET->ReadUInt32( nMul ); + else { pOS2MET->ReadUInt16( nMulS ); nMul=((sal_uLong)nMulS)<<8; } if (nMul!=0x00010000) { nP=(nP*nMul)>>16; nQ=(nQ*nMul)>>16; @@ -1121,7 +1121,7 @@ void OS2METReader::ReadPartialArc(sal_Bool bGivenPos, sal_uInt16 nOrderSize) nS=(nS*nMul)>>16; } - *pOS2MET >> nStart >> nSweep; + pOS2MET->ReadInt32( nStart ).ReadInt32( nSweep ); fStart=((double)nStart)/65536.0/180.0*3.14159265359; fEnd=fStart+((double)nSweep)/65536.0/180.0*3.14159265359; aPStart=Point(aCenter.X()+(sal_Int32)( cos(fStart)*nP), @@ -1149,9 +1149,9 @@ void OS2METReader::ReadPolygons() Point aPoint; sal_uInt8 nFlags; - *pOS2MET >> nFlags >> nNumPolys; + pOS2MET->ReadUChar( nFlags ).ReadUInt32( nNumPolys ); for (i=0; i<nNumPolys; i++) { - *pOS2MET >> nNumPoints; + pOS2MET->ReadUInt32( nNumPoints ); if (i==0) nNumPoints++; aPoly.SetSize((short)nNumPoints); for (j=0; j<nNumPoints; j++) { @@ -1432,7 +1432,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) OSArea * p=new OSArea; p->bClosed=sal_False; p->pSucc=pAreaStack; pAreaStack=p; - *pOS2MET >> (p->nFlags); + pOS2MET->ReadUChar( p->nFlags ); p->aCol=aAttr.aPatCol; p->aBgCol=aAttr.aPatBgCol; p->eMix=aAttr.ePatMix; @@ -1479,7 +1479,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) OSPath * p=new OSPath; p->pSucc=pPathStack; pPathStack=p; pOS2MET->SeekRel(2); - *pOS2MET >> p->nID; + pOS2MET->ReadUInt32( p->nID ); p->bClosed=sal_False; p->bStroke=sal_False; break; @@ -1508,8 +1508,8 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) sal_uInt16 nDummy; OSPath* p = pPathList; - *pOS2MET >> nDummy - >> nID; + pOS2MET->ReadUInt16( nDummy ) + .ReadUInt32( nID ); if ( ! ( nDummy & 0x20 ) ) // #30933# i do not know the exact meaning of this bit, { // but if set it seems to be better not to fill this path @@ -1561,7 +1561,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) sal_uInt16 i,nC; OSPath* p=pPathList; pOS2MET->SeekRel(2); - *pOS2MET >> nID; + pOS2MET->ReadUInt32( nID ); while (p!=NULL && p->nID!=nID) p=p->pSucc; @@ -1585,7 +1585,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) sal_uInt32 nID; OSPath * p=pPathList; pOS2MET->SeekRel(2); - *pOS2MET >> nID; + pOS2MET->ReadUInt32( nID ); if (nID==0) p=NULL; while (p!=NULL && p->nID!=nID) p=p->pSucc; if (p!=NULL) pVirDev->SetClipRegion(Region(p->aPPoly)); @@ -1629,7 +1629,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) sal_uLong nVal; Color aCol; RasterOp eROP; - *pOS2MET >> nA >> nP >> nFlags; + pOS2MET->ReadUChar( nA ).ReadUChar( nP ).ReadUChar( nFlags ); if (nOrderID==GOrdPIvAtr) { pAttrStack->nIvAttrA=nA; pAttrStack->nIvAttrP=nP; @@ -1675,7 +1675,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) } } else { - *pOS2MET >> nMix; + pOS2MET->ReadUChar( nMix ); if (nMix==0) { switch (nP) { case 1: aAttr.eLinBgMix=aDefAttr.eLinBgMix; break; @@ -1703,7 +1703,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) sal_uInt8 nFlags; sal_uLong nVal; Color aCol; - *pOS2MET >> nFlags; + pOS2MET->ReadUChar( nFlags ); if ((nFlags&0x80)!=0) { aAttr.aLinCol=aDefAttr.aLinCol; aAttr.aChrCol=aDefAttr.aChrCol; @@ -1732,9 +1732,9 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) sal_uInt16 nVal; Color aCol; if (nOrderID==GOrdPColor || nOrderID==GOrdSColor) { - *pOS2MET >> nbyte; nVal=((sal_uInt16)nbyte)|0xff00; + pOS2MET->ReadUChar( nbyte ); nVal=((sal_uInt16)nbyte)|0xff00; } - else *pOS2MET >> nVal; + else pOS2MET->ReadUInt16( nVal ); if (nVal==0x0000 || nVal==0xff00) { aAttr.aLinCol=aDefAttr.aLinCol; aAttr.aChrCol=aDefAttr.aChrCol; @@ -1757,7 +1757,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdSBgCol: { sal_uInt16 nVal; Color aCol; - *pOS2MET >> nVal; + pOS2MET->ReadUInt16( nVal ); if (nVal==0x0000 || nVal==0xff00) { aAttr.aLinBgCol=aDefAttr.aLinBgCol; aAttr.aChrBgCol=aDefAttr.aChrBgCol; @@ -1780,7 +1780,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) sal_uInt8 nFlags; sal_uLong nVal; Color aCol; - *pOS2MET >> nFlags; + pOS2MET->ReadUChar( nFlags ); if ((nFlags&0x80)!=0) { aAttr.aLinBgCol=aDefAttr.aLinBgCol; aAttr.aChrBgCol=aDefAttr.aChrBgCol; @@ -1804,7 +1804,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdPMixMd: PushAttr(nOrderID); case GOrdSMixMd: { sal_uInt8 nMix; - *pOS2MET >> nMix; + pOS2MET->ReadUChar( nMix ); if (nMix==0) { aAttr.eLinMix=aDefAttr.eLinMix; aAttr.eChrMix=aDefAttr.eChrMix; @@ -1821,7 +1821,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdPBgMix: PushAttr(nOrderID); case GOrdSBgMix: { sal_uInt8 nMix; - *pOS2MET >> nMix; + pOS2MET->ReadUChar( nMix ); if (nMix==0) { aAttr.eLinBgMix=aDefAttr.eLinBgMix; aAttr.eChrBgMix=aDefAttr.eChrBgMix; @@ -1842,7 +1842,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdPPtSym: PushAttr(nOrderID); case GOrdSPtSym: { sal_uInt8 nPatt; - *pOS2MET >> nPatt; + pOS2MET->ReadUChar( nPatt ); aAttr.bFill = ( nPatt != 0x0f ); break; } @@ -1862,7 +1862,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdPLnTyp: PushAttr(nOrderID); case GOrdSLnTyp: { sal_uInt8 nType; - *pOS2MET >> nType; + pOS2MET->ReadUChar( nType ); switch (nType) { case 0: aAttr.eLinStyle=aDefAttr.eLinStyle; break; case 1: case 4: aAttr.eLinStyle=PEN_DOT; break; @@ -1876,7 +1876,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdPLnWdt: PushAttr(nOrderID); case GOrdSLnWdt: { sal_uInt8 nbyte; - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); if (nbyte==0) aAttr.nLinWidth=aDefAttr.nLinWidth; else aAttr.nLinWidth=(sal_uInt16)nbyte-1; break; @@ -1890,7 +1890,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) { sal_uInt8 nFlags; - *pOS2MET >> nFlags; + pOS2MET->ReadUChar( nFlags ); if ( nFlags & 0x80 ) aAttr.nStrLinWidth = aDefAttr.nStrLinWidth; else @@ -1913,7 +1913,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdPChSet: PushAttr(nOrderID); case GOrdSChSet: { - sal_uInt8 nbyte; *pOS2MET >> nbyte; + sal_uInt8 nbyte; pOS2MET->ReadUChar( nbyte ); aAttr.nChrSet=((sal_uLong)nbyte)&0xff; break; } @@ -1944,7 +1944,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) pOS2MET->SeekRel(4); nLen-=4; } if (nLen>=2) { - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); if ((nbyte&0x80)==0 && aAttr.aChrCellSize==Size(0,0)) aAttr.aChrCellSize=aDefAttr.aChrCellSize; } @@ -1965,7 +1965,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdPMkPrc: PushAttr(nOrderID); case GOrdSMkPrc: { sal_uInt8 nbyte; - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); if (nbyte==0) aAttr.nMrkPrec=aDefAttr.nMrkPrec; else aAttr.nMrkPrec=nbyte; break; @@ -1974,7 +1974,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdPMkSet: PushAttr(nOrderID); case GOrdSMkSet: { sal_uInt8 nbyte; - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); if (nbyte==0) aAttr.nMrkSet=aDefAttr.nMrkSet; else aAttr.nMrkSet=nbyte; break; @@ -1983,7 +1983,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) case GOrdPMkSym: PushAttr(nOrderID); case GOrdSMkSym: { sal_uInt8 nbyte; - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); if (nbyte==0) aAttr.nMrkSymbol=aDefAttr.nMrkSymbol; else aAttr.nMrkSymbol=nbyte; break; @@ -1997,7 +1997,7 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen) aAttr.aMrkCellSize.Height()=ReadCoord(bCoord32); if (bCoord32) nLen-=8; else nLen-=4; if (nLen>=2) { - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); if ((nbyte&0x80)==0 && aAttr.aMrkCellSize==Size(0,0)) aAttr.aMrkCellSize=aDefAttr.aMrkCellSize; } @@ -2041,7 +2041,7 @@ void OS2METReader::ReadDsc(sal_uInt16 nDscID, sal_uInt16 /*nDscLen*/) case 0x00f7: { // 'Specify GVM Subset' sal_uInt8 nbyte; pOS2MET->SeekRel(6); - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); if (nbyte==0x05) bCoord32=sal_True; else if (nbyte==0x04) bCoord32=sal_False; else { @@ -2058,7 +2058,7 @@ void OS2METReader::ReadDsc(sal_uInt16 nDscID, sal_uInt16 /*nDscLen*/) long x1,y1,x2,y2,nt,xr,yr; pOS2MET->SeekRel(2); - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); if (nbyte==0x05) b32=sal_True; @@ -2071,7 +2071,7 @@ void OS2METReader::ReadDsc(sal_uInt16 nDscID, sal_uInt16 /*nDscLen*/) ErrorCode=2; } - *pOS2MET >> nUnitType; + pOS2MET->ReadUChar( nUnitType ); xr=ReadCoord(b32); yr=ReadCoord(b32); @@ -2142,7 +2142,7 @@ void OS2METReader::ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen) case 0x0096: { // Image IDE-Size sal_uInt8 nbyte; - *pOS2MET >> nbyte; p->nBitsPerPixel=nbyte; + pOS2MET->ReadUChar( nbyte ); p->nBitsPerPixel=nbyte; break; } @@ -2223,11 +2223,11 @@ void OS2METReader::ReadFont(sal_uInt16 nFieldSize) nMaxPos=nPos+(sal_uLong)nFieldSize; pOS2MET->SeekRel(2); nPos+=2; while (nPos<nMaxPos && pOS2MET->GetError()==0) { - *pOS2MET >> nByte; nLen =((sal_uInt16)nByte) & 0x00ff; - *pOS2MET >> nTripType; + pOS2MET->ReadUChar( nByte ); nLen =((sal_uInt16)nByte) & 0x00ff; + pOS2MET->ReadUChar( nTripType ); switch (nTripType) { case 0x02: - *pOS2MET >> nTripType2; + pOS2MET->ReadUChar( nTripType2 ); switch (nTripType2) { case 0x84: // Font name break; @@ -2245,10 +2245,10 @@ void OS2METReader::ReadFont(sal_uInt16 nFieldSize) } break; case 0x24: // Icid - *pOS2MET >> nTripType2; + pOS2MET->ReadUChar( nTripType2 ); switch (nTripType2) { case 0x05: //Icid - *pOS2MET >> nByte; + pOS2MET->ReadUChar( nByte ); pF->nID=((sal_uLong)nByte)&0xff; break; } @@ -2258,7 +2258,7 @@ void OS2METReader::ReadFont(sal_uInt16 nFieldSize) case 0x1f: { // Font Attributes FontWeight eWeight; sal_uInt8 nbyte; - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); switch (nbyte) { case 1: eWeight=WEIGHT_THIN; break; case 2: eWeight=WEIGHT_ULTRALIGHT; break; @@ -2304,12 +2304,12 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize) nMaxPos=nPos+(sal_uLong)nFieldSize; pOS2MET->SeekRel(3); nPos+=3; while (nPos<nMaxPos && pOS2MET->GetError()==0) { - *pOS2MET >> nbyte; nElemLen=((sal_uInt16)nbyte) & 0x00ff; + pOS2MET->ReadUChar( nbyte ); nElemLen=((sal_uInt16)nbyte) & 0x00ff; if (nElemLen>11) { pOS2MET->SeekRel(4); nStartIndex=ReadBigEndianWord(); pOS2MET->SeekRel(3); - *pOS2MET >> nbyte; nBytesPerCol=((sal_uInt16)nbyte) & 0x00ff; + pOS2MET->ReadUChar( nbyte ); nBytesPerCol=((sal_uInt16)nbyte) & 0x00ff; nEndIndex=nStartIndex+(nElemLen-11)/nBytesPerCol; for (i=nStartIndex; i<nEndIndex; i++) { if (nBytesPerCol > 3) pOS2MET->SeekRel(nBytesPerCol-3); @@ -2338,7 +2338,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize) sal_uInt8 i,nbyte,nbyte2; pB->nID=0; for (i=0; i<4; i++) { - *pOS2MET >> nbyte >> nbyte2; + pOS2MET->ReadUChar( nbyte ).ReadUChar( nbyte2 ); nbyte=((nbyte-0x30)<<4)|(nbyte2-0x30); pB->nID=(pB->nID>>8)|(((sal_uLong)nbyte)<<24); } @@ -2384,15 +2384,15 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize) nPos=pOS2MET->Tell(); nMaxPos=nPos+(sal_uLong)nFieldSize; while (nPos<nMaxPos && pOS2MET->GetError()==0) { - *pOS2MET >> nbyte; nDataID=((sal_uInt16)nbyte)&0x00ff; + pOS2MET->ReadUChar( nbyte ); nDataID=((sal_uInt16)nbyte)&0x00ff; if (nDataID==0x00fe) { - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); nDataID=(nDataID<<8)|(((sal_uInt16)nbyte)&0x00ff); nDataLen=ReadBigEndianWord(); nPos+=4; } else { - *pOS2MET >> nbyte; nDataLen=((sal_uInt16)nbyte)&0x00ff; + pOS2MET->ReadUChar( nbyte ); nDataLen=((sal_uInt16)nbyte)&0x00ff; nPos+=2; } ReadImageData(nDataID, nDataLen); @@ -2427,7 +2427,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize) pOS2MET->Seek(0); // "Segment header": - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); if (nbyte==0x70) { // header exists pOS2MET->SeekRel(15); // but we don't need it } @@ -2435,9 +2435,9 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize) // loop through Order: while (pOS2MET->Tell()<nMaxPos && pOS2MET->GetError()==0) { - *pOS2MET >> nbyte; nOrderID=((sal_uInt16)nbyte) & 0x00ff; + pOS2MET->ReadUChar( nbyte ); nOrderID=((sal_uInt16)nbyte) & 0x00ff; if (nOrderID==0x00fe) { - *pOS2MET >> nbyte; + pOS2MET->ReadUChar( nbyte ); nOrderID=(nOrderID << 8) | (((sal_uInt16)nbyte) & 0x00ff); } if (nOrderID>0x00ff || nOrderID==GOrdPolygn) { @@ -2446,13 +2446,13 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize) // In reality there are files in which the length is stored as little endian word // (at least for nOrderID==GOrdPolygn) // So we throw a coin or what else can we do? - *pOS2MET >> nbyte; nOrderLen=(sal_uInt16)nbyte&0x00ff; - *pOS2MET >> nbyte; if (nbyte!=0) nOrderLen=nOrderLen<<8|(((sal_uInt16)nbyte)&0x00ff); + pOS2MET->ReadUChar( nbyte ); nOrderLen=(sal_uInt16)nbyte&0x00ff; + pOS2MET->ReadUChar( nbyte ); if (nbyte!=0) nOrderLen=nOrderLen<<8|(((sal_uInt16)nbyte)&0x00ff); } else if (nOrderID==GOrdSTxAlg || nOrderID==GOrdPTxAlg) nOrderLen=2; else if ((nOrderID&0xff88)==0x0008) nOrderLen=1; else if (nOrderID==0x0000 || nOrderID==0x00ff) nOrderLen=0; - else { *pOS2MET >> nbyte; nOrderLen=((sal_uInt16)nbyte) & 0x00ff; } + else { pOS2MET->ReadUChar( nbyte ); nOrderLen=((sal_uInt16)nbyte) & 0x00ff; } nPos=pOS2MET->Tell(); ReadOrder(nOrderID, nOrderLen); if (nPos+nOrderLen < pOS2MET->Tell()) { @@ -2479,8 +2479,8 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize) nMaxPos=pOS2MET->Tell()+(sal_uLong)nFieldSize; while (pOS2MET->Tell()<nMaxPos && pOS2MET->GetError()==0) { - *pOS2MET >> nbyte; nDscID =((sal_uInt16)nbyte) & 0x00ff; - *pOS2MET >> nbyte; nDscLen=((sal_uInt16)nbyte) & 0x00ff; + pOS2MET->ReadUChar( nbyte ); nDscID =((sal_uInt16)nbyte) & 0x00ff; + pOS2MET->ReadUChar( nbyte ); nDscLen=((sal_uInt16)nbyte) & 0x00ff; nPos=pOS2MET->Tell(); ReadDsc(nDscID, nDscLen); pOS2MET->Seek(nPos+nDscLen); @@ -2597,13 +2597,13 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF nFieldSize=ReadBigEndianWord(); - *pOS2MET >> nMagicByte; + pOS2MET->ReadUChar( nMagicByte ); if (nMagicByte!=0xd3) { pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR); ErrorCode=7; break; } - *pOS2MET >> nFieldType; + pOS2MET->ReadUInt16( nFieldType ); pOS2MET->SeekRel(3); nPos+=8; nFieldSize-=8; diff --git a/filter/source/graphicfilter/ipbm/ipbm.cxx b/filter/source/graphicfilter/ipbm/ipbm.cxx index ee9feb034890..a314f2b35f64 100644 --- a/filter/source/graphicfilter/ipbm/ipbm.cxx +++ b/filter/source/graphicfilter/ipbm/ipbm.cxx @@ -157,7 +157,7 @@ sal_Bool PBMReader::ImplReadHeader() sal_uInt8 nMax, nCount = 0; sal_Bool bFinished = sal_False; - mrPBM >> nID[ 0 ] >> nID[ 1 ]; + mrPBM.ReadUChar( nID[ 0 ] ).ReadUChar( nID[ 1 ] ); if ( nID[ 0 ] != 'P' ) return sal_False; mnMaxVal = mnWidth = mnHeight = 0; @@ -190,7 +190,7 @@ sal_Bool PBMReader::ImplReadHeader() if ( mrPBM.GetError() ) return sal_False; - mrPBM >> nDat; + mrPBM.ReadUChar( nDat ); if ( nDat == '#' ) { @@ -268,7 +268,7 @@ sal_Bool PBMReader::ImplReadBody() if ( --nShift < 0 ) { - mrPBM >> nDat; + mrPBM.ReadUChar( nDat ); nShift = 7; } mpAcc->SetPixelIndex( nHeight, nWidth, nDat >> nShift ); @@ -289,7 +289,7 @@ sal_Bool PBMReader::ImplReadBody() if ( mrPBM.IsEof() || mrPBM.GetError() ) return sal_False; - mrPBM >> nDat; + mrPBM.ReadUChar( nDat ); mpAcc->SetPixelIndex( nHeight, nWidth++, nDat); if ( nWidth == mnWidth ) @@ -310,7 +310,7 @@ sal_Bool PBMReader::ImplReadBody() sal_uInt8 nR, nG, nB; sal_uLong nRed, nGreen, nBlue; - mrPBM >> nR >> nG >> nB; + mrPBM.ReadUChar( nR ).ReadUChar( nG ).ReadUChar( nB ); nRed = 255 * nR / mnMaxVal; nGreen = 255 * nG / mnMaxVal; nBlue = 255 * nB / mnMaxVal; @@ -334,7 +334,7 @@ sal_Bool PBMReader::ImplReadBody() if ( mrPBM.IsEof() || mrPBM.GetError() ) return sal_False; - mrPBM >> nDat; + mrPBM.ReadUChar( nDat ); if ( nDat == '#' ) { @@ -395,7 +395,7 @@ sal_Bool PBMReader::ImplReadBody() if ( mrPBM.IsEof() || mrPBM.GetError() ) return sal_False; - mrPBM >> nDat; + mrPBM.ReadUChar( nDat ); if ( nDat == '#' ) { @@ -471,7 +471,7 @@ sal_Bool PBMReader::ImplReadBody() if ( mrPBM.IsEof() || mrPBM.GetError() ) return sal_False; - mrPBM >> nDat; + mrPBM.ReadUChar( nDat ); if ( nDat == '#' ) { diff --git a/filter/source/graphicfilter/ipcd/ipcd.cxx b/filter/source/graphicfilter/ipcd/ipcd.cxx index b5be77d85f42..02b4db2701d6 100644 --- a/filter/source/graphicfilter/ipcd/ipcd.cxx +++ b/filter/source/graphicfilter/ipcd/ipcd.cxx @@ -188,7 +188,7 @@ void PCDReader::ReadOrientation() if ( bStatus == sal_False ) return; m_rPCD.Seek( 194635 ); - m_rPCD >> nOrientation; + m_rPCD.ReadUChar( nOrientation ); nOrientation &= 0x03; } diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx index 54579ff0aa74..5fbbe06574eb 100644 --- a/filter/source/graphicfilter/ipcx/ipcx.cxx +++ b/filter/source/graphicfilter/ipcx/ipcx.cxx @@ -152,15 +152,15 @@ void PCXReader::ImplReadHeader() sal_uInt16 nushort; sal_uInt16 nMinX,nMinY,nMaxX,nMaxY; - m_rPCX >> nbyte >> nVersion >> nEncoding; + m_rPCX.ReadUChar( nbyte ).ReadUChar( nVersion ).ReadUChar( nEncoding ); if ( nbyte!=0x0a || (nVersion != 0 && nVersion != 2 && nVersion != 3 && nVersion != 5) || nEncoding > 1 ) { nStatus = sal_False; return; } - m_rPCX >> nbyte; nBitsPerPlanePix = (sal_uLong)nbyte; - m_rPCX >> nMinX >> nMinY >> nMaxX >> nMaxY; + m_rPCX.ReadUChar( nbyte ); nBitsPerPlanePix = (sal_uLong)nbyte; + m_rPCX.ReadUInt16( nMinX ).ReadUInt16( nMinY ).ReadUInt16( nMaxX ).ReadUInt16( nMaxY ); if ((nMinX > nMaxX) || (nMinY > nMaxY)) { @@ -171,17 +171,17 @@ void PCXReader::ImplReadHeader() nWidth = nMaxX-nMinX+1; nHeight = nMaxY-nMinY+1; - m_rPCX >> nResX; - m_rPCX >> nResY; + m_rPCX.ReadUInt16( nResX ); + m_rPCX.ReadUInt16( nResY ); if ( nResX >= nWidth || nResY >= nHeight || ( nResX != nResY ) ) nResX = nResY = 0; ImplReadPalette( 16 ); m_rPCX.SeekRel( 1 ); - m_rPCX >> nbyte; nPlanes = (sal_uLong)nbyte; - m_rPCX >> nushort; nBytesPerPlaneLin = (sal_uLong)nushort; - m_rPCX >> nPaletteInfo; + m_rPCX.ReadUChar( nbyte ); nPlanes = (sal_uLong)nbyte; + m_rPCX.ReadUInt16( nushort ); nBytesPerPlaneLin = (sal_uLong)nushort; + m_rPCX.ReadUInt16( nPaletteInfo ); m_rPCX.SeekRel( 58 ); @@ -245,11 +245,11 @@ void PCXReader::ImplReadBody() } while ( nx > 0 ) { - m_rPCX >> nDat; + m_rPCX.ReadUChar( nDat ); if ( ( nDat & 0xc0 ) == 0xc0 ) { nCount =( (sal_uLong)nDat ) & 0x003f; - m_rPCX >> nDat; + m_rPCX.ReadUChar( nDat ); if ( nCount < nx ) { nx -= nCount; @@ -387,7 +387,7 @@ void PCXReader::ImplReadPalette( sal_uLong nCol ) sal_uInt8* pPtr = pPalette; for ( sal_uLong i = 0; i < nCol; i++ ) { - m_rPCX >> r >> g >> b; + m_rPCX.ReadUChar( r ).ReadUChar( g ).ReadUChar( b ); *pPtr++ = r; *pPtr++ = g; *pPtr++ = b; diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index d5aa1ef5569f..920248ddb5a6 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -89,7 +89,7 @@ namespace PictReaderInternal { // count the no of bits in pattern which are set to 1: nBitCount=0; for (ny=0; ny<8; ny++) { - stream >> ((char&)nbyte[ny]); + stream.ReadChar( (char&)nbyte[ny] ); for (nx=0; nx<8; nx++) { if ( (nbyte[ny] & (1<<nx)) != 0 ) nBitCount++; } @@ -358,7 +358,7 @@ Point PictReader::ReadPoint() { short nx,ny; - *pPict >> ny >> nx; + pPict->ReadInt16( ny ).ReadInt16( nx ); return Point( (long)nx - aBoundingRect.Left(), (long)ny - aBoundingRect.Top() ); @@ -368,7 +368,7 @@ Point PictReader::ReadDeltaH(Point aBase) { signed char ndh; - *pPict >> ((char&)ndh); + pPict->ReadChar( (char&)ndh ); return Point( aBase.X() + (long)ndh, aBase.Y() ); } @@ -377,7 +377,7 @@ Point PictReader::ReadDeltaV(Point aBase) { signed char ndv; - *pPict >> ((char&)ndv); + pPict->ReadChar( (char&)ndv ); return Point( aBase.X(), aBase.Y() + (long)ndv ); } @@ -386,7 +386,7 @@ Point PictReader::ReadUnsignedDeltaH(Point aBase) { sal_uInt8 ndh; - *pPict >> ndh; + pPict->ReadUChar( ndh ); return Point( aBase.X() + (long)ndh, aBase.Y() ); } @@ -395,7 +395,7 @@ Point PictReader::ReadUnsignedDeltaV(Point aBase) { sal_uInt8 ndv; - *pPict >> ndv; + pPict->ReadUChar( ndv ); return Point( aBase.X(), aBase.Y() + (long)ndv ); } @@ -404,7 +404,7 @@ Size PictReader::ReadSize() { short nx,ny; - *pPict >> ny >> nx; + pPict->ReadInt16( ny ).ReadInt16( nx ); return Size( (long)nx, (long)ny ); } @@ -414,7 +414,7 @@ Color PictReader::ReadColor() sal_uInt32 nCol; Color aCol; - *pPict >> nCol; + pPict->ReadUInt32( nCol ); switch (nCol) { case 33: aCol=Color( COL_BLACK ); break; @@ -435,7 +435,7 @@ Color PictReader::ReadRGBColor() { sal_uInt16 nR, nG, nB; - *pPict >> nR >> nG >> nB; + pPict->ReadUInt16( nR ).ReadUInt16( nG ).ReadUInt16( nB ); return Color( (sal_uInt8) ( nR >> 8 ), (sal_uInt8) ( nG >> 8 ), (sal_uInt8) ( nB >> 8 ) ); } @@ -455,7 +455,7 @@ sal_uLong PictReader::ReadPolygon(Polygon & rPoly) sal_uInt16 nSize,i; sal_uLong nDataSize; - *pPict >> nSize; + pPict->ReadUInt16( nSize ); pPict->SeekRel(8); nDataSize=(sal_uLong)nSize; nSize=(nSize-10)/4; @@ -475,7 +475,7 @@ sal_uLong PictReader::ReadPixPattern(PictReader::Pattern &pattern) sal_uInt16 nPatType; Bitmap aBMP; - *pPict >> nPatType; + pPict->ReadUInt16( nPatType ); if (nPatType==1) { pattern.read(*pPict); nDataSize=ReadPixMapEtc(aBMP,sal_False,sal_True,NULL,NULL,sal_False,sal_False); @@ -486,7 +486,7 @@ sal_uLong PictReader::ReadPixPattern(PictReader::Pattern &pattern) pattern.read(*pPict); // RGBColor sal_uInt16 nR, nG, nB; - *pPict >> nR >> nG >> nB; + pPict->ReadUInt16( nR ).ReadUInt16( nG ).ReadUInt16( nB ); Color col((sal_uInt8) ( nR >> 8 ), (sal_uInt8) ( nG >> 8 ), (sal_uInt8) ( nB >> 8 ) ); pattern.setColor(col); nDataSize=16; @@ -570,7 +570,7 @@ sal_uLong PictReader::ReadAndDrawSameArc(PictDrawingMethod eMethod) short nstartAngle, narcAngle; double fAng1, fAng2; - *pPict >> nstartAngle >> narcAngle; + pPict->ReadInt16( nstartAngle ).ReadInt16( narcAngle ); if (IsInvisible(eMethod)) return 4; DrawingMethod(eMethod); @@ -588,7 +588,7 @@ sal_uLong PictReader::ReadAndDrawRgn(PictDrawingMethod eMethod) { sal_uInt16 nSize; - *pPict >> nSize; + pPict->ReadUInt16( nSize ); // read the DATA // // a region data is a mask and is probably coded as @@ -675,7 +675,7 @@ sal_uLong PictReader::ReadAndDrawText() sal_uInt32 nLen, nDataLen; sal_Char sText[256]; - *pPict >> nByteLen; nLen=((sal_uLong)nByteLen)&0x000000ff; + pPict->ReadChar( nByteLen ); nLen=((sal_uLong)nByteLen)&0x000000ff; nDataLen = nLen + 1; pPict->Read( &sText, nLen ); @@ -715,15 +715,14 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo } // Read PixMap or Bitmap structure; - *pPict >> nRowBytes >> nBndY >> nBndX >> nHeight >> nWidth; + pPict->ReadUInt16( nRowBytes ).ReadUInt16( nBndY ).ReadUInt16( nBndX ).ReadUInt16( nHeight ).ReadUInt16( nWidth ); nHeight = nHeight - nBndY; nWidth = nWidth - nBndX; if ( ( nRowBytes & 0x8000 ) != 0 ) { // it is a PixMap nRowBytes &= 0x3fff; - *pPict >> nVersion >> nPackType >> nPackSize >> nHRes >> nVRes >> nPixelType >> - nPixelSize >> nCmpCount >> nCmpSize >> nPlaneBytes; + pPict->ReadUInt16( nVersion ).ReadUInt16( nPackType ).ReadUInt32( nPackSize ).ReadUInt32( nHRes ).ReadUInt32( nVRes ).ReadUInt16( nPixelType ). ReadUInt16( nPixelSize ).ReadUInt16( nCmpCount ).ReadUInt16( nCmpSize ).ReadUInt32( nPlaneBytes ); pPict->SeekRel( 8 ); nDataSize += 46; @@ -741,7 +740,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo if ( bColorTable ) { pPict->SeekRel( 6 ); - *pPict >> nColTabSize; + pPict->ReadUInt16( nColTabSize ); if ( ++nColTabSize > 256 ) BITMAPERROR; @@ -751,7 +750,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo for ( i = 0; i < nColTabSize; i++ ) { pPict->SeekRel(2); - *pPict >> nRed >> nDummy >> nGreen >> nDummy >> nBlue >> nDummy; + pPict->ReadUChar( nRed ).ReadUChar( nDummy ).ReadUChar( nGreen ).ReadUChar( nDummy ).ReadUChar( nBlue ).ReadUChar( nDummy ); pAcc->SetPaletteColor( (sal_uInt16) i, BitmapColor( nRed, nGreen, nBlue ) ); } nDataSize += 8 + nColTabSize * 8; @@ -778,7 +777,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo if ( pSrcRect != 0) { sal_uInt16 nTop, nLeft, nBottom, nRight; - *pPict >> nTop >> nLeft >> nBottom >> nRight; + pPict->ReadUInt16( nTop ).ReadUInt16( nLeft ).ReadUInt16( nBottom ).ReadUInt16( nRight ); *pSrcRect = Rectangle( (sal_uLong)nLeft, (sal_uLong)nTop, (sal_uLong)nRight, (sal_uLong)nBottom ); nDataSize += 8; } @@ -804,7 +803,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo if ( bMaskRgn ) { sal_uInt16 nSize; - *pPict >> nSize; + pPict->ReadUInt16( nSize ); pPict->SeekRel( nSize - 2 ); nDataSize += (sal_uLong)nSize; } @@ -832,7 +831,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo { for ( i = 0; i < nRowBytes; i++ ) { - *pPict >> nDat; + pPict->ReadUChar( nDat ); if ( nx < nWidth ) SETBYTE; } @@ -842,25 +841,25 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo { if ( nRowBytes > 250 ) { - *pPict >> nByteCount; + pPict->ReadUInt16( nByteCount ); nDataSize += 2 + (sal_uLong)nByteCount; } else { - *pPict >> nByteCountAsByte; + pPict->ReadUChar( nByteCountAsByte ); nByteCount = ( (sal_uInt16)nByteCountAsByte ) & 0x00ff; nDataSize += 1 + (sal_uLong)nByteCount; } while ( nByteCount ) { - *pPict >> nFlagCounterByte; + pPict->ReadUChar( nFlagCounterByte ); if ( ( nFlagCounterByte & 0x80 ) == 0 ) { nCount = ( (sal_uInt16)nFlagCounterByte ) + 1; for ( i = 0; i < nCount; i++ ) { - *pPict >> nDat; + pPict->ReadUChar( nDat ); if ( nx < nWidth ) SETBYTE; } @@ -869,7 +868,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo else { nCount = ( 1 - ( ( (sal_uInt16)nFlagCounterByte ) | 0xff00 ) ); - *pPict >> nDat; + pPict->ReadUChar( nDat ); for ( i = 0; i < nCount; i++ ) { if ( nx < nWidth ) @@ -897,7 +896,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo { for ( i = 0; i < nWidth; i++ ) { - *pPict >> nD; + pPict->ReadUInt16( nD ); nRed = (sal_uInt8)( nD >> 7 ); nGreen = (sal_uInt8)( nD >> 2 ); nBlue = (sal_uInt8)( nD << 3 ); @@ -910,18 +909,18 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo nSrcBitsPos = pPict->Tell(); if ( nRowBytes > 250 ) { - *pPict >> nByteCount; + pPict->ReadUInt16( nByteCount ); nByteCount += 2; } else { - *pPict >> nByteCountAsByte; + pPict->ReadUChar( nByteCountAsByte ); nByteCount = ( (sal_uInt16)nByteCountAsByte ) & 0x00ff; nByteCount++; } while ( nx != nWidth ) { - *pPict >> nFlagCounterByte; + pPict->ReadUChar( nFlagCounterByte ); if ( (nFlagCounterByte & 0x80) == 0) { nCount=((sal_uInt16)nFlagCounterByte)+1; @@ -929,7 +928,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo nCount = nWidth - nx; // I don't want to change this until I have a bugdoc for for (i=0; i<nCount; i++) // this case. Have a look at 32bit, there I changed the { // encoding, so that it is used a straight forward array - *pPict >> nD; + pPict->ReadUInt16( nD ); nRed = (sal_uInt8)( nD >> 7 ); nGreen = (sal_uInt8)( nD >> 2 ); nBlue = (sal_uInt8)( nD << 3 ); @@ -941,7 +940,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo nCount=(1-(((sal_uInt16)nFlagCounterByte)|0xff00)); if ( nCount + nx > nWidth ) nCount = nWidth - nx; - *pPict >> nD; + pPict->ReadUInt16( nD ); nRed = (sal_uInt8)( nD >> 7 ); nGreen = (sal_uInt8)( nD >> 2 ); nBlue = (sal_uInt8)( nD << 3 ); @@ -975,7 +974,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo { for ( nx = 0; nx < nWidth; nx++ ) { - *pPict >> nDummy >> nRed >> nGreen >> nBlue; + pPict->ReadUChar( nDummy ).ReadUChar( nRed ).ReadUChar( nGreen ).ReadUChar( nBlue ); pAcc->SetPixel( ny, nx, BitmapColor( nRed, nGreen, nBlue) ); } nDataSize += ( (sal_uLong)nWidth ) * 4; @@ -988,7 +987,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo { for ( nx = 0; nx < nWidth; nx++ ) { - *pPict >> nRed >> nGreen >> nBlue; + pPict->ReadUChar( nRed ).ReadUChar( nGreen ).ReadUChar( nBlue ); pAcc->SetPixel( ny, nx, BitmapColor( nRed, nGreen, nBlue ) ); } nDataSize += ( (sal_uLong)nWidth ) * 3; @@ -1004,19 +1003,19 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo nSrcBitsPos = pPict->Tell(); if ( nRowBytes > 250 ) { - *pPict >> nByteCount; + pPict->ReadUInt16( nByteCount ); nByteCount += 2; } else { - *pPict >> nByteCountAsByte; + pPict->ReadUChar( nByteCountAsByte ); nByteCount = (sal_uInt8)nByteCountAsByte; nByteCount++; } i = 0; while( i < (sal_uInt32)( nWidth * nCmpCount ) ) { - *pPict >> nFlagCounterByte; + pPict->ReadUChar( nFlagCounterByte ); if ( ( nFlagCounterByte & 0x80 ) == 0) { nCount = ( (sal_uInt16)nFlagCounterByte ) + 1; @@ -1024,7 +1023,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo nCount = (sal_uInt16)( nWidth * nCmpCount - i ); while( nCount-- ) { - *pPict >> nDat; + pPict->ReadUChar( nDat ); pScanline[ i++ ] = nDat; } } @@ -1033,7 +1032,7 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, sal_Bool bBaseAddr, sal_Bo nCount = ( 1 - ( ( (sal_uInt16)nFlagCounterByte ) | 0xff00 ) ); if ( ( i + nCount ) > (sal_uInt32)( nWidth * nCmpCount ) ) nCount = (sal_uInt16)( nWidth * nCmpCount - i ); - *pPict >> nDat; + pPict->ReadUChar( nDat ); while( nCount-- ) pScanline[ i++ ] = nDat; } @@ -1115,7 +1114,7 @@ void PictReader::ReadHeader() // 2 bytes to store size ( version 1 ) ignored pPict->SeekRel( 2 ); - *pPict >> y1 >> x1 >> y2 >> x2; // frame rectangle of the picture + pPict->ReadInt16( y1 ).ReadInt16( x1 ).ReadInt16( y2 ).ReadInt16( x2 ); // frame rectangle of the picture if (x1 > x2 || y1 > y2) continue; // bad bdbox if (x1 < -2048 || x2 > 2048 || y1 < -2048 || y2 > 2048 || // origin|dest is very small|large (x1 == x2 && y1 == y2) ) // 1 pixel pict is dubious @@ -1158,14 +1157,14 @@ void PictReader::ReadHeader() short nExtVer, nReserved; // 3 Bytes ignored : end of version arg 0x02FF (ie: 0xFF), HeaderOp : 0x0C00 pPict->SeekRel( 3 ); - *pPict >> nExtVer >> nReserved; + pPict->ReadInt16( nExtVer ).ReadInt16( nReserved ); if (pPict->IsEof() || pPict->GetError()) continue; if ( nExtVer == -2 ) // extended version 2 picture { sal_Int32 nHResFixed, nVResFixed; - *pPict >> nHResFixed >> nVResFixed; - *pPict >> y1 >> x1 >> y2 >> x2; // reading the optimal bounding rect + pPict->ReadInt32( nHResFixed ).ReadInt32( nVResFixed ); + pPict->ReadInt16( y1 ).ReadInt16( x1 ).ReadInt16( y2 ).ReadInt16( x2 ); // reading the optimal bounding rect if (x1 > x2 || y1 > y2) continue; // bad bdbox if (st < 2 && actualConfid != 20) { confidence[st] = actualConfid; continue; } @@ -1212,7 +1211,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x0001: { // Clip Rectangle aRect; - *pPict >> nUSHORT; + pPict->ReadUInt16( nUSHORT ); nDataSize=nUSHORT; ReadRectangle(aRect); // checkme: do we really want to extend the rectangle here ? @@ -1231,7 +1230,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) break; case 0x0003: // TxFont - *pPict >> nUSHORT; + pPict->ReadUInt16( nUSHORT ); if (nUSHORT <= 1) aActFont.SetFamily(FAMILY_SWISS); else if (nUSHORT <= 12) aActFont.SetFamily(FAMILY_DECORATIVE); else if (nUSHORT <= 20) aActFont.SetFamily(FAMILY_ROMAN); @@ -1246,7 +1245,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x0004: { // TxFace char nFace; - *pPict >> nFace; + pPict->ReadChar( nFace ); if ( (nFace & 0x01)!=0 ) aActFont.SetWeight(WEIGHT_BOLD); else aActFont.SetWeight(WEIGHT_NORMAL); if ( (nFace & 0x02)!=0 ) aActFont.SetItalic(ITALIC_NORMAL); @@ -1276,7 +1275,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) break; } case 0x0008: // PnMode - *pPict >> nUSHORT; + pPict->ReadUInt16( nUSHORT ); // internal code for postscript command (Quickdraw Reference Drawing B-30,B-34) if (nUSHORT==23) eActROP = ROP_1; else { @@ -1316,7 +1315,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x000d: // TxSize { - *pPict >> nUSHORT; + pPict->ReadUInt16( nUSHORT ); aActFont.SetSize( Size( 0, (long)nUSHORT ) ); eActMethod=PDM_UNDEFINED; nDataSize=2; @@ -1443,7 +1442,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x0025: // Reserved (n Bytes) case 0x0026: // Reserved (n Bytes) case 0x0027: // Reserved (n Bytes) - *pPict >> nUSHORT; + pPict->ReadUInt16( nUSHORT ); nDataSize=2+nUSHORT; break; @@ -1471,8 +1470,8 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x002c: { // fontName char sFName[ 256 ], nByteLen; sal_uInt16 nLen; - *pPict >> nUSHORT; nDataSize=nUSHORT+2; - *pPict >> nUSHORT; + pPict->ReadUInt16( nUSHORT ); nDataSize=nUSHORT+2; + pPict->ReadUInt16( nUSHORT ); if (nUSHORT <= 1) aActFont.SetFamily(FAMILY_SWISS); else if (nUSHORT <= 12) aActFont.SetFamily(FAMILY_DECORATIVE); else if (nUSHORT <= 20) aActFont.SetFamily(FAMILY_ROMAN); @@ -1481,7 +1480,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) else if (nUSHORT <= 1023) aActFont.SetFamily(FAMILY_SWISS); else aActFont.SetFamily(FAMILY_ROMAN); aActFont.SetCharSet(GetTextEncoding(nUSHORT)); - *pPict >> nByteLen; nLen=((sal_uInt16)nByteLen)&0x00ff; + pPict->ReadChar( nByteLen ); nLen=((sal_uInt16)nByteLen)&0x00ff; pPict->Read( &sFName, nLen ); sFName[ nLen ] = 0; OUString aString( (const sal_Char*)&sFName, strlen(sFName), osl_getThreadTextEncoding() ); @@ -1494,12 +1493,12 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) break; case 0x002e: // glyphState - *pPict >> nUSHORT; + pPict->ReadUInt16( nUSHORT ); nDataSize=2+nUSHORT; break; case 0x002f: // Reserved (n Bytes) - *pPict >> nUSHORT; + pPict->ReadUInt16( nUSHORT ); nDataSize=2+nUSHORT; break; @@ -1626,7 +1625,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x0075: // Reserved (Polygon-Size) case 0x0076: // Reserved (Polygon-Size) case 0x0077: // Reserved (Polygon-Size) - *pPict >> nUSHORT; nDataSize=nUSHORT; + pPict->ReadUInt16( nUSHORT ); nDataSize=nUSHORT; break; case 0x0078: // frameSamePoly @@ -1654,7 +1653,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x0085: // Reserved (Region-Size) case 0x0086: // Reserved (Region-Size) case 0x0087: // Reserved (Region-Size) - *pPict >> nUSHORT; nDataSize=nUSHORT; + pPict->ReadUInt16( nUSHORT ); nDataSize=nUSHORT; break; case 0x0088: // frameSameRgn @@ -1693,7 +1692,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x0095: // Reserved (n Bytes) case 0x0096: // Reserved (n Bytes) case 0x0097: // Reserved (n Bytes) - *pPict >> nUSHORT; nDataSize=2+nUSHORT; + pPict->ReadUInt16( nUSHORT ); nDataSize=2+nUSHORT; break; case 0x0098: { // PackBitsRect @@ -1732,7 +1731,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) case 0x009d: // Reserved (n Bytes) case 0x009e: // Reserved (n Bytes) case 0x009f: // Reserved (n Bytes) - *pPict >> nUSHORT; nDataSize=2+nUSHORT; + pPict->ReadUInt16( nUSHORT ); nDataSize=2+nUSHORT; break; case 0x00a0: // ShortComment @@ -1740,13 +1739,13 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) break; case 0x00a1: // LongComment - pPict->SeekRel(2); *pPict >> nUSHORT; nDataSize=4+nUSHORT; + pPict->SeekRel(2); pPict->ReadUInt16( nUSHORT ); nDataSize=4+nUSHORT; break; default: // 0x00a2 bis 0xffff (most times reserved) - if (nOpcode<=0x00af) { *pPict >> nUSHORT; nDataSize=2+nUSHORT; } + if (nOpcode<=0x00af) { pPict->ReadUInt16( nUSHORT ); nDataSize=2+nUSHORT; } else if (nOpcode<=0x00cf) { nDataSize=0; } - else if (nOpcode<=0x00fe) { sal_uInt32 nTemp; *pPict >> nTemp ; nDataSize = nTemp; nDataSize+=4; } + else if (nOpcode<=0x00fe) { sal_uInt32 nTemp; pPict->ReadUInt32( nTemp ) ; nDataSize = nTemp; nDataSize+=4; } // Osnola: checkme: in the Quickdraw Ref examples ( for pict v2) // 0x00ff(EndOfPict) is also not followed by any data... else if (nOpcode==0x00ff) { nDataSize=IsVersion2 ? 2 : 0; } // OpEndPic @@ -1757,7 +1756,7 @@ sal_uLong PictReader::ReadData(sal_uInt16 nOpcode) else if (nOpcode<=0x7eff) { nDataSize=24; } else if (nOpcode<=0x7fff) { nDataSize=254; } else if (nOpcode<=0x80ff) { nDataSize=0; } - else { sal_uInt32 nTemp; *pPict >> nTemp ; nDataSize = nTemp; nDataSize+=4; } + else { sal_uInt32 nTemp; pPict->ReadUInt32( nTemp ) ; nDataSize = nTemp; nDataSize+=4; } } if (nDataSize==0xffffffff) { @@ -1817,10 +1816,10 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ) } if (IsVersion2 ) - *pPict >> nOpcode; + pPict->ReadUInt16( nOpcode ); else { - *pPict >> nOneByteOpcode; + pPict->ReadUChar( nOneByteOpcode ); nOpcode=(sal_uInt16)nOneByteOpcode; } diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx index 86bb59c07a3a..33219a75927e 100644 --- a/filter/source/graphicfilter/ipsd/ipsd.cxx +++ b/filter/source/graphicfilter/ipsd/ipsd.cxx @@ -178,9 +178,7 @@ sal_Bool PSDReader::ImplReadHeader() if ( !mpFileHeader ) return sal_False; - m_rPSD >> mpFileHeader->nSignature >> mpFileHeader->nVersion >> mpFileHeader->nPad1 >> - mpFileHeader->nPad2 >> mpFileHeader->nChannels >> mpFileHeader->nRows >> - mpFileHeader->nColumns >> mpFileHeader->nDepth >> mpFileHeader->nMode; + m_rPSD.ReadUInt32( mpFileHeader->nSignature ).ReadUInt16( mpFileHeader->nVersion ).ReadUInt32( mpFileHeader->nPad1 ). ReadUInt16( mpFileHeader->nPad2 ).ReadUInt16( mpFileHeader->nChannels ).ReadUInt32( mpFileHeader->nRows ). ReadUInt32( mpFileHeader->nColumns ).ReadUInt16( mpFileHeader->nDepth ).ReadUInt16( mpFileHeader->nMode ); if ( ( mpFileHeader->nSignature != 0x38425053 ) || ( mpFileHeader->nVersion != 1 ) ) return sal_False; @@ -197,7 +195,7 @@ sal_Bool PSDReader::ImplReadHeader() mnDestBitDepth = ( nDepth == 16 ) ? 8 : nDepth; - m_rPSD >> nColorLength; + m_rPSD.ReadUInt32( nColorLength ); if ( mpFileHeader->nMode == PSD_CMYK ) { switch ( mpFileHeader->nChannels ) @@ -277,7 +275,7 @@ sal_Bool PSDReader::ImplReadHeader() default: return sal_False; } - m_rPSD >> nResourceLength; + m_rPSD.ReadUInt32( nResourceLength ); sal_uInt32 nLayerPos = m_rPSD.Tell() + nResourceLength; // this is a loop over the resource entries to get the resolution info @@ -287,14 +285,14 @@ sal_Bool PSDReader::ImplReadHeader() sal_uInt32 nType, nPStringLen, nResEntryLen; sal_uInt16 nUniqueID; - m_rPSD >> nType >> nUniqueID >> n8; + m_rPSD.ReadUInt32( nType ).ReadUInt16( nUniqueID ).ReadUChar( n8 ); nPStringLen = n8; if ( nType != 0x3842494d ) break; if ( ! ( nPStringLen & 1 ) ) nPStringLen++; m_rPSD.SeekRel( nPStringLen ); // skipping the pstring - m_rPSD >> nResEntryLen; + m_rPSD.ReadUInt32( nResEntryLen ); if ( nResEntryLen & 1 ) nResEntryLen++; // the resource entries are padded sal_uInt32 nCurrentPos = m_rPSD.Tell(); @@ -306,18 +304,18 @@ sal_Bool PSDReader::ImplReadHeader() { sal_Int16 nUnit; - m_rPSD >> mnXResFixed >> nUnit >> nUnit - >> mnYResFixed >> nUnit >> nUnit; + m_rPSD.ReadUInt32( mnXResFixed ).ReadInt16( nUnit ).ReadInt16( nUnit ) + .ReadUInt32( mnYResFixed ).ReadInt16( nUnit ).ReadInt16( nUnit ); } break; } m_rPSD.Seek( nCurrentPos + nResEntryLen ); // set the stream to the next } // resource entry m_rPSD.Seek( nLayerPos ); - m_rPSD >> nLayerMaskLength; + m_rPSD.ReadUInt32( nLayerMaskLength ); m_rPSD.SeekRel( nLayerMaskLength ); - m_rPSD >> nCompression; + m_rPSD.ReadUInt16( nCompression ); if ( nCompression == 0 ) { mbCompression = sal_False; @@ -353,13 +351,13 @@ sal_Bool PSDReader::ImplReadBody() if ( nBitCount == -1 ) { if ( mbCompression ) // else nRunCount = 0 -> so we use only single raw packets - m_rPSD >> nRunCount; + m_rPSD.ReadChar( nRunCount ); } if ( nRunCount & 0x80 ) // a run length packet { if ( nBitCount == -1 ) // bits left in nDat? { - m_rPSD >> nDat; + m_rPSD.ReadUChar( nDat ); nDat ^= 0xff; nBitCount = 7; } @@ -382,7 +380,7 @@ sal_Bool PSDReader::ImplReadBody() { if ( nBitCount == -1 ) // bits left in nDat ? { - m_rPSD >> nDat; + m_rPSD.ReadUChar( nDat ); nDat ^= 0xff; nBitCount = 7; } @@ -406,13 +404,13 @@ sal_Bool PSDReader::ImplReadBody() while ( nY < mpFileHeader->nRows ) { if ( mbCompression ) // else nRunCount = 0 -> so we use only single raw packets - m_rPSD >> nRunCount; + m_rPSD.ReadChar( nRunCount ); if ( nRunCount & 0x80 ) // a run length packet { - m_rPSD >> nDat; + m_rPSD.ReadUChar( nDat ); if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ ) { mpWriteAcc->SetPixelIndex( nY, nX, nDat ); @@ -429,9 +427,9 @@ sal_Bool PSDReader::ImplReadBody() { for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rPSD >> nDat; + m_rPSD.ReadUChar( nDat ); if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); mpWriteAcc->SetPixelIndex( nY, nX, nDat ); if ( ++nX == mpFileHeader->nColumns ) { @@ -455,13 +453,13 @@ sal_Bool PSDReader::ImplReadBody() while ( nY < mpFileHeader->nRows ) { if ( mbCompression ) // else nRunCount = 0 -> so we use only single raw packets - m_rPSD >> nRunCount; + m_rPSD.ReadChar( nRunCount ); if ( nRunCount & 0x80 ) // a run length packet { - m_rPSD >> nRed; + m_rPSD.ReadUChar( nRed ); if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ ) { mpWriteAcc->SetPixel( nY, nX, BitmapColor( nRed, (sal_uInt8)0, (sal_uInt8)0 ) ); @@ -478,9 +476,9 @@ sal_Bool PSDReader::ImplReadBody() { for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rPSD >> nRed; + m_rPSD.ReadUChar( nRed ); if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); mpWriteAcc->SetPixel( nY, nX, BitmapColor( nRed, (sal_uInt8)0, (sal_uInt8)0 ) ); if ( ++nX == mpFileHeader->nColumns ) { @@ -496,12 +494,12 @@ sal_Bool PSDReader::ImplReadBody() while ( nY < mpFileHeader->nRows ) { if ( mbCompression ) - m_rPSD >> nRunCount; + m_rPSD.ReadChar( nRunCount ); if ( nRunCount & 0x80 ) // a run length packet { - m_rPSD >> nGreen; + m_rPSD.ReadUChar( nGreen ); if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ ) { aBitmapColor = mpReadAcc->GetPixel( nY, nX ); @@ -519,9 +517,9 @@ sal_Bool PSDReader::ImplReadBody() { for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rPSD >> nGreen; + m_rPSD.ReadUChar( nGreen ); if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); aBitmapColor = mpReadAcc->GetPixel( nY, nX ); mpWriteAcc->SetPixel( nY, nX, BitmapColor( aBitmapColor.GetRed(), nGreen, aBitmapColor.GetBlue() ) ); if ( ++nX == mpFileHeader->nColumns ) @@ -538,12 +536,12 @@ sal_Bool PSDReader::ImplReadBody() while ( nY < mpFileHeader->nRows ) { if ( mbCompression ) - m_rPSD >> nRunCount; + m_rPSD.ReadChar( nRunCount ); if ( nRunCount & 0x80 ) // a run length packet { - m_rPSD >> nBlue; + m_rPSD.ReadUChar( nBlue ); if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ ) { aBitmapColor = mpReadAcc->GetPixel( nY, nX ); @@ -561,9 +559,9 @@ sal_Bool PSDReader::ImplReadBody() { for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rPSD >> nBlue; + m_rPSD.ReadUChar( nBlue ); if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); aBitmapColor = mpReadAcc->GetPixel( nY, nX ); mpWriteAcc->SetPixel( nY, nX, BitmapColor( aBitmapColor.GetRed(), aBitmapColor.GetGreen(), nBlue ) ); if ( ++nX == mpFileHeader->nColumns ) @@ -584,14 +582,14 @@ sal_Bool PSDReader::ImplReadBody() while ( nY < mpFileHeader->nRows ) { if ( mbCompression ) // else nRunCount = 0 -> so we use only single raw packets - m_rPSD >> nRunCount; + m_rPSD.ReadChar( nRunCount ); if ( nRunCount & 0x80 ) // a run length packet { - m_rPSD >> nDat; + m_rPSD.ReadUChar( nDat ); if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ ) { @@ -618,10 +616,10 @@ sal_Bool PSDReader::ImplReadBody() { for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rPSD >> nDat; + m_rPSD.ReadUChar( nDat ); if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); nBlack = (sal_uInt8)mpReadAcc->GetPixel( nY, nX ).GetRed() + nDat; if ( nBlack > nBlackMax ) nBlackMax = nBlack; @@ -670,17 +668,17 @@ sal_Bool PSDReader::ImplReadBody() while ( nY < mpFileHeader->nRows ) { if ( mbCompression ) // else nRunCount = 0 -> so we use only single raw packets - m_rPSD >> nRunCount; + m_rPSD.ReadChar( nRunCount ); if ( nRunCount & 0x80 ) // a run length packet { - m_rPSD >> nDat; + m_rPSD.ReadUChar( nDat ); if ( nDat ) nDat = 0; else nDat = 1; if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ ) { mpMaskWriteAcc->SetPixelIndex( nY, nX, nDat ); @@ -697,13 +695,13 @@ sal_Bool PSDReader::ImplReadBody() { for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rPSD >> nDat; + m_rPSD.ReadUChar( nDat ); if ( nDat ) nDat = 0; else nDat = 1; if ( mpFileHeader->nDepth == 16 ) // 16 bit depth is to be skipped - m_rPSD >> nDummy; + m_rPSD.ReadUChar( nDummy ); mpMaskWriteAcc->SetPixelIndex( nY, nX, nDat ); if ( ++nX == mpFileHeader->nColumns ) { diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx index a1771e1d95ec..dcaaf4ce06f8 100644 --- a/filter/source/graphicfilter/iras/iras.cxx +++ b/filter/source/graphicfilter/iras/iras.cxx @@ -88,7 +88,7 @@ sal_Bool RASReader::ReadRAS(Graphic & rGraphic) return sal_False; m_rRAS.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); - m_rRAS >> nMagicNumber; + m_rRAS.ReadUInt32( nMagicNumber ); if ( nMagicNumber != SUNRASTER_MAGICNUMBER ) return sal_False; @@ -120,9 +120,9 @@ sal_Bool RASReader::ReadRAS(Graphic & rGraphic) mpAcc->SetPaletteEntryCount( mnDstColors ); sal_uInt16 i; sal_uInt8 nRed[256], nGreen[256], nBlue[256]; - for ( i = 0; i < mnDstColors; i++ ) m_rRAS >> nRed[ i ]; - for ( i = 0; i < mnDstColors; i++ ) m_rRAS >> nGreen[ i ]; - for ( i = 0; i < mnDstColors; i++ ) m_rRAS >> nBlue[ i ]; + for ( i = 0; i < mnDstColors; i++ ) m_rRAS.ReadUChar( nRed[ i ] ); + for ( i = 0; i < mnDstColors; i++ ) m_rRAS.ReadUChar( nGreen[ i ] ); + for ( i = 0; i < mnDstColors; i++ ) m_rRAS.ReadUChar( nBlue[ i ] ); for ( i = 0; i < mnDstColors; i++ ) { mpAcc->SetPaletteColor( i, BitmapColor( nRed[ i ], nGreen[ i ], nBlue[ i ] ) ); @@ -173,8 +173,7 @@ sal_Bool RASReader::ReadRAS(Graphic & rGraphic) sal_Bool RASReader::ImplReadHeader() { - m_rRAS >> mnWidth >> mnHeight >> mnDepth >> mnImageDatSize >> - mnType >> mnColorMapType >> mnColorMapSize; + m_rRAS.ReadUInt32( mnWidth ).ReadUInt32( mnHeight ).ReadUInt32( mnDepth ).ReadUInt32( mnImageDatSize ). ReadUInt32( mnType ).ReadUInt32( mnColorMapType ).ReadUInt32( mnColorMapSize ); if ( mnWidth == 0 || mnHeight == 0 ) mbStatus = sal_False; @@ -310,7 +309,7 @@ sal_uInt8 RASReader::ImplGetByte() sal_uInt8 nRetVal; if ( mnType != RAS_TYPE_BYTE_ENCODED ) { - m_rRAS >> nRetVal; + m_rRAS.ReadUChar( nRetVal ); return nRetVal; } else @@ -322,14 +321,14 @@ sal_uInt8 RASReader::ImplGetByte() } else { - m_rRAS >> nRetVal; + m_rRAS.ReadUChar( nRetVal ); if ( nRetVal != 0x80 ) return nRetVal; - m_rRAS >> nRetVal; + m_rRAS.ReadUChar( nRetVal ); if ( nRetVal == 0 ) return 0x80; mnRepCount = nRetVal ; - m_rRAS >> mnRepVal; + m_rRAS.ReadUChar( mnRepVal ); return mnRepVal; } } diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx index 8672029454e0..5f9c434a3cb2 100644 --- a/filter/source/graphicfilter/itga/itga.cxx +++ b/filter/source/graphicfilter/itga/itga.cxx @@ -177,10 +177,7 @@ sal_Bool TGAReader::ImplReadHeader() if ( mpFileHeader == NULL ) return sal_False; - m_rTGA >> mpFileHeader->nImageIDLength >> mpFileHeader->nColorMapType >> mpFileHeader->nImageType >> - mpFileHeader->nColorMapFirstEntryIndex >> mpFileHeader->nColorMapLength >> mpFileHeader->nColorMapEntrySize >> - mpFileHeader->nColorMapXOrigin >> mpFileHeader->nColorMapYOrigin >> mpFileHeader->nImageWidth >> - mpFileHeader->nImageHeight >> mpFileHeader->nPixelDepth >> mpFileHeader->nImageDescriptor; + m_rTGA.ReadUChar( mpFileHeader->nImageIDLength ).ReadUChar( mpFileHeader->nColorMapType ).ReadUChar( mpFileHeader->nImageType ). ReadUInt16( mpFileHeader->nColorMapFirstEntryIndex ).ReadUInt16( mpFileHeader->nColorMapLength ).ReadUChar( mpFileHeader->nColorMapEntrySize ). ReadUInt16( mpFileHeader->nColorMapXOrigin ).ReadUInt16( mpFileHeader->nColorMapYOrigin ).ReadUInt16( mpFileHeader->nImageWidth ). ReadUInt16( mpFileHeader->nImageHeight ).ReadUChar( mpFileHeader->nPixelDepth ).ReadUChar( mpFileHeader->nImageDescriptor ); if ( !m_rTGA.good()) return sal_False; @@ -199,9 +196,7 @@ sal_Bool TGAReader::ImplReadHeader() sal_uLong nTemp = m_rTGA.Tell(); m_rTGA.Seek( nTemp - SizeOfTGAFileFooter ); - m_rTGA >> mpFileFooter->nExtensionFileOffset >> mpFileFooter->nDeveloperDirectoryOffset >> - mpFileFooter->nSignature[0] >> mpFileFooter->nSignature[1] >> mpFileFooter->nSignature[2] >> - mpFileFooter->nSignature[3] >> mpFileFooter->nPadByte >> mpFileFooter->nStringTerminator; + m_rTGA.ReadUInt32( mpFileFooter->nExtensionFileOffset ).ReadUInt32( mpFileFooter->nDeveloperDirectoryOffset ). ReadUInt32( mpFileFooter->nSignature[0] ).ReadUInt32( mpFileFooter->nSignature[1] ).ReadUInt32( mpFileFooter->nSignature[2] ). ReadUInt32( mpFileFooter->nSignature[3] ).ReadUChar( mpFileFooter->nPadByte ).ReadUChar( mpFileFooter->nStringTerminator ); if ( !m_rTGA.good()) @@ -217,7 +212,7 @@ sal_Bool TGAReader::ImplReadHeader() if ( mpExtension ) { m_rTGA.Seek( mpFileFooter->nExtensionFileOffset ); - m_rTGA >> mpExtension->nExtensionSize; + m_rTGA.ReadUInt16( mpExtension->nExtensionSize ); if ( !m_rTGA.good()) return sal_False; if ( mpExtension->nExtensionSize >= SizeOfTGAExtension ) @@ -228,14 +223,14 @@ sal_Bool TGAReader::ImplReadHeader() m_rTGA.Read( mpExtension->sAuthorComment, 324 ); m_rTGA.Read( mpExtension->sDateTimeStamp, 12 ); m_rTGA.Read( mpExtension->sJobNameID, 12 ); - m_rTGA >> mpExtension->sJobNameID[ 0 ] >> mpExtension->sJobNameID[ 1 ] >> mpExtension->sJobNameID[ 2 ]; + m_rTGA.ReadChar( mpExtension->sJobNameID[ 0 ] ).ReadChar( mpExtension->sJobNameID[ 1 ] ).ReadChar( mpExtension->sJobNameID[ 2 ] ); m_rTGA.Read( mpExtension->sSoftwareID, 41 ); - m_rTGA >> mpExtension->nSoftwareVersionNumber >> mpExtension->nSoftwareVersionLetter - >> mpExtension->nKeyColor >> mpExtension->nPixelAspectRatioNumerator - >> mpExtension->nPixelAspectRatioDeNumerator >> mpExtension->nGammaValueNumerator - >> mpExtension->nGammaValueDeNumerator >> mpExtension->nColorCorrectionOffset - >> mpExtension->nPostageStampOffset >> mpExtension->nScanLineOffset - >> mpExtension->nAttributesType; + m_rTGA.ReadUInt16( mpExtension->nSoftwareVersionNumber ).ReadUChar( mpExtension->nSoftwareVersionLetter ) + .ReadUInt32( mpExtension->nKeyColor ).ReadUInt16( mpExtension->nPixelAspectRatioNumerator ) + .ReadUInt16( mpExtension->nPixelAspectRatioDeNumerator ).ReadUInt16( mpExtension->nGammaValueNumerator ) + .ReadUInt16( mpExtension->nGammaValueDeNumerator ).ReadUInt32( mpExtension->nColorCorrectionOffset ) + .ReadUInt32( mpExtension->nPostageStampOffset ).ReadUInt32( mpExtension->nScanLineOffset ) + .ReadUChar( mpExtension->nAttributesType ); if ( !m_rTGA.good()) return sal_False; @@ -319,12 +314,12 @@ sal_Bool TGAReader::ImplReadBody() case 16 : while ( nYCount < mpFileHeader->nImageHeight ) { - m_rTGA >> nRunCount; + m_rTGA.ReadUChar( nRunCount ); if ( !m_rTGA.good()) return sal_False; if ( nRunCount & 0x80 ) // a run length packet { - m_rTGA >> nRGB16; + m_rTGA.ReadUInt16( nRGB16 ); if ( nRGB16 >= mpFileHeader->nColorMapLength ) return sal_False; nRed = (sal_uInt8)( mpColorMap[ nRGB16 ] >> 16 ); @@ -353,7 +348,7 @@ sal_Bool TGAReader::ImplReadBody() { for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rTGA >> nRGB16; + m_rTGA.ReadUInt16( nRGB16 ); if ( !m_rTGA.good()) return sal_False; if ( nRGB16 >= mpFileHeader->nColorMapLength ) @@ -385,12 +380,12 @@ sal_Bool TGAReader::ImplReadBody() case 8 : while ( nYCount < mpFileHeader->nImageHeight ) { - m_rTGA >> nRunCount; + m_rTGA.ReadUChar( nRunCount ); if ( !m_rTGA.good()) return sal_False; if ( nRunCount & 0x80 ) // a run length packet { - m_rTGA >> nDummy; + m_rTGA.ReadUChar( nDummy ); if ( !m_rTGA.good()) return sal_False; if ( nDummy >= mpFileHeader->nColorMapLength ) @@ -417,7 +412,7 @@ sal_Bool TGAReader::ImplReadBody() for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rTGA >> nDummy; + m_rTGA.ReadUChar( nDummy ); if ( !m_rTGA.good()) return sal_False; if ( nDummy >= mpFileHeader->nColorMapLength ) @@ -452,12 +447,12 @@ sal_Bool TGAReader::ImplReadBody() { while ( nYCount < mpFileHeader->nImageHeight ) { - m_rTGA >> nRunCount; + m_rTGA.ReadUChar( nRunCount ); if ( !m_rTGA.good()) return sal_False; if ( nRunCount & 0x80 ) // a run length packet { - m_rTGA >> nBlue >> nGreen >> nRed >> nDummy; + m_rTGA.ReadUChar( nBlue ).ReadUChar( nGreen ).ReadUChar( nRed ).ReadUChar( nDummy ); if ( !m_rTGA.good()) return sal_False; for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) @@ -481,7 +476,7 @@ sal_Bool TGAReader::ImplReadBody() { for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rTGA >> nBlue >> nGreen >> nRed >> nDummy; + m_rTGA.ReadUChar( nBlue ).ReadUChar( nGreen ).ReadUChar( nRed ).ReadUChar( nDummy ); if ( !m_rTGA.good()) return sal_False; mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) ); @@ -507,12 +502,12 @@ sal_Bool TGAReader::ImplReadBody() case 24 : while ( nYCount < mpFileHeader->nImageHeight ) { - m_rTGA >> nRunCount; + m_rTGA.ReadUChar( nRunCount ); if ( !m_rTGA.good()) return sal_False; if ( nRunCount & 0x80 ) // a run length packet { - m_rTGA >> nBlue >> nGreen >> nRed; + m_rTGA.ReadUChar( nBlue ).ReadUChar( nGreen ).ReadUChar( nRed ); if ( !m_rTGA.good()) return sal_False; for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) @@ -536,7 +531,7 @@ sal_Bool TGAReader::ImplReadBody() { for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rTGA >> nBlue >> nGreen >> nRed; + m_rTGA.ReadUChar( nBlue ).ReadUChar( nGreen ).ReadUChar( nRed ); if ( !m_rTGA.good()) return sal_False; mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) ); @@ -561,12 +556,12 @@ sal_Bool TGAReader::ImplReadBody() case 16 : while ( nYCount < mpFileHeader->nImageHeight ) { - m_rTGA >> nRunCount; + m_rTGA.ReadUChar( nRunCount ); if ( !m_rTGA.good()) return sal_False; if ( nRunCount & 0x80 ) // a run length packet { - m_rTGA >> nRGB16; + m_rTGA.ReadUInt16( nRGB16 ); if ( !m_rTGA.good()) return sal_False; nRed = (sal_uInt8)( nRGB16 >> 7 ) & 0xf8; @@ -593,7 +588,7 @@ sal_Bool TGAReader::ImplReadBody() { for ( sal_uInt16 i = 0; i < ( ( nRunCount & 0x7f ) + 1 ); i++ ) { - m_rTGA >> nRGB16; + m_rTGA.ReadUInt16( nRGB16 ); if ( !m_rTGA.good()) return sal_False; nRed = (sal_uInt8)( nRGB16 >> 7 ) & 0xf8; @@ -637,7 +632,7 @@ sal_Bool TGAReader::ImplReadBody() case 16 : for (;nXCount < mpFileHeader->nImageWidth; nXCount++, nX += nXAdd ) { - m_rTGA >> nRGB16; + m_rTGA.ReadUInt16( nRGB16 ); if ( !m_rTGA.good()) return sal_False; if ( nRGB16 >= mpFileHeader->nColorMapLength ) @@ -653,7 +648,7 @@ sal_Bool TGAReader::ImplReadBody() case 8 : for (;nXCount < mpFileHeader->nImageWidth; nXCount++, nX += nXAdd ) { - m_rTGA >> nDummy; + m_rTGA.ReadUChar( nDummy ); if ( !m_rTGA.good()) return sal_False; if ( nDummy >= mpFileHeader->nColorMapLength ) @@ -674,7 +669,7 @@ sal_Bool TGAReader::ImplReadBody() { for (;nXCount < mpFileHeader->nImageWidth; nXCount++, nX += nXAdd ) { - m_rTGA >> nBlue >> nGreen >> nRed >> nDummy; + m_rTGA.ReadUChar( nBlue ).ReadUChar( nGreen ).ReadUChar( nRed ).ReadUChar( nDummy ); if ( !m_rTGA.good()) return sal_False; mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) ); @@ -686,7 +681,7 @@ sal_Bool TGAReader::ImplReadBody() case 24 : for (;nXCount < mpFileHeader->nImageWidth; nXCount++, nX += nXAdd ) { - m_rTGA >> nBlue >> nGreen >> nRed; + m_rTGA.ReadUChar( nBlue ).ReadUChar( nGreen ).ReadUChar( nRed ); if ( !m_rTGA.good()) return sal_False; mpAcc->SetPixel( nY, nX, BitmapColor( nRed, nGreen, nBlue ) ); @@ -697,7 +692,7 @@ sal_Bool TGAReader::ImplReadBody() case 16 : for (;nXCount < mpFileHeader->nImageWidth; nXCount++, nX += nXAdd ) { - m_rTGA >> nRGB16; + m_rTGA.ReadUInt16( nRGB16 ); if ( !m_rTGA.good()) return sal_False; nRed = (sal_uInt8)( nRGB16 >> 7 ) & 0xf8; @@ -763,7 +758,7 @@ sal_Bool TGAReader::ImplReadPalette() for ( sal_uLong i = 0; i < nColors; i++ ) { sal_uInt16 nTemp; - m_rTGA >> nTemp; + m_rTGA.ReadUInt16( nTemp ); if ( !m_rTGA.good() ) return sal_False; mpColorMap[ i ] = ( ( nTemp & 0x7c00 ) << 9 ) + ( ( nTemp & 0x01e0 ) << 6 ) + diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx index ebabcecaea9c..e7cd5de7427d 100644 --- a/filter/source/graphicfilter/itiff/ccidecom.cxx +++ b/filter/source/graphicfilter/itiff/ccidecom.cxx @@ -773,7 +773,7 @@ sal_Bool CCIDecompressor::ReadEOL( sal_uInt32 /*nMaxFillBits*/ ) { while ( nInputBitsBufSize < 12 ) { - *pIStream >> nByte; + pIStream->ReadUChar( nByte ); if ( pIStream->IsEof() ) return sal_False; if ( pIStream->Tell() > nMaxPos ) @@ -804,7 +804,7 @@ sal_Bool CCIDecompressor::Read2DTag() // read abit and return sal_True if it's 0, otherwise return sal_False if (nInputBitsBufSize==0) { - *pIStream >> nByte; + pIStream->ReadUChar( nByte ); if ( nOptions & CCI_OPTION_INVERSEBITORDER ) nByte = pByteSwap[ nByte ]; nInputBitsBuf=(sal_uLong)nByte; @@ -822,7 +822,7 @@ sal_uInt8 CCIDecompressor::ReadBlackOrWhite() // read a bit and deliver 0x00 if it's 0, otherwise 0xff if (nInputBitsBufSize==0) { - *pIStream >> nByte; + pIStream->ReadUChar( nByte ); if ( nOptions & CCI_OPTION_INVERSEBITORDER ) nByte = pByteSwap[ nByte ]; nInputBitsBuf=(sal_uLong)nByte; @@ -841,7 +841,7 @@ sal_uInt16 CCIDecompressor::ReadCodeAndDecode(const CCILookUpTableEntry * pLookU while (nInputBitsBufSize<nMaxCodeBits) { sal_uInt8 nByte(0); - *pIStream >> nByte; + pIStream->ReadUChar( nByte ); if ( nOptions & CCI_OPTION_INVERSEBITORDER ) nByte = pByteSwap[ nByte ]; nInputBitsBuf=(nInputBitsBuf<<8) | (sal_uLong)nByte; @@ -929,7 +929,7 @@ void CCIDecompressor::Read1DScanlineData(sal_uInt8 * pTarget, sal_uInt16 nTarget // fetch next 13 bits into nCodem but dont remove them from // the input buffer: while (nInputBitsBufSize<13) { - *pIStream >> nByte; + pIStream->ReadUChar( nByte ); if ( nOptions & CCI_OPTION_INVERSEBITORDER ) nByte = pByteSwap[ nByte ]; nInputBitsBuf=(nInputBitsBuf<<8) | (sal_uLong)nByte; diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index f235a3585f2b..8deea2c16589 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -191,45 +191,45 @@ sal_uLong TIFFReader::ReadIntData() case 1 : case 2 : case 7 : - *pTIFF >> nBYTE; + pTIFF->ReadUChar( nBYTE ); nUINT32a = (sal_uLong)nBYTE; break; case 3 : - *pTIFF >> nUINT16; + pTIFF->ReadUInt16( nUINT16 ); nUINT32a = (sal_uLong)nUINT16; break; case 9 : case 4 : - *pTIFF >> nUINT32a; + pTIFF->ReadUInt32( nUINT32a ); break; case 5 : - *pTIFF >> nUINT32a >> nUINT32b; + pTIFF->ReadUInt32( nUINT32a ).ReadUInt32( nUINT32b ); if ( nUINT32b != 0 ) nUINT32a /= nUINT32b; break; case 6 : - *pTIFF >> nCHAR; + pTIFF->ReadChar( nCHAR ); nUINT32a = (sal_Int32)nCHAR; break; case 8 : - *pTIFF >> nINT16; + pTIFF->ReadInt16( nINT16 ); nUINT32a = (sal_Int32)nINT16; break; case 10 : - *pTIFF >> nUINT32a >> nINT32; + pTIFF->ReadUInt32( nUINT32a ).ReadInt32( nINT32 ); if ( nINT32 != 0 ) nUINT32a /= nINT32; break; case 11 : - *pTIFF >> nFLOAT; + pTIFF->ReadFloat( nFLOAT ); nUINT32a = (sal_Int32)nFLOAT; break; case 12 : - *pTIFF >> nDOUBLE; + pTIFF->ReadDouble( nDOUBLE ); nUINT32a = (sal_Int32)nDOUBLE; break; default: - *pTIFF >> nUINT32a; + pTIFF->ReadUInt32( nUINT32a ); break; } return nUINT32a; @@ -244,9 +244,9 @@ double TIFFReader::ReadDoubleData() if ( nDataType == 5 ) { - *pTIFF >> nulong; + pTIFF->ReadUInt32( nulong ); nd = (double)nulong; - *pTIFF >> nulong; + pTIFF->ReadUInt32( nulong ); if ( nulong != 0 ) nd /= (double)nulong; } @@ -449,17 +449,17 @@ void TIFFReader::ReadTagData( sal_uInt16 nTagType, sal_uInt32 nDataLen) pColorMap[ i ] = 0; for ( i = 0; i < nNumColors; i++ ) { - *pTIFF >> nVal; + pTIFF->ReadUInt16( nVal ); pColorMap[ i ] |= ( ( (sal_uLong)nVal ) << 8 ) & 0x00ff0000; } for ( i = 0; i < nNumColors; i++ ) { - *pTIFF >> nVal; + pTIFF->ReadUInt16( nVal ); pColorMap[ i ] |= ( (sal_uLong)nVal ) & 0x0000ff00; } for ( i = 0; i < nNumColors; i++ ) { - *pTIFF >> nVal; + pTIFF->ReadUInt16( nVal ); pColorMap[ i ] |= ( ( (sal_uLong)nVal ) >> 8 ) & 0x000000ff; } } @@ -621,7 +621,7 @@ sal_Bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent ) pdst=pMap[ np ]; do { - *pTIFF >> nRecHeader; + pTIFF->ReadUChar( nRecHeader ); if ((nRecHeader&0x80)==0) { nRecCount=0x00000001+((sal_uLong)nRecHeader); @@ -642,7 +642,7 @@ sal_Bool TIFFReader::ReadMap( sal_uLong nMinPercent, sal_uLong nMaxPercent ) // return; } - *pTIFF >> nRecData; + pTIFF->ReadUChar( nRecData ); for ( i = 0; i < nRecCount; i++ ) *(pdst++) = nRecData; nRowBytesLeft -= nRecCount; @@ -1082,13 +1082,13 @@ void TIFFReader::ReadHeader() sal_uInt8 nbyte1, nbyte2; sal_uInt16 nushort; - *pTIFF >> nbyte1; + pTIFF->ReadUChar( nbyte1 ); if ( nbyte1 == 'I' ) pTIFF->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); else pTIFF->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); - *pTIFF >> nbyte2 >> nushort; + pTIFF->ReadUChar( nbyte2 ).ReadUInt16( nushort ); if ( nbyte1 != nbyte2 || ( nbyte1 != 'I' && nbyte1 != 'M' ) || nushort != 0x002a ) bStatus = sal_False; } @@ -1127,7 +1127,7 @@ sal_Bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) ReadHeader(); // read first IFD: - *pTIFF >> nFirstIfd; + pTIFF->ReadUInt32( nFirstIfd ); if( !nFirstIfd || pTIFF->GetError() ) bStatus = sal_False; @@ -1148,17 +1148,17 @@ sal_Bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) }; nMaxPos = std::max( pTIFF->Tell(), nMaxPos ); - *pTIFF >> nNumTags; + pTIFF->ReadUInt16( nNumTags ); // loop through tags: for( i = 0; i < nNumTags; i++ ) { - *pTIFF >> nTagType >> nDataType >> nDataLen >> nOffset; + pTIFF->ReadUInt16( nTagType ).ReadUInt16( nDataType ).ReadUInt32( nDataLen ).ReadUInt32( nOffset ); if( DataTypeSize() * nDataLen > 4 ) nMaxPos = std::max( nOrigPos + nOffset + DataTypeSize() * nDataLen, nMaxPos ); } - *pTIFF >> nOffset; + pTIFF->ReadUInt32( nOffset ); if ( pTIFF->IsEof() ) nOffset = 0; @@ -1207,17 +1207,17 @@ sal_Bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) pStripByteCounts = NULL; pMap[ 0 ] = pMap[ 1 ] = pMap[ 2 ] = pMap[ 3 ] = NULL; - *pTIFF >> nNumTags; + pTIFF->ReadUInt16( nNumTags ); nPos = pTIFF->Tell(); // Schleife ueber Tags: for( i = 0; i < nNumTags; i++ ) { - *pTIFF >> nTagType >> nDataType >> nDataLen; + pTIFF->ReadUInt16( nTagType ).ReadUInt16( nDataType ).ReadUInt32( nDataLen ); if( DataTypeSize() * nDataLen > 4 ) { - *pTIFF >> nOffset; + pTIFF->ReadUInt32( nOffset ); pTIFF->Seek( nOrigPos + nOffset ); } ReadTagData( nTagType, nDataLen ); @@ -1229,7 +1229,7 @@ sal_Bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) if ( bStatus == sal_False ) break; } - *pTIFF >> nNextIfd; + pTIFF->ReadUInt32( nNextIfd ); if ( pTIFF->IsEof() ) nNextIfd = 0; } diff --git a/filter/source/graphicfilter/itiff/lzwdecom.cxx b/filter/source/graphicfilter/itiff/lzwdecom.cxx index 2fdb054cd1d4..1766e5bea132 100644 --- a/filter/source/graphicfilter/itiff/lzwdecom.cxx +++ b/filter/source/graphicfilter/itiff/lzwdecom.cxx @@ -56,7 +56,7 @@ void LZWDecompressor::StartDecompression(SvStream & rIStream) nOutBufDataLen=0; - *pIStream >> nInputBitsBuf; + pIStream->ReadUChar( nInputBitsBuf ); nInputBitsBufSize=8; @@ -124,7 +124,7 @@ sal_uInt16 LZWDecompressor::GetNextCode() { nCode=(nCode<<nInputBitsBufSize) | nInputBitsBuf; nBits = nBits - nInputBitsBufSize; - *pIStream >> nInputBitsBuf; + pIStream->ReadUChar( nInputBitsBuf ); if ( bInvert ) nInputBitsBuf = ( ( nInputBitsBuf & 1 ) << 7 ) | ( ( nInputBitsBuf & 2 ) << 5 ) | ( ( nInputBitsBuf & 4 ) << 3 ) | ( ( nInputBitsBuf & 8 ) << 1 ) | ( ( nInputBitsBuf & 16 ) >> 1 ) | ( ( nInputBitsBuf & 32 ) >> 3 ) | ( ( nInputBitsBuf & 64 ) >> 5 ) | ( (nInputBitsBuf & 128 ) >> 7 ); nInputBitsBufSize=8; diff --git a/filter/source/msfilter/dffpropset.cxx b/filter/source/msfilter/dffpropset.cxx index 695ecde7f4d6..4af0a0c169fa 100644 --- a/filter/source/msfilter/dffpropset.cxx +++ b/filter/source/msfilter/dffpropset.cxx @@ -1110,8 +1110,8 @@ void DffPropSet::ReadPropSet( SvStream& rIn, bool bSetUninitializedOnly ) { sal_uInt16 nTmp; sal_uInt32 nRecType, nContent; - rIn >> nTmp - >> nContent; + rIn.ReadUInt16( nTmp ) + .ReadUInt32( nContent ); nRecType = nTmp & 0x3fff; @@ -1168,7 +1168,7 @@ void DffPropSet::ReadPropSet( SvStream& rIn, bool bSetUninitializedOnly ) sal_Int16 nNumElem, nNumElemReserved, nSize; rIn.Seek( nComplexDataFilePos ); - rIn >> nNumElem >> nNumElemReserved >> nSize; + rIn. ReadInt16( nNumElem ).ReadInt16( nNumElemReserved ).ReadInt16( nSize ); if ( nNumElemReserved >= nNumElem ) { // the size of these array elements is nowhere defined, @@ -1306,7 +1306,7 @@ OUString DffPropSet::GetPropertyString( sal_uInt32 nId, SvStream& rStrm ) const for( sal_Int32 nCharIdx = 0; nCharIdx < nStrLen; ++nCharIdx ) { sal_uInt16 nChar = 0; - rStrm >> nChar; + rStrm.ReadUInt16( nChar ); if( nChar > 0 ) aBuffer.append( static_cast< sal_Unicode >( nChar ) ); else diff --git a/filter/source/msfilter/dffrecordheader.cxx b/filter/source/msfilter/dffrecordheader.cxx index 3d9bae91cefa..232e2cf7c0e0 100644 --- a/filter/source/msfilter/dffrecordheader.cxx +++ b/filter/source/msfilter/dffrecordheader.cxx @@ -23,12 +23,12 @@ SvStream& ReadDffRecordHeader( SvStream& rIn, DffRecordHeader& rRec ) { rRec.nFilePos = rIn.Tell(); sal_uInt16 nTmp(0); - rIn >> nTmp; + rIn.ReadUInt16( nTmp ); rRec.nImpVerInst = nTmp; rRec.nRecVer = sal::static_int_cast< sal_uInt8 >(nTmp & 0x000F); rRec.nRecInstance = nTmp >> 4; - rIn >> rRec.nRecType; - rIn >> rRec.nRecLen; + rIn.ReadUInt16( rRec.nRecType ); + rIn.ReadUInt32( rRec.nRecLen ); // preserving overflow, optimally we would check // the record size against the parent header diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index bda2c1fd4489..25a853a74445 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -4277,15 +4277,15 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM pMergePicStreamBSE->Seek( pBlibEntry->mnPictureOffset ); sal_uInt16 n16; // record version and instance - *pMergePicStreamBSE >> n16; + pMergePicStreamBSE->ReadUInt16( n16 ); rSt.WriteUInt16( n16 ); // record type - *pMergePicStreamBSE >> n16; + pMergePicStreamBSE->ReadUInt16( n16 ); rSt.WriteUInt16( sal_uInt16( ESCHER_BlipFirst + nBlibType ) ); DBG_ASSERT( n16 == ESCHER_BlipFirst + nBlibType , "EscherGraphicProvider::WriteBlibStoreContainer: BLIP record types differ" ); sal_uInt32 n32; // record size - *pMergePicStreamBSE >> n32; + pMergePicStreamBSE->ReadUInt32( n32 ); nBlipSize -= 8; rSt.WriteUInt32( nBlipSize ); DBG_ASSERT( nBlipSize == n32, "EscherGraphicProvider::WriteBlibStoreContainer: BLIP sizes differ" ); @@ -5122,7 +5122,7 @@ void EscherEx::InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom ) mpOutStrm->Seek( mnStrmStartOfs ); while ( mpOutStrm->Tell() < nCurPos ) { - *mpOutStrm >> nType >> nSize; + mpOutStrm->ReadUInt32( nType ).ReadUInt32( nSize ); sal_uInt32 nEndOfRecord = mpOutStrm->Tell() + nSize; bool bContainer = (nType & 0x0F) == 0x0F; /* Expand the record, if the insertion position is inside, or if the diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index d270b0ee016d..052a8f24c308 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -369,12 +369,12 @@ DffPropertyReader::~DffPropertyReader() SvStream& operator>>( SvStream& rIn, SvxMSDffConnectorRule& rRule ) { - rIn >> rRule.nRuleId - >> rRule.nShapeA - >> rRule.nShapeB - >> rRule.nShapeC - >> rRule.ncptiA - >> rRule.ncptiB; + rIn.ReadUInt32( rRule.nRuleId ) + .ReadUInt32( rRule.nShapeA ) + .ReadUInt32( rRule.nShapeB ) + .ReadUInt32( rRule.nShapeC ) + .ReadUInt32( rRule.ncptiA ) + .ReadUInt32( rRule.ncptiB ); return rIn; } @@ -1064,13 +1064,13 @@ void GetShadeColors( const SvxMSDffManager& rManager, const DffPropertyReader& r if ( rProperties.SeekToContent( DFF_Prop_fillShadeColors, rIn ) ) { sal_uInt16 i = 0, nNumElem = 0, nNumElemReserved = 0, nSize = 0; - rIn >> nNumElem >> nNumElemReserved >> nSize; + rIn.ReadUInt16( nNumElem ).ReadUInt16( nNumElemReserved ).ReadUInt16( nSize ); for ( ; i < nNumElem; i++ ) { sal_Int32 nColor; sal_Int32 nDist; - rIn >> nColor >> nDist; + rIn.ReadInt32( nColor ).ReadInt32( nDist ); rShadeColors.push_back( ShadeColor( rManager.MSO_CLR_ToColor( nColor, DFF_Prop_fillColor ), 1.0 - ( nDist / 65536.0 ) ) ); } } @@ -1870,7 +1870,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt { sal_uInt16 nNumElemMem = 0; sal_uInt16 nElemSize = 8; - rIn >> nNumElem >> nNumElemMem >> nElemSize; + rIn.ReadUInt16( nNumElem ).ReadUInt16( nNumElemMem ).ReadUInt16( nElemSize ); } sal_Int16 nP1, nP2, nP3; sal_uInt16 nFlags; @@ -1878,7 +1878,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt uno::Sequence< OUString > aEquations( nNumElem ); for ( sal_uInt16 i = 0; i < nNumElem; i++ ) { - rIn >> nFlags >> nP1 >> nP2 >> nP3; + rIn.ReadUInt16( nFlags ).ReadInt16( nP1 ).ReadInt16( nP2 ).ReadInt16( nP3 ); aEquations[ i ] = EnhancedCustomShape2d::GetEquation( nFlags, nP1, nP2, nP3 ); } // pushing the whole Equations element @@ -1899,7 +1899,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt if ( SeekToContent( DFF_Prop_Handles, rIn ) ) { sal_uInt16 nNumElemMem = 0; - rIn >> nNumElem >> nNumElemMem >> nElemSize; + rIn.ReadUInt16( nNumElem ).ReadUInt16( nNumElemMem ).ReadUInt16( nElemSize ); } if ( nElemSize == 36 ) { @@ -1909,15 +1909,15 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt PropVec aHandlePropVec; sal_uInt32 nFlags; sal_Int32 nPositionX, nPositionY, nCenterX, nCenterY, nRangeXMin, nRangeXMax, nRangeYMin, nRangeYMax; - rIn >> nFlags - >> nPositionX - >> nPositionY - >> nCenterX - >> nCenterY - >> nRangeXMin - >> nRangeXMax - >> nRangeYMin - >> nRangeYMax; + rIn.ReadUInt32( nFlags ) + .ReadInt32( nPositionX ) + .ReadInt32( nPositionY ) + .ReadInt32( nCenterX ) + .ReadInt32( nCenterY ) + .ReadInt32( nRangeXMin ) + .ReadInt32( nRangeXMax ) + .ReadInt32( nRangeYMin ) + .ReadInt32( nRangeYMax ); if ( nPositionX == 2 ) // replacing center position with absolute value nPositionX = nCoordWidth / 2; @@ -2141,7 +2141,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt if ( SeekToContent( DFF_Prop_pVertices, rIn ) ) { sal_uInt16 nNumElemMemVert = 0; - rIn >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert; + rIn.ReadUInt16( nNumElemVert ).ReadUInt16( nNumElemMemVert ).ReadUInt16( nElemSizeVert ); } if ( nNumElemVert ) { @@ -2152,13 +2152,13 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt { if ( nElemSizeVert == 8 ) { - rIn >> nX - >> nY; + rIn.ReadInt32( nX ) + .ReadInt32( nY ); } else { - rIn >> nTmpA - >> nTmpB; + rIn.ReadInt16( nTmpA ) + .ReadInt16( nTmpB ); nX = nTmpA; nY = nTmpB; @@ -2184,7 +2184,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt { sal_uInt16 nNumElemMemSeg = 0; sal_uInt16 nElemSizeSeg = 2; - rIn >> nNumElemSeg >> nNumElemMemSeg >> nElemSizeSeg; + rIn.ReadUInt16( nNumElemSeg ).ReadUInt16( nNumElemMemSeg ).ReadUInt16( nElemSizeSeg ); } if ( nNumElemSeg ) { @@ -2193,7 +2193,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt aSegments.realloc( nNumElemSeg ); for ( i = 0; i < nNumElemSeg; i++ ) { - rIn >> nTmp; + rIn.ReadUInt16( nTmp ); nCommand = EnhancedCustomShapeSegmentCommand::UNKNOWN; nCnt = (sal_Int16)( nTmp & 0x1fff );//Last 13 bits for segment points number switch( nTmp >> 13 )//First 3 bits for command type @@ -2311,7 +2311,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt if ( SeekToContent( DFF_Prop_textRectangles, rIn ) ) { sal_uInt16 nNumElemMem = 0; - rIn >> nNumElem >> nNumElemMem >> nElemSize; + rIn.ReadUInt16( nNumElem ).ReadUInt16( nNumElemMem ).ReadUInt16( nElemSize ); } if ( nElemSize == 16 ) { @@ -2319,10 +2319,10 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt com::sun::star::uno::Sequence< com::sun::star::drawing::EnhancedCustomShapeTextFrame > aTextFrames( nNumElem ); for ( sal_uInt16 i = 0; i < nNumElem; i++ ) { - rIn >> nLeft - >> nTop - >> nRight - >> nBottom; + rIn.ReadInt32( nLeft ) + .ReadInt32( nTop ) + .ReadInt32( nRight ) + .ReadInt32( nBottom ); EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].TopLeft.First, nLeft ); EnhancedCustomShape2d::SetEnhancedCustomShapeParameter( aTextFrames[ i ].TopLeft.Second, nTop ); @@ -2344,7 +2344,7 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt sal_uInt16 nElemSizeVert = 8; if ( SeekToContent( DFF_Prop_connectorPoints, rIn ) ) - rIn >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert; + rIn.ReadUInt16( nNumElemVert ).ReadUInt16( nNumElemMemVert ).ReadUInt16( nElemSizeVert ); sal_Int32 nX, nY; sal_Int16 nTmpA, nTmpB; @@ -2353,13 +2353,13 @@ void DffPropertyReader::ApplyCustomShapeGeometryAttributes( SvStream& rIn, SfxIt { if ( nElemSizeVert == 8 ) { - rIn >> nX - >> nY; + rIn.ReadInt32( nX ) + .ReadInt32( nY ); } else { - rIn >> nTmpA - >> nTmpB; + rIn.ReadInt16( nTmpA ) + .ReadInt16( nTmpB ); nX = nTmpA; nY = nTmpB; @@ -3162,7 +3162,7 @@ sal_Bool SvxMSDffManager::SeekToShape( SvStream& rSt, void* /* pClientData */, s DffRecordHeader aShapeHd; if ( SeekToRec( rSt, DFF_msofbtSp, aEscherObjListHd.GetRecEndFilePos(), &aShapeHd ) ) { - rSt >> nShapeId; + rSt.ReadUInt32( nShapeId ); if ( nId == nShapeId ) { aEscherObjListHd.SeekToBegOfRecord( rSt ); @@ -4087,10 +4087,10 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r sal_uInt16 nPID; while( 5 < nBytesLeft ) { - rSt >> nPID; + rSt.ReadUInt16( nPID ); if ( rSt.GetError() != 0 ) break; - rSt >> nUDData; + rSt.ReadUInt32( nUDData ); if ( rSt.GetError() != 0 ) break; if ( nPID == 447 ) // @@ -4104,8 +4104,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r aObjData.bShapeType = maShapeRecords.SeekToContent( rSt, DFF_msofbtSp, SEEK_FROM_BEGINNING ); if ( aObjData.bShapeType ) { - rSt >> aObjData.nShapeId - >> aObjData.nSpFlags; + rSt.ReadUInt32( aObjData.nShapeId ) + .ReadUInt32( aObjData.nSpFlags ); aObjData.eShapeType = (MSO_SPT)maShapeRecords.Current()->nRecInstance; } else @@ -4148,7 +4148,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r if ( aObjData.bChildAnchor ) { sal_Int32 l, o, r, u; - rSt >> l >> o >> r >> u; + rSt.ReadInt32( l ).ReadInt32( o ).ReadInt32( r ).ReadInt32( u ); Scale( l ); Scale( o ); Scale( r ); @@ -4744,12 +4744,12 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS sal_Int32 l, t, r, b; if ( aShapeAtom.nRecLen == 16 ) { - rSt >> l >> t >> r >> b; + rSt.ReadInt32( l ).ReadInt32( t ).ReadInt32( r ).ReadInt32( b ); } else { sal_Int16 ls, ts, rs, bs; - rSt >> ts >> ls >> rs >> bs; // the order of coordinates is a bit strange... + rSt.ReadInt16( ts ).ReadInt16( ls ).ReadInt16( rs ).ReadInt16( bs ); // the order of coordinates is a bit strange... l = ls, t = ts, r = rs, b = bs; } Scale( l ); @@ -4772,7 +4772,7 @@ Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& rHd, SvS else if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor ) { sal_Int32 l, o, r, u; - rSt >> l >> o >> r >> u; + rSt.ReadInt32( l ).ReadInt32( o ).ReadInt32( r ).ReadInt32( u ); Scale( l ); Scale( o ); Scale( r ); @@ -4816,7 +4816,7 @@ void SvxMSDffManager::GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt if ( aShapeAtom.nRecType == DFF_msofbtChildAnchor ) { sal_Int32 l, o, r, u; - rSt >> l >> o >> r >> u; + rSt.ReadInt32( l ).ReadInt32( o ).ReadInt32( r ).ReadInt32( u ); Scale( l ); Scale( o ); Scale( r ); @@ -4902,10 +4902,10 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, sal_uInt16 nPID; while( 5 < nBytesLeft ) { - rSt >> nPID; + rSt.ReadUInt16( nPID ); if ( rSt.GetError() != 0 ) break; - rSt >> nUDData; + rSt.ReadUInt32( nUDData ); switch( nPID ) { case 0x038F: pImpRec->nXAlign = nUDData; break; @@ -5289,7 +5289,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, delete pTextImpRec->pWrapPolygon; pTextImpRec->pWrapPolygon = NULL; sal_uInt16 nNumElemVert, nNumElemMemVert, nElemSizeVert; - rSt >> nNumElemVert >> nNumElemMemVert >> nElemSizeVert; + rSt.ReadUInt16( nNumElemVert ).ReadUInt16( nNumElemMemVert ).ReadUInt16( nElemSizeVert ); if (nNumElemVert && ((nElemSizeVert == 8) || (nElemSizeVert == 4))) { pTextImpRec->pWrapPolygon = new Polygon(nNumElemVert); @@ -5297,11 +5297,11 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, { sal_Int32 nX, nY; if (nElemSizeVert == 8) - rSt >> nX >> nY; + rSt.ReadInt32( nX ).ReadInt32( nY ); else { sal_Int16 nSmallX, nSmallY; - rSt >> nSmallX >> nSmallY; + rSt.ReadInt16( nSmallX ).ReadInt16( nSmallY ); nX = nSmallX; nY = nSmallY; } @@ -5581,10 +5581,10 @@ void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL ) if ( SeekToRec( rStCtrl, DFF_msofbtDgg, aRecHd.GetRecEndFilePos(), &aDggAtomHd ) ) { aDggAtomHd.SeekToContent( rStCtrl ); - rStCtrl >> mnCurMaxShapeId - >> mnIdClusters - >> nDummy - >> mnDrawingsSaved; + rStCtrl.ReadUInt32( mnCurMaxShapeId ) + .ReadUInt32( mnIdClusters ) + .ReadUInt32( nDummy ) + .ReadUInt32( mnDrawingsSaved ); if ( mnIdClusters-- > 2 ) { @@ -5599,8 +5599,8 @@ void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL ) maFidcls.resize(mnIdClusters); for (sal_uInt32 i = 0; i < mnIdClusters; ++i) { - rStCtrl >> maFidcls[ i ].dgid - >> maFidcls[ i ].cspidCur; + rStCtrl.ReadUInt32( maFidcls[ i ].dgid ) + .ReadUInt32( maFidcls[ i ].cspidCur ); } } } @@ -5788,9 +5788,9 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, sal_uLong nLe if( bOk ) { rSt.SeekRel( nSkipBLIPLen ); - rSt >> nBLIPLen; + rSt.ReadUInt32( nBLIPLen ); rSt.SeekRel( nSkipBLIPPos ); - rSt >> nBLIPPos; + rSt.ReadUInt32( nBLIPPos ); bOk = rSt.GetError() == 0; nLength -= nSkipBLIPLen+ 4 + nSkipBLIPPos + 4; @@ -5933,7 +5933,7 @@ sal_Bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt, { // we've found the FSP gefunden: note Shape Type and Id! eShapeType = (MSO_SPT)nInst; - rSt >> aInfo.nShapeId; + rSt.ReadUInt32( aInfo.nShapeId ); rSt.SeekRel( nLength - 4 ); nReadSpCont += nLength; } @@ -5948,8 +5948,8 @@ sal_Bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt, long nStartShapePropTbl = rSt.Tell(); do { - rSt >> nPropId - >> nPropVal; + rSt.ReadUInt16( nPropId ) + .ReadUInt32( nPropVal ); nPropRead += 6; switch( nPropId ) @@ -6031,7 +6031,7 @@ sal_Bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt, } else if( ( DFF_msofbtClientTextbox == nFbt ) && ( 4 == nLength ) ) // Text-Box-Story-Entry found { - rSt >> aInfo.nTxBxComp; + rSt.ReadUInt32( aInfo.nTxBxComp ); // Add internal drawing container id to text id. // Note: The text id uses the first two bytes, while the internal // drawing container id used the second two bytes. @@ -6234,7 +6234,7 @@ sal_Bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, // read in size of metafile in EMUS sal_Int32 width, height; - rBLIPStream >> width >> height; + rBLIPStream.ReadInt32( width ).ReadInt32( height ); aMtfSize100.Width() = width; aMtfSize100.Height() = height; @@ -6385,7 +6385,7 @@ bool SvxMSDffManager::ReadCommonRecordHeader(SvStream& rSt, sal_uInt8& rVer, sal_uInt16& rInst, sal_uInt16& rFbt, sal_uInt32& rLength) { sal_uInt16 nTmp(0); - rSt >> nTmp >> rFbt >> rLength; + rSt.ReadUInt16( nTmp ).ReadUInt16( rFbt ).ReadUInt32( rLength ); rVer = sal::static_int_cast< sal_uInt8 >(nTmp & 15); rInst = nTmp >> 4; if (!rSt.good()) @@ -6619,9 +6619,9 @@ sal_Bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen, sal_uInt32 nBytesRead = 0; do { - rStm >> nType; - rStm >> nRecType; - rStm >> nStrLen; + rStm.ReadUInt32( nType ); + rStm.ReadUInt32( nRecType ); + rStm.ReadUInt32( nStrLen ); if( nStrLen ) { if( 0x10000L > nStrLen ) @@ -6634,9 +6634,9 @@ sal_Bool SvxMSDffManager::ConvertToOle2( SvStream& rStm, sal_uInt32 nReadLen, else break; } - rStm >> nDummy0; - rStm >> nDummy1; - rStm >> nDataLen; + rStm.ReadUInt32( nDummy0 ); + rStm.ReadUInt32( nDummy1 ); + rStm.ReadUInt32( nDataLen ); nBytesRead += 6 * sizeof( sal_uInt32 ) + nStrLen + nDataLen; @@ -6849,7 +6849,7 @@ com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > SvxMS { // TODO/LATER: perhaps we need to retrieve VisArea and Metafile from the storage also SotStorageStreamRef xStr = rSrcStg.OpenSotStream( OUString( "package_stream" ), STREAM_STD_READ ); - *xStr >> *xMemStream; + xStr->ReadStream( *xMemStream ); } else { @@ -7019,7 +7019,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( if ( xObjInfoSrc.Is() && !xObjInfoSrc->GetError() ) { sal_uInt8 nByte = 0; - *xObjInfoSrc >> nByte; + xObjInfoSrc->ReadUChar( nByte ); if ( ( nByte >> 4 ) & embed::Aspects::MSOLE_ICON ) nAspect = embed::Aspects::MSOLE_ICON; } @@ -7068,7 +7068,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( else if( pDataStrm ) { sal_uInt32 nLen, nDummy; - *pDataStrm >> nLen >> nDummy; + pDataStrm->ReadUInt32( nLen ).ReadUInt32( nDummy ); if( SVSTREAM_OK != pDataStrm->GetError() || // Id in BugDoc - exist there other Ids? // The ConvertToOle2 - does not check for consistent diff --git a/filter/source/msfilter/mstoolbar.cxx b/filter/source/msfilter/mstoolbar.cxx index c4a6c7f13fc7..4fcb0392409d 100644 --- a/filter/source/msfilter/mstoolbar.cxx +++ b/filter/source/msfilter/mstoolbar.cxx @@ -198,13 +198,13 @@ bool TBCHeader::Read( SvStream &rS ) { OSL_TRACE("TBCHeader::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); - rS >> bSignature >> bVersion >> bFlagsTCR >> tct >> tcid >> tbct >> bPriority; + rS.ReadSChar( bSignature ).ReadSChar( bVersion ).ReadUChar( bFlagsTCR ).ReadUChar( tct ).ReadUInt16( tcid ).ReadUInt32( tbct ).ReadUChar( bPriority ); // bit 4 ( from lsb ) if ( bFlagsTCR & 0x10 ) { width.reset( new sal_uInt16 ); height.reset( new sal_uInt16 ); - rS >> *width >> *height; + rS.ReadUInt16( *width ).ReadUInt16( *height ); } return true; } @@ -378,7 +378,7 @@ WString::Read( SvStream &rS ) OSL_TRACE("WString::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); sal_uInt8 nChars = 0; - rS >> nChars; + rS.ReadUChar( nChars ); sString = read_uInt16s_ToOUString(rS, nChars); return true; } @@ -395,12 +395,12 @@ TBCExtraInfo::Read( SvStream &rS ) if( !wstrHelpFile.Read( rS ) ) return false; - rS >> idHelpContext; + rS.ReadInt32( idHelpContext ); if ( !wstrTag.Read( rS ) || !wstrOnAction.Read( rS ) || !wstrParam.Read( rS ) ) return false; - rS >> tbcu >> tbmg; + rS.ReadSChar( tbcu ).ReadSChar( tbmg ); return true; } @@ -437,7 +437,7 @@ bool TBCGeneralInfo::Read( SvStream &rS ) { OSL_TRACE("TBCGeneralInfo::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); - rS >> bFlags; + rS.ReadUChar( bFlags ); if ( ( bFlags & 0x1 ) && !customText.Read( rS ) ) return false; @@ -517,7 +517,7 @@ TBCMenuSpecific::Read( SvStream &rS) { OSL_TRACE("TBCMenuSpecific::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); - rS >> tbid; + rS.ReadInt32( tbid ); if ( tbid == 1 ) { name.reset( new WString() ); @@ -552,7 +552,7 @@ bool TBCBSpecific::Read( SvStream &rS) { OSL_TRACE("TBCBSpecific::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); - rS >> bFlags; + rS.ReadUChar( bFlags ); // bFlags determines what we read next @@ -568,7 +568,7 @@ bool TBCBSpecific::Read( SvStream &rS) if ( bFlags & 0x10 ) { iBtnFace.reset( new sal_uInt16 ); - rS >> *iBtnFace.get(); + rS.ReadUInt16( *iBtnFace.get() ); } // if bFlags.fAccelerator equals 1 ( 0x04 ) if ( bFlags & 0x04 ) @@ -659,7 +659,7 @@ TBCCDData::~TBCCDData() bool TBCCDData::Read( SvStream &rS) { nOffSet = rS.Tell(); - rS >> cwstrItems; + rS.ReadInt16( cwstrItems ); if ( cwstrItems ) { for( sal_Int32 index=0; index < cwstrItems; ++index ) @@ -670,7 +670,7 @@ bool TBCCDData::Read( SvStream &rS) wstrList.push_back( aString ); } } - rS >> cwstrMRU >> iSel >> cLines >> dxWidth; + rS.ReadInt16( cwstrMRU ).ReadInt16( iSel ).ReadInt16( cLines ).ReadInt16( dxWidth ); return wstrEdit.Read( rS ); } @@ -711,7 +711,7 @@ bool TBCBitMap::Read( SvStream& rS) { OSL_TRACE("TBCBitMap::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); - rS >> cbDIB; + rS.ReadInt32( cbDIB ); // cbDIB = sizeOf(biHeader) + sizeOf(colors) + sizeOf(bitmapData) + 10 return ReadDIB(mBitMap, rS, false); } @@ -737,7 +737,7 @@ bool TB::Read(SvStream &rS) { OSL_TRACE("TB::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); - rS >> bSignature >> bVersion >> cCL >> ltbid >> ltbtr >> cRowsDefault >> bFlags; + rS.ReadUChar( bSignature ).ReadUChar( bVersion ).ReadInt16( cCL ).ReadInt32( ltbid ).ReadUInt32( ltbtr ).ReadUInt16( cRowsDefault ).ReadUInt16( bFlags ); name.Read( rS ); return true; @@ -770,7 +770,7 @@ bool TBVisualData::Read( SvStream& rS ) { OSL_TRACE("TBVisualData::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); - rS >> tbds >> tbv >> tbdsDock >> iRow; + rS.ReadSChar( tbds ).ReadSChar( tbv ).ReadSChar( tbdsDock ).ReadSChar( iRow ); rcDock.Read( rS ); rcFloat.Read( rS ); return true; diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index da8cf92ea580..3362dbd483f0 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -162,14 +162,14 @@ SvStream& ReadPptCurrentUserAtom( SvStream& rIn, PptCurrentUserAtom& rAtom ) { sal_uInt32 nLen; sal_uInt16 nUserNameLen, nPad; - rIn >> nLen - >> rAtom.nMagic - >> rAtom.nCurrentUserEdit - >> nUserNameLen - >> rAtom.nDocFileVersion - >> rAtom.nMajorVersion - >> rAtom.nMinorVersion - >> nPad; + rIn.ReadUInt32( nLen ) + .ReadUInt32( rAtom.nMagic ) + .ReadUInt32( rAtom.nCurrentUserEdit ) + .ReadUInt16( nUserNameLen ) + .ReadUInt16( rAtom.nDocFileVersion ) + .ReadUChar( rAtom.nMajorVersion ) + .ReadUChar( rAtom.nMinorVersion ) + .ReadUInt16( nPad ); rAtom.aCurrentUser = SvxMSDffManager::MSDFFReadZString( rIn, nUserNameLen, true ); } aHd.SeekToEndOfRecord( rIn ); @@ -185,10 +185,10 @@ SvStream& ReadPptSlidePersistAtom( SvStream& rIn, PptSlidePersistAtom& rAtom ) { DffRecordHeader aHd; ReadDffRecordHeader( rIn, aHd ) - >> rAtom.nPsrReference - >> rAtom.nFlags - >> rAtom.nNumberTexts - >> rAtom.nSlideId; + .ReadUInt32( rAtom.nPsrReference ) + .ReadUInt32( rAtom.nFlags ) + .ReadUInt32( rAtom.nNumberTexts ) + .ReadUInt32( rAtom.nSlideId ); aHd.SeekToEndOfRecord( rIn ); return rIn; } @@ -204,16 +204,16 @@ sal_uInt16 PptSlidePersistList::FindPage(sal_uInt32 nId) const SvStream& ReadPptInteractiveInfoAtom( SvStream& rIn, PptInteractiveInfoAtom& rAtom ) { - rIn >> rAtom.nSoundRef - >> rAtom.nExHyperlinkId - >> rAtom.nAction - >> rAtom.nOleVerb - >> rAtom.nJump - >> rAtom.nFlags - >> rAtom.nHyperlinkType - >> rAtom.nUnknown1 - >> rAtom.nUnknown2 - >> rAtom.nUnknown3; + rIn.ReadUInt32( rAtom.nSoundRef ) + .ReadUInt32( rAtom.nExHyperlinkId ) + .ReadUChar( rAtom.nAction ) + .ReadUChar( rAtom.nOleVerb ) + .ReadUChar( rAtom.nJump ) + .ReadUChar( rAtom.nFlags ) + .ReadUChar( rAtom.nHyperlinkType ) + .ReadUChar( rAtom.nUnknown1 ) + .ReadUChar( rAtom.nUnknown2 ) + .ReadUChar( rAtom.nUnknown3 ); return rIn; } @@ -223,12 +223,12 @@ SvStream& ReadPptExOleObjAtom( SvStream& rIn, PptExOleObjAtom& rAtom ) sal_uInt32 nDummy2; sal_uInt32 nDummy4; - rIn >> rAtom.nAspect - >> nDummy1 - >> rAtom.nId - >> nDummy2 - >> rAtom.nPersistPtr - >> nDummy4; + rIn.ReadUInt32( rAtom.nAspect ) + .ReadUInt32( nDummy1 ) + .ReadUInt32( rAtom.nId ) + .ReadUInt32( nDummy2 ) + .ReadUInt32( rAtom.nPersistPtr ) + .ReadUInt32( nDummy4 ); return rIn; } @@ -258,17 +258,17 @@ SvStream& ReadPptDocumentAtom(SvStream& rIn, PptDocumentAtom& rAtom) sal_Int8 nEmbeddedTrueType, nTitlePlaceHoldersOmitted, nRightToLeft, nShowComments; ReadDffRecordHeader( rIn, aHd ) - >> nSlideX >> nSlideY - >> nNoticeX >> nNoticeY - >> nDummy >> nDummy // skip ZoomRation - >> rAtom.nNotesMasterPersist - >> rAtom.nHandoutMasterPersist - >> rAtom.n1stPageNumber - >> nSlidePageFormat - >> nEmbeddedTrueType - >> nTitlePlaceHoldersOmitted - >> nRightToLeft - >> nShowComments; + .ReadInt32( nSlideX ).ReadInt32( nSlideY ) + .ReadInt32( nNoticeX ).ReadInt32( nNoticeY ) + .ReadInt32( nDummy ).ReadInt32( nDummy ) // skip ZoomRation + .ReadUInt32( rAtom.nNotesMasterPersist ) + .ReadUInt32( rAtom.nHandoutMasterPersist ) + .ReadUInt16( rAtom.n1stPageNumber ) + .ReadUInt16( nSlidePageFormat ) + .ReadSChar( nEmbeddedTrueType ) + .ReadSChar( nTitlePlaceHoldersOmitted ) + .ReadSChar( nRightToLeft ) + .ReadSChar( nShowComments ); rAtom.aSlidesPageSize.Width() = nSlideX; rAtom.aSlidesPageSize.Height() = nSlideY; rAtom.aNotesPageSize.Width() = nNoticeX; @@ -291,7 +291,7 @@ void PptSlideLayoutAtom::Clear() SvStream& ReadPptSlideLayoutAtom( SvStream& rIn, PptSlideLayoutAtom& rAtom ) { - rIn >> rAtom.eLayout; + rIn.ReadInt32( rAtom.eLayout ); rIn.Read( rAtom.aPlaceholderId, 8 ); return rIn; } @@ -301,9 +301,9 @@ SvStream& ReadPptSlideAtom( SvStream& rIn, PptSlideAtom& rAtom ) DffRecordHeader aHd; ReadDffRecordHeader( rIn, aHd ); ReadPptSlideLayoutAtom( rIn, rAtom.aLayout ); - rIn >> rAtom.nMasterId - >> rAtom.nNotesId - >> rAtom.nFlags; + rIn.ReadUInt32( rAtom.nMasterId ) + .ReadUInt32( rAtom.nNotesId ) + .ReadUInt16( rAtom.nFlags ); aHd.SeekToEndOfRecord( rIn ); return rIn; } @@ -318,8 +318,8 @@ SvStream& ReadPptNotesAtom( SvStream& rIn, PptNotesAtom& rAtom ) { DffRecordHeader aHd; ReadDffRecordHeader( rIn, aHd ) - >> rAtom.nSlideId - >> rAtom.nFlags; + .ReadUInt32( rAtom.nSlideId ) + .ReadUInt16( rAtom.nFlags ); aHd.SeekToEndOfRecord( rIn ); return rIn; } @@ -366,10 +366,10 @@ SvStream& ReadPptFontEntityAtom( SvStream& rIn, PptFontEntityAtom& rAtom ) sal_uInt8 lfCharset, lfPitchAndFamily; - rIn >> lfCharset - >> rAtom.lfClipPrecision - >> rAtom.lfQuality - >> lfPitchAndFamily; + rIn.ReadUChar( lfCharset ) + .ReadUChar( rAtom.lfClipPrecision ) + .ReadUChar( rAtom.lfQuality ) + .ReadUChar( lfPitchAndFamily ); switch( lfCharset ) { @@ -445,13 +445,13 @@ class PptFontCollection: public boost::ptr_vector<PptFontEntityAtom> { SvStream& ReadPptUserEditAtom( SvStream& rIn, PptUserEditAtom& rAtom ) { ReadDffRecordHeader( rIn, rAtom.aHd ) - >> rAtom.nLastSlideID - >> rAtom.nVersion - >> rAtom.nOffsetLastEdit - >> rAtom.nOffsetPersistDirectory - >> rAtom.nDocumentRef - >> rAtom.nMaxPersistWritten - >> rAtom.eLastViewType; + .ReadInt32( rAtom.nLastSlideID ) + .ReadUInt32( rAtom.nVersion ) + .ReadUInt32( rAtom.nOffsetLastEdit ) + .ReadUInt32( rAtom.nOffsetPersistDirectory ) + .ReadUInt32( rAtom.nDocumentRef ) + .ReadUInt32( rAtom.nMaxPersistWritten ) + .ReadInt16( rAtom.eLastViewType ); rAtom.aHd.SeekToEndOfRecord(rIn); return rIn; } @@ -464,9 +464,9 @@ void PptOEPlaceholderAtom::Clear() SvStream& ReadPptOEPlaceholderAtom( SvStream& rIn, PptOEPlaceholderAtom& rAtom ) { - rIn >> rAtom.nPlacementId - >> rAtom.nPlaceholderId - >> rAtom.nPlaceholderSize; + rIn.ReadUInt32( rAtom.nPlacementId ) + .ReadUChar( rAtom.nPlaceholderId ) + .ReadUChar( rAtom.nPlaceholderSize ); return rIn; } @@ -577,12 +577,12 @@ void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, sal_Int32 l, t, r, b; if ( rHd.nRecLen == 16 ) { - rSt >> l >> t >> r >> b; + rSt.ReadInt32( l ).ReadInt32( t ).ReadInt32( r ).ReadInt32( b ); } else { sal_Int16 ls, ts, rs, bs; - rSt >> ts >> ls >> rs >> bs; // the order of coordinates is a bit strange... + rSt.ReadInt16( ts ).ReadInt16( ls ).ReadInt16( rs ).ReadInt16( bs ); // the order of coordinates is a bit strange... l = ls, t = ts, r = rs, b = bs; } Scale( l ); @@ -600,12 +600,12 @@ void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic { sal_uInt16 nX, nGlobalColorsCount, nFillColorsCount; - rSt >> nX - >> nGlobalColorsCount - >> nFillColorsCount - >> nX - >> nX - >> nX; + rSt.ReadUInt16( nX ) + .ReadUInt16( nGlobalColorsCount ) + .ReadUInt16( nFillColorsCount ) + .ReadUInt16( nX ) + .ReadUInt16( nX ) + .ReadUInt16( nX ); if ( ( nGlobalColorsCount <= 64 ) && ( nFillColorsCount <= 64 ) ) { @@ -631,17 +631,17 @@ void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic sal_uInt32 nIndex, nPos = rSt.Tell(); sal_uInt8 nDummy, nRed, nGreen, nBlue; sal_uInt16 nChanged; - rSt >> nChanged; + rSt.ReadUInt16( nChanged ); if ( nChanged & 1 ) { sal_uInt32 nColor = 0; - rSt >> nDummy - >> nRed - >> nDummy - >> nGreen - >> nDummy - >> nBlue - >> nIndex; + rSt.ReadUChar( nDummy ) + .ReadUChar( nRed ) + .ReadUChar( nDummy ) + .ReadUChar( nGreen ) + .ReadUChar( nDummy ) + .ReadUChar( nBlue ) + .ReadUInt32( nIndex ); if ( nIndex < 8 ) { @@ -652,12 +652,12 @@ void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic } nColor = nRed | ( nGreen << 8 ) | ( nBlue << 16 ); *pCurrentNew++ = nColor; - rSt >> nDummy - >> nRed - >> nDummy - >> nGreen - >> nDummy - >> nBlue; + rSt.ReadUChar( nDummy ) + .ReadUChar( nRed ) + .ReadUChar( nDummy ) + .ReadUChar( nGreen ) + .ReadUChar( nDummy ) + .ReadUChar( nBlue ); nColor = nRed | ( nGreen << 8 ) | ( nBlue << 16 ); *pCurrentOriginal++ = nColor; (*pCount)++; @@ -1184,14 +1184,14 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi if ( aSecPropSet.SeekToContent( DFF_Prop_tableRowProperties, rSt ) ) { sal_Int16 i, nRowCount = 0; - rSt >> nRowCount >> i >> i; + rSt.ReadInt16( nRowCount ).ReadInt16( i ).ReadInt16( i ); if ( nRowCount ) { sal_uInt32* pTableArry = new sal_uInt32[ nRowCount + 2 ]; pTableArry[ 0 ] = nTableProperties; pTableArry[ 1 ] = nRowCount; for ( i = 0; i < nRowCount; i++ ) - rSt >> pTableArry[ i + 2 ]; + rSt.ReadUInt32( pTableArry[ i + 2 ] ); rData.pTableRowProperties = pTableArry; } } @@ -1344,14 +1344,14 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const O while ( bOk && ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < nPibLen ) ) { sal_uInt32 nOfs(0); - rStCtrl >> nOfs; + rStCtrl.ReadUInt32( nOfs ); sal_uInt32 nAnz = nOfs; nOfs &= 0x000FFFFF; nAnz >>= 20; while ( bOk && ( rStCtrl.GetError() == 0 ) && ( nAnz > 0 ) && ( nOfs <= nPersistPtrAnz ) ) { sal_uInt32 nPt(0); - rStCtrl >> nPt; + rStCtrl.ReadUInt32( nPt ); if ( !pPersistPtr[ nOfs ] ) { pPersistPtr[ nOfs ] = nPt; @@ -1942,7 +1942,7 @@ SvMemoryStream* SdrPowerPointImport::ImportExOleObjStg( sal_uInt32 nPersistPtr, sal_uInt32 nLen = aHd.nRecLen - 4; if ( (sal_Int32)nLen > 0 ) { - rStCtrl >> nOleId; + rStCtrl.ReadUInt32( nOleId ); pRet = new SvMemoryStream; ZCodec aZCodec( 0x8000, 0x8000 ); aZCodec.BeginCompression(); @@ -1975,9 +1975,9 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt if ( SeekToRec( rStCtrl, PPT_PST_VBAInfoAtom, pHd->GetRecEndFilePos(), pHd ) ) { sal_uInt32 nPersistPtr, nIDoNotKnow1, nIDoNotKnow2; - rStCtrl >> nPersistPtr - >> nIDoNotKnow1 - >> nIDoNotKnow2; + rStCtrl.ReadUInt32( nPersistPtr ) + .ReadUInt32( nIDoNotKnow1 ) + .ReadUInt32( nIDoNotKnow2 ); sal_uInt32 nOleId; SvMemoryStream* pBas = ImportExOleObjStg( nPersistPtr, nOleId ); @@ -2093,7 +2093,7 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt ReadDffRecordHeader( rStCtrl, aHd ); if ( aHd.nRecType == DFF_PST_ExOleObjStg ) { - rStCtrl >> nId; + rStCtrl.ReadUInt32( nId ); aOleObjectList.push_back( new PPTOleEntry( aAt.nId, aHd.nFilePos, pShell, nRecType, aAt.nAspect ) ); } @@ -2651,17 +2651,17 @@ void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage, case PPT_PST_CommentAtom10 : { - rStCtrl >> nIndex - >> aDateTime.Year - >> aDateTime.Month - >> aDateTime.Day // DayOfWeek - >> aDateTime.Day - >> aDateTime.Hours - >> aDateTime.Minutes - >> aDateTime.Seconds - >> aDateTime.NanoSeconds - >> nPosX - >> nPosY; + rStCtrl.ReadInt32( nIndex ) + .ReadInt16( aDateTime.Year ) + .ReadUInt16( aDateTime.Month ) + .ReadUInt16( aDateTime.Day ) // DayOfWeek + .ReadUInt16( aDateTime.Day ) + .ReadUInt16( aDateTime.Hours ) + .ReadUInt16( aDateTime.Minutes ) + .ReadUInt16( aDateTime.Seconds ) + .ReadUInt32( aDateTime.NanoSeconds ) + .ReadInt32( nPosX ) + .ReadInt32( nPosY ); aDateTime.NanoSeconds *= ::Time::nanoPerMilli; } @@ -2783,7 +2783,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* if ( aShapeHd.nRecType == DFF_msofbtSp ) { sal_uInt32 nSpFlags; - rStCtrl >> nSpFlags >> nSpFlags; + rStCtrl.ReadUInt32( nSpFlags ).ReadUInt32( nSpFlags ); if ( nSpFlags & SP_FBACKGROUND ) { aEscherObjListHd.SeekToBegOfRecord( rStCtrl ); @@ -3096,7 +3096,7 @@ void SdrEscherImport::ImportHeaderFooterContainer( DffRecordHeader& rHd, HeaderF switch ( aHd.nRecType ) { case PPT_PST_HeadersFootersAtom : - rStCtrl >> rE.nAtom; + rStCtrl.ReadUInt32( rE.nAtom ); break; case PPT_PST_CString : @@ -3138,18 +3138,18 @@ PPTExtParaLevel::PPTExtParaLevel() SvStream& ReadPPTExtParaLevel( SvStream& rIn, PPTExtParaLevel& rLevel ) { rLevel.mbSet = sal_True; - rIn >> rLevel.mnExtParagraphMask; + rIn.ReadUInt32( rLevel.mnExtParagraphMask ); if ( rLevel.mnExtParagraphMask & 0x00800000 ) - rIn >> rLevel.mnBuBlip; + rIn.ReadUInt16( rLevel.mnBuBlip ); if ( rLevel.mnExtParagraphMask & 0x02000000 ) - rIn >> rLevel.mnHasAnm; + rIn.ReadUInt16( rLevel.mnHasAnm ); if ( rLevel.mnExtParagraphMask & 0x01000000 ) - rIn >> rLevel.mnAnmScheme; + rIn.ReadUInt32( rLevel.mnAnmScheme ); if ( rLevel.mnExtParagraphMask & 0x04000000 ) - rIn >> rLevel.mpfPP10Ext; - rIn >> rLevel.mnExtCharacterMask; + rIn.ReadUInt32( rLevel.mpfPP10Ext ); + rIn.ReadUInt32( rLevel.mnExtCharacterMask ); if ( rLevel.mnExtCharacterMask & 0x100000 ) - rIn >> rLevel.mcfPP10Ext; + rIn.ReadUInt32( rLevel.mcfPP10Ext ); return rIn; } @@ -3211,7 +3211,7 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const ReadDffRecordHeader( rSt, aBuGraAtomHd ); if ( aBuGraAtomHd.nRecType == PPT_PST_ExtendedBuGraAtom ) { - rSt >> nType; + rSt.ReadUInt16( nType ); Graphic aGraphic; if ( rMan.GetBLIPDirect( rSt, aGraphic, NULL ) ) { @@ -3288,7 +3288,7 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const if ( aHd.nRecInstance < PPT_STYLESHEETENTRYS ) { sal_uInt16 nDepth, i = 0; - rSt >> nDepth; + rSt.ReadUInt16( nDepth ); if ( i <= 5 ) { @@ -3777,35 +3777,35 @@ void PPTCharSheet::Read( SvStream& rIn, sal_Bool /*bMasterStyle*/, sal_uInt32 nL // Zeichenattribute sal_uInt32 nCMask; sal_uInt16 nVal16; - rIn >> nCMask; + rIn.ReadUInt32( nCMask ); if ( nCMask & 0x0000FFFF ) { sal_uInt16 nBitAttr; maCharLevel[ nLevel ].mnFlags &= ~( (sal_uInt16)nCMask ); - rIn >> nBitAttr; // Bit attributes (bold, underlined, ...) + rIn.ReadUInt16( nBitAttr ); // Bit attributes (bold, underlined, ...) maCharLevel[ nLevel ].mnFlags |= nBitAttr; } if ( nCMask & ( 1 << PPT_CharAttr_Font ) ) // 0x00010000 - rIn >> maCharLevel[ nLevel ].mnFont; + rIn.ReadUInt16( maCharLevel[ nLevel ].mnFont ); if ( nCMask & ( 1 << PPT_CharAttr_AsianOrComplexFont ) ) // 0x00200000 - rIn >> maCharLevel[ nLevel ].mnAsianOrComplexFont; + rIn.ReadUInt16( maCharLevel[ nLevel ].mnAsianOrComplexFont ); if ( nCMask & ( 1 << PPT_CharAttr_ANSITypeface ) ) // 0x00400000 - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); if ( nCMask & ( 1 << PPT_CharAttr_Symbol ) ) // 0x00800000 - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); if ( nCMask & ( 1 << PPT_CharAttr_FontHeight ) ) // 0x00020000 - rIn >> maCharLevel[ nLevel ].mnFontHeight; + rIn.ReadUInt16( maCharLevel[ nLevel ].mnFontHeight ); if ( nCMask & ( 1 << PPT_CharAttr_FontColor ) ) // 0x00040000 { - rIn >> maCharLevel[ nLevel ].mnFontColor; + rIn.ReadUInt32( maCharLevel[ nLevel ].mnFontColor ); if( ! (maCharLevel[ nLevel ].mnFontColor & 0xff000000 ) ) maCharLevel[ nLevel ].mnFontColor = PPT_COLSCHEME_HINTERGRUND; } if ( nCMask & ( 1 << PPT_CharAttr_Escapement ) ) // 0x00080000 - rIn >> maCharLevel[ nLevel ].mnEscapement; + rIn.ReadUInt16( maCharLevel[ nLevel ].mnEscapement ); if ( nCMask & 0x00100000 ) // 0x00100000 - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); nCMask >>= 24; while( nCMask ) @@ -3813,7 +3813,7 @@ void PPTCharSheet::Read( SvStream& rIn, sal_Bool /*bMasterStyle*/, sal_uInt32 nL if ( nCMask & 1 ) { OSL_FAIL( "PPTCharSheet::Read - unknown attribute, send me this document (SJ)" ); - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); } nCMask >>= 1; } @@ -3878,90 +3878,90 @@ void PPTParaSheet::Read( SdrPowerPointImport& // Absatzattribute sal_uInt16 nVal16, i, nMask16; sal_uInt32 nVal32, nPMask; - rIn >> nPMask; + rIn.ReadUInt32( nPMask ); nMask16 = (sal_uInt16)nPMask & 0xf; if ( nMask16 ) { - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); maParaLevel[ nLevel ].mnBuFlags &=~ nMask16; nVal16 &= nMask16; maParaLevel[ nLevel ].mnBuFlags |= nVal16; } if ( nPMask & 0x0080 ) - rIn >> maParaLevel[ nLevel ].mnBulletChar; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnBulletChar ); if ( nPMask & 0x0010 ) - rIn >> maParaLevel[ nLevel ].mnBulletFont; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnBulletFont ); if ( nPMask & 0x0040 ) { - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); maParaLevel[ nLevel ].mnBulletHeight = nVal16; } if ( nPMask & 0x0020 ) { - rIn >> nVal32; + rIn.ReadUInt32( nVal32 ); maParaLevel[ nLevel ].mnBulletColor = nVal32; } if ( bFirst ) { if ( nPMask & 0xF00 ) { // AbsJust! - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); maParaLevel[ nLevel ].mnAdjust = nVal16 & 3; } if ( nPMask & 0x1000 ) - rIn >> maParaLevel[ nLevel ].mnLineFeed; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnLineFeed ); if ( nPMask & 0x2000 ) - rIn >> maParaLevel[ nLevel ].mnUpperDist; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnUpperDist ); if ( nPMask & 0x4000 ) - rIn >> maParaLevel[ nLevel ].mnLowerDist; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnLowerDist ); if ( nPMask & 0x8000 ) - rIn >> maParaLevel[ nLevel ].mnTextOfs; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnTextOfs ); if ( nPMask & 0x10000 ) - rIn >> maParaLevel[ nLevel ].mnBulletOfs; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnBulletOfs ); if ( nPMask & 0x20000 ) - rIn >> maParaLevel[ nLevel ].mnDefaultTab; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnDefaultTab ); if ( nPMask & 0x200000 ) { // number of tabulators - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); for ( i = 0; i < nVal16; i++ ) - rIn >> nVal32; // reading the tabulators + rIn.ReadUInt32( nVal32 ); // reading the tabulators } if ( nPMask & 0x40000 ) - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); if ( nPMask & 0x80000 ) - rIn >> maParaLevel[ nLevel ].mnAsianLineBreak; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnAsianLineBreak ); if ( nPMask & 0x100000 ) - rIn >> maParaLevel[ nLevel ].mnBiDi; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnBiDi ); } else { if ( nPMask & 0x800 ) { - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); maParaLevel[ nLevel ].mnAdjust = nVal16 & 3; } if ( nPMask & 0x1000 ) - rIn >> maParaLevel[ nLevel ].mnLineFeed; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnLineFeed ); if ( nPMask & 0x2000 ) - rIn >> maParaLevel[ nLevel ].mnUpperDist; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnUpperDist ); if ( nPMask & 0x4000 ) - rIn >> maParaLevel[ nLevel ].mnLowerDist; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnLowerDist ); if ( nPMask & 0x8000 ) - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); if ( nPMask & 0x100 ) - rIn >> maParaLevel[ nLevel ].mnTextOfs; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnTextOfs ); if ( nPMask & 0x200 ) - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); if ( nPMask & 0x400 ) - rIn >> maParaLevel[ nLevel ].mnBulletOfs; + rIn.ReadUInt16( maParaLevel[ nLevel ].mnBulletOfs ); if ( nPMask & 0x10000 ) - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); if ( nPMask & 0xe0000 ) { sal_uInt16 nFlagsToModifyMask = (sal_uInt16)( ( nPMask >> 17 ) & 7 ); - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); // bits that are not involved to zero nVal16 &= nFlagsToModifyMask; // bits that are to change to zero @@ -3972,12 +3972,12 @@ void PPTParaSheet::Read( SdrPowerPointImport& if ( nPMask & 0x100000 ) { // number of tabulators - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); for ( i = 0; i < nVal16; i++ ) - rIn >> nVal32; // reading the tabulators + rIn.ReadUInt32( nVal32 ); // reading the tabulators } if ( nPMask & 0x200000 ) - rIn >> maParaLevel[ nLevel ].mnBiDi; // #88602# + rIn.ReadUInt16( maParaLevel[ nLevel ].mnBiDi ); // #88602# } nPMask >>= 22; @@ -3991,7 +3991,7 @@ void PPTParaSheet::Read( SdrPowerPointImport& OSL_FAIL( "PPTParaSheet::Read - unknown attribute, send me this document (SJ)" ); } #endif - rIn >> nVal16; + rIn.ReadUInt16( nVal16 ); } nPMask >>= 1; } @@ -4050,7 +4050,7 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd if ( aTxMasterStyleHd.nRecType == PPT_PST_TxMasterStyleAtom ) { sal_uInt16 nLevelAnz; - rIn >> nLevelAnz; + rIn.ReadUInt16( nLevelAnz ); sal_uInt16 nLev = 0; sal_Bool bFirst = sal_True; @@ -4141,7 +4141,7 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd } } sal_uInt16 nLevelAnz; - rIn >> nLevelAnz; + rIn.ReadUInt16( nLevelAnz ); if ( nLevelAnz > 5 ) { OSL_FAIL( "PPTStyleSheet::Ppt-TextStylesheet hat mehr als 5 Ebenen! (SJ)" ); @@ -4164,7 +4164,7 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd bFirst = sal_False; sal_uInt16 nDontKnow; - rIn >> nDontKnow; + rIn.ReadUInt16( nDontKnow ); } mpParaSheet[ nInstance ]->Read( rManager, rIn, sal_True, nLev, bFirst ); mpCharSheet[ nInstance ]->Read( rIn, sal_True, nLev, bFirst ); @@ -4235,7 +4235,7 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd if ( aTxMasterStyleHd2.nRecType == PPT_PST_TxMasterStyleAtom ) { sal_uInt16 nLevelAnz; - rIn >> nLevelAnz; + rIn.ReadUInt16( nLevelAnz ); sal_uInt16 nLev = 0; sal_Bool bFirst = sal_True; @@ -4526,33 +4526,33 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( sal_uInt32 nFileOfs, SdrPowerP { sal_Int16 nTCount; sal_Int32 i; - rIn >> mpImplRuler->nFlags; + rIn.ReadInt32( mpImplRuler->nFlags ); // number of indent levels, unused now if ( mpImplRuler->nFlags & 2 ) - rIn >> nTCount; + rIn.ReadInt16( nTCount ); if ( mpImplRuler->nFlags & 1 ) - rIn >> mpImplRuler->nDefaultTab; + rIn.ReadUInt16( mpImplRuler->nDefaultTab ); if ( mpImplRuler->nFlags & 4 ) { - rIn >> nTCount; + rIn.ReadInt16( nTCount ); if ( nTCount ) { mpImplRuler->nTabCount = (sal_uInt16)nTCount; mpImplRuler->pTab = new PPTTabEntry[ mpImplRuler->nTabCount ]; for ( i = 0; i < nTCount; i++ ) { - rIn >> mpImplRuler->pTab[ i ].nOffset - >> mpImplRuler->pTab[ i ].nStyle; + rIn.ReadUInt16( mpImplRuler->pTab[ i ].nOffset ) + .ReadUInt16( mpImplRuler->pTab[ i ].nStyle ); } } } for ( i = 0; i < 5; i++ ) { if ( mpImplRuler->nFlags & ( 8 << i ) ) - rIn >> mpImplRuler->nTextOfs[ i ]; + rIn.ReadUInt16( mpImplRuler->nTextOfs[ i ] ); if ( mpImplRuler->nFlags & ( 256 << i ) ) - rIn >> mpImplRuler->nBulletOfs[ i ]; + rIn.ReadUInt16( mpImplRuler->nBulletOfs[ i ] ); if( mpImplRuler->nBulletOfs[ i ] > 0x7fff) { // workaround @@ -4624,12 +4624,12 @@ sal_Bool PPTTextCharacterStyleAtomInterpreter::Read( SvStream& rIn, const DffRec { rRecHd.SeekToContent( rIn ); - rIn >> nFlags1 - >> nFlags2 - >> nFlags3 - >> n1 - >> nFontHeight - >> nFontColor; + rIn.ReadUInt16( nFlags1 ) + .ReadUInt16( nFlags2 ) + .ReadUInt16( nFlags3 ) + .ReadInt32( n1 ) + .ReadUInt16( nFontHeight ) + .ReadInt32( nFontColor ); return sal_True; } @@ -4653,40 +4653,40 @@ sal_Bool PPTTextParagraphStyleAtomInterpreter::Read( SvStream& rIn, const DffRec sal_uInt32 nDummy32, nFlags, nRecEndPos = rRecHd.GetRecEndFilePos(); sal_uInt16 nDummy16; - rIn >> nDummy16 - >> nFlags; + rIn.ReadUInt16( nDummy16 ) + .ReadUInt32( nFlags ); if ( nFlags & 0xf && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; // BuFlags + rIn.ReadUInt16( nDummy16 ); // BuFlags if ( nFlags & 0x80 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; // BuChar + rIn.ReadUInt16( nDummy16 ); // BuChar if ( nFlags & 0x10 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; // nBuFont; + rIn.ReadUInt16( nDummy16 ); // nBuFont; if ( nFlags & 0x40 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; // nBuHeight; + rIn.ReadUInt16( nDummy16 ); // nBuHeight; if ( nFlags & 0x0020 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy32; // nBuColor; + rIn.ReadUInt32( nDummy32 ); // nBuColor; if ( nFlags & 0x800 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; // AbsJust! + rIn.ReadUInt16( nDummy16 ); // AbsJust! if ( nFlags & 0x400 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); if ( nFlags & 0x200 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); if ( nFlags & 0x100 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); if ( nFlags & 0x1000 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; // LineFeed + rIn.ReadUInt16( nDummy16 ); // LineFeed if ( nFlags & 0x2000 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; // nUpperDist + rIn.ReadUInt16( nDummy16 ); // nUpperDist if ( nFlags & 0x4000 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; // nLowerDist + rIn.ReadUInt16( nDummy16 ); // nLowerDist if ( nFlags & 0x8000 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); if ( nFlags & 0x10000 && ( rIn.Tell() < nRecEndPos ) ) - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); if ( nFlags & 0xe0000 && ( rIn.Tell() < nRecEndPos ) ) { - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); if ( nFlags & 0x20000 ) bForbiddenRules = ( nDummy16 & 1 ) == 1; if ( nFlags & 0x40000 ) @@ -4700,7 +4700,7 @@ sal_Bool PPTTextParagraphStyleAtomInterpreter::Read( SvStream& rIn, const DffRec { if ( nFlags & nMask ) { - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); nFlags ^= nMask; } nMask <<= 1; @@ -4746,10 +4746,10 @@ sal_Bool PPTTextSpecInfoAtomInterpreter::Read( SvStream& rIn, const DffRecordHea if ( nRecordType == PPT_PST_TextSpecInfoAtom ) { - rIn >> nCharCount; + rIn.ReadUInt32( nCharCount ); nCharIdx += nCharCount; } - rIn >> nFlags; + rIn.ReadUInt32( nFlags ); PPTTextSpecInfo* pEntry = new PPTTextSpecInfo( nCharIdx ); if ( pTextSpecDefault ) @@ -4765,9 +4765,9 @@ sal_Bool PPTTextSpecInfoAtomInterpreter::Read( SvStream& rIn, const DffRecordHea switch( nFlags & i ) { case 0 : break; - case 1 : rIn >> pEntry->nDontKnow; break; - case 2 : rIn >> nLang; break; - case 4 : rIn >> nLang; break; + case 1 : rIn.ReadUInt16( pEntry->nDontKnow ); break; + case 2 : rIn.ReadUInt16( nLang ); break; + case 4 : rIn.ReadUInt16( nLang ); break; default : { rIn.SeekRel( 2 ); @@ -4801,23 +4801,23 @@ PPTTextSpecInfoAtomInterpreter::~PPTTextSpecInfoAtomInterpreter() void StyleTextProp9::Read( SvStream& rIn ) { - rIn >> mnExtParagraphMask; + rIn.ReadUInt32( mnExtParagraphMask ); if ( mnExtParagraphMask & 0x800000 ) - rIn >> mnBuBlip; + rIn.ReadUInt16( mnBuBlip ); if ( mnExtParagraphMask & 0x2000000 ) - rIn >> mnHasAnm; + rIn.ReadUInt16( mnHasAnm ); if ( mnExtParagraphMask & 0x1000000 ) - rIn >> mnAnmScheme; + rIn.ReadUInt32( mnAnmScheme ); if ( mnExtParagraphMask & 0x4000000 ) - rIn >> mpfPP10Ext; - rIn >> mnExtCharacterMask; + rIn.ReadUInt32( mpfPP10Ext ); + rIn.ReadUInt32( mnExtCharacterMask ); if ( mnExtCharacterMask & 0x100000 ) - rIn >> mncfPP10Ext; - rIn >> mnSpecialInfoMask; + rIn.ReadUInt32( mncfPP10Ext ); + rIn.ReadUInt32( mnSpecialInfoMask ); if ( mnSpecialInfoMask & 0x20 ) - rIn >> mnPP10Ext; + rIn.ReadUInt32( mnPP10Ext ); if ( mnSpecialInfoMask & 0x40 ) - rIn >> mfBidi; + rIn.ReadUInt16( mfBidi ); } PPTStyleTextPropReader::PPTStyleTextPropReader( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader, @@ -4846,8 +4846,8 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& ImplPPTParaPropSet& aSet = *aParaPropSet.pParaSet; if ( bTextPropAtom ) { - rIn >> nCharCount - >> aParaPropSet.pParaSet->mnDepth; // indent depth + rIn.ReadUInt32( nCharCount ) + .ReadUInt16( aParaPropSet.pParaSet->mnDepth ); // indent depth aParaPropSet.pParaSet->mnDepth = // taking care of about using not more than 9 outliner levels std::min(sal_uInt16(8), @@ -4855,22 +4855,22 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& nCharCount--; - rIn >> nMask; + rIn.ReadUInt32( nMask ); aSet.mnAttrSet = nMask & 0x207df7; sal_uInt16 nBulFlg = 0; if ( nMask & 0xF ) - rIn >> nBulFlg; // Bullet-HardAttr-Flags + rIn.ReadUInt16( nBulFlg ); // Bullet-HardAttr-Flags aSet.mpArry[ PPT_ParaAttr_BulletOn ] = ( nBulFlg & 1 ) ? 1 : 0; aSet.mpArry[ PPT_ParaAttr_BuHardFont ] = ( nBulFlg & 2 ) ? 1 : 0; aSet.mpArry[ PPT_ParaAttr_BuHardColor ] = ( nBulFlg & 4 ) ? 1 : 0; if ( nMask & 0x0080 ) // buChar - rIn >> aSet.mpArry[ PPT_ParaAttr_BulletChar ]; + rIn.ReadUInt16( aSet.mpArry[ PPT_ParaAttr_BulletChar ] ); if ( nMask & 0x0010 ) // buTypeface - rIn >> aSet.mpArry[ PPT_ParaAttr_BulletFont ]; + rIn.ReadUInt16( aSet.mpArry[ PPT_ParaAttr_BulletFont ] ); if ( nMask & 0x0040 ) // buSize { - rIn >> aSet.mpArry[ PPT_ParaAttr_BulletHeight ]; + rIn.ReadUInt16( aSet.mpArry[ PPT_ParaAttr_BulletHeight ] ); if ( ! ( ( nMask & ( 1 << PPT_ParaAttr_BuHardHeight ) ) && ( nBulFlg & ( 1 << PPT_ParaAttr_BuHardHeight ) ) ) ) aSet.mnAttrSet ^= 0x40; @@ -4878,7 +4878,7 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& if ( nMask & 0x0020 ) // buColor { sal_uInt32 nVal32, nHiByte; - rIn >> nVal32; + rIn.ReadUInt32( nVal32 ); nHiByte = nVal32 >> 24; if ( nHiByte <= 8 ) nVal32 = nHiByte | PPT_COLSCHEME; @@ -4886,42 +4886,42 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& } if ( nMask & 0x0800 ) // pfAlignment { - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); aSet.mpArry[ PPT_ParaAttr_Adjust ] = nDummy16 & 3; } if ( nMask & 0x1000 ) // pfLineSpacing - rIn >> aSet.mpArry[ PPT_ParaAttr_LineFeed ]; + rIn.ReadUInt16( aSet.mpArry[ PPT_ParaAttr_LineFeed ] ); if ( nMask & 0x2000 ) // pfSpaceBefore - rIn >> aSet.mpArry[ PPT_ParaAttr_UpperDist ]; + rIn.ReadUInt16( aSet.mpArry[ PPT_ParaAttr_UpperDist ] ); if ( nMask & 0x4000 ) // pfSpaceAfter - rIn >> aSet.mpArry[ PPT_ParaAttr_LowerDist ]; + rIn.ReadUInt16( aSet.mpArry[ PPT_ParaAttr_LowerDist ] ); if ( nMask & 0x100 ) // pfLeftMargin { - rIn >> aSet.mpArry[ PPT_ParaAttr_TextOfs ]; + rIn.ReadUInt16( aSet.mpArry[ PPT_ParaAttr_TextOfs ] ); aSet.mnAttrSet |= 1 << PPT_ParaAttr_TextOfs; } if ( nMask & 0x400 ) // pfIndent { - rIn >> aSet.mpArry[ PPT_ParaAttr_BulletOfs ]; + rIn.ReadUInt16( aSet.mpArry[ PPT_ParaAttr_BulletOfs ] ); aSet.mnAttrSet |= 1 << PPT_ParaAttr_BulletOfs; } if ( nMask & 0x8000 ) // pfDefaultTabSize - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); if ( nMask & 0x100000 ) // pfTabStops { sal_uInt16 i, nDistance, nAlignment, nNumberOfTabStops = 0; - rIn >> nNumberOfTabStops; + rIn.ReadUInt16( nNumberOfTabStops ); for ( i = 0; i < nNumberOfTabStops; i++ ) { - rIn >> nDistance - >> nAlignment; + rIn.ReadUInt16( nDistance ) + .ReadUInt16( nAlignment ); } } if ( nMask & 0x10000 ) // pfBaseLine - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); if ( nMask & 0xe0000 ) // pfCharWrap, pfWordWrap, pfOverflow { - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); if ( nMask & 0x20000 ) aSet.mpArry[ PPT_ParaAttr_AsianLB_1 ] = nDummy16 & 1; if ( nMask & 0x40000 ) @@ -4931,7 +4931,7 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& aSet.mnAttrSet |= ( ( nMask >> 17 ) & 7 ) << PPT_ParaAttr_AsianLB_1; } if ( nMask & 0x200000 ) // pfTextDirection - rIn >> aSet.mpArry[ PPT_ParaAttr_BiDi ]; + rIn.ReadUInt16( aSet.mpArry[ PPT_ParaAttr_BiDi ] ); } else nCharCount = nStringLen; @@ -4988,9 +4988,9 @@ void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aChar sal_Int32 nCharsToRead; sal_uInt16 nStringLen = aString.getLength(); - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); nCharCount = nDummy16; - rIn >> nDummy16; + rIn.ReadUInt16( nDummy16 ); nCharsToRead = nStringLen - ( nCharAnzRead + nCharCount ); if ( nCharsToRead < 0 ) { @@ -5004,41 +5004,41 @@ void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aChar ImplPPTCharPropSet& aSet = *aCharPropSet.pCharSet; // character attributes - rIn >> nMask; + rIn.ReadUInt32( nMask ); if ( (sal_uInt16)nMask ) { aSet.mnAttrSet |= (sal_uInt16)nMask; - rIn >> aSet.mnFlags; + rIn.ReadUInt16( aSet.mnFlags ); } if ( nMask & 0x10000 ) // cfTypeface { - rIn >> aSet.mnFont; + rIn.ReadUInt16( aSet.mnFont ); aSet.mnAttrSet |= 1 << PPT_CharAttr_Font; } if ( nMask & 0x200000 ) // cfFEOldTypeface { - rIn >> aSet.mnAsianOrComplexFont; + rIn.ReadUInt16( aSet.mnAsianOrComplexFont ); aSet.mnAttrSet |= 1 << PPT_CharAttr_AsianOrComplexFont; } if ( nMask & 0x400000 ) // cfANSITypeface { - rIn >> aSet.mnANSITypeface; + rIn.ReadUInt16( aSet.mnANSITypeface ); aSet.mnAttrSet |= 1 << PPT_CharAttr_ANSITypeface; } if ( nMask & 0x800000 ) // cfSymbolTypeface { - rIn >> aSet.mnSymbolFont; + rIn.ReadUInt16( aSet.mnSymbolFont ); aSet.mnAttrSet |= 1 << PPT_CharAttr_Symbol; } if ( nMask & 0x20000 ) // cfSize { - rIn >> aSet.mnFontHeight; + rIn.ReadUInt16( aSet.mnFontHeight ); aSet.mnAttrSet |= 1 << PPT_CharAttr_FontHeight; } if ( nMask & 0x40000 ) // cfColor { sal_uInt32 nVal; - rIn >> nVal; + rIn.ReadUInt32( nVal ); if ( !( nVal & 0xff000000 ) ) nVal = PPT_COLSCHEME_HINTERGRUND; aSet.mnColor = nVal; @@ -5046,7 +5046,7 @@ void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aChar } if ( nMask & 0x80000 ) // cfPosition { - rIn >> aSet.mnEscapement; + rIn.ReadUInt16( aSet.mnEscapement ); aSet.mnAttrSet |= 1 << PPT_CharAttr_Escapement; } if ( nExtParaPos ) @@ -6411,7 +6411,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_OutlineTextRefAtom, aClientTextBoxHd.GetRecEndFilePos(), &aTextHd ) ) { sal_uInt32 nRefNum; - rIn >> nRefNum; + rIn.ReadUInt32( nRefNum ); if ( rSdrPowerPointImport.SeekToRec( rIn, PPT_PST_TextRulerAtom, aClientTextBoxHd.GetRecEndFilePos() ) ) nTextRulerAtomOfs = rIn.Tell(); @@ -6451,8 +6451,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport while ( pHd ) { pHd->SeekToContent( rIn ); - rIn >> nTmpSlideId - >> nTmpRef; // this seems to be the instance + rIn.ReadUInt32( nTmpSlideId ) + .ReadUInt32( nTmpRef ); // this seems to be the instance if ( ( nTmpSlideId == nSlideId ) && ( pHd->nRecInstance == nRefNum ) ) { @@ -6529,7 +6529,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport { // TextHeaderAtom is always the first Atom sal_uInt16 nInstance; - rIn >> nInstance; // this number tells us the TxMasterStyleAtom Instance + rIn.ReadUInt16( nInstance ); // this number tells us the TxMasterStyleAtom Instance if ( nInstance > 8 ) nInstance = 4; aTextHd.SeekToEndOfRecord( rIn ); @@ -6624,9 +6624,9 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport case PPT_PST_DateTimeMCAtom : { pEntry = new PPTFieldEntry; - rIn >> pEntry->nPos - >> nVal - >> nVal; + rIn.ReadUInt16( pEntry->nPos ) + .ReadUInt16( nVal ) + .ReadUInt16( nVal ); pEntry->SetDateTime( nVal & 0xff ); } break; @@ -6634,7 +6634,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport case PPT_PST_FooterMCAtom : { pEntry = new PPTFieldEntry; - rIn >> pEntry->nPos; + rIn.ReadUInt16( pEntry->nPos ); pEntry->pField1 = new SvxFieldItem( SvxFooterField(), EE_FEATURE_FIELD ); } break; @@ -6642,7 +6642,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport case PPT_PST_HeaderMCAtom : { pEntry = new PPTFieldEntry; - rIn >> pEntry->nPos; + rIn.ReadUInt16( pEntry->nPos ); pEntry->pField1 = new SvxFieldItem( SvxHeaderField(), EE_FEATURE_FIELD ); } break; @@ -6650,7 +6650,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport case PPT_PST_GenericDateMCAtom : { pEntry = new PPTFieldEntry; - rIn >> pEntry->nPos; + rIn.ReadUInt16( pEntry->nPos ); pEntry->pField1 = new SvxFieldItem( SvxDateTimeField(), EE_FEATURE_FIELD ); if ( rPersistEntry.pHeaderFooterEntry ) // sj: #i34111# on master pages it is possible { // that there is no HeaderFooterEntry available @@ -6668,8 +6668,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport pEntry = new PPTFieldEntry; if ( aTextHd.nRecLen >= 4 ) { - rIn >> pEntry->nPos - >> nVal; + rIn.ReadUInt16( pEntry->nPos ) + .ReadUInt16( nVal ); // evaluate ID //SvxFieldItem* pFieldItem = NULL; @@ -6701,7 +6701,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport for (int nLen = 0; nLen < 64; ++nLen) { sal_Unicode n(0); - rIn >> n; + rIn.ReadUInt16( n ); // Collect quoted characters into aStr if ( n == '\'') @@ -6758,8 +6758,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport else { sal_uInt32 nStartPos, nEndPos; - rIn >> nStartPos - >> nEndPos; + rIn.ReadUInt32( nStartPos ) + .ReadUInt32( nEndPos ); if ( nEndPos ) { pEntry = new PPTFieldEntry; diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx index ce48dfb75f4d..c14663a62a00 100644 --- a/filter/source/xmlfilterdetect/filterdetect.cxx +++ b/filter/source/xmlfilterdetect/filterdetect.cxx @@ -143,7 +143,7 @@ OUString SAL_CALL FilterDetect::detect( com::sun::star::uno::Sequence< com::sun: if ( nUniPos == 0 ) // No BOM detected, try to guess UTF-16 endianness { sal_uInt16 sHeader = 0; - *pInStream >> sHeader; + pInStream->ReadUInt16( sHeader ); if ( sHeader == 0x003C ) bTryUtf16 = true; else if ( sHeader == 0x3C00 ) |