From 8130714148d58dd2bf1ef12dcc6dd6d5838be0d1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 5 Jan 2015 08:47:31 +0200 Subject: fdo#84938: replace NUMBERFORMAT_INT_ constants with 'enum class' Change-Id: I9c67de31f5571b282adc132d973b79bccb35fdc9 --- connectivity/source/drivers/dbase/DIndex.cxx | 4 +-- connectivity/source/drivers/dbase/DIndexes.cxx | 2 +- connectivity/source/drivers/dbase/DTable.cxx | 8 ++--- extensions/source/scanner/sane.cxx | 2 +- filter/source/graphicfilter/egif/egif.cxx | 2 +- filter/source/graphicfilter/eos2met/eos2met.cxx | 4 +-- filter/source/graphicfilter/epbm/epbm.cxx | 12 +++---- filter/source/graphicfilter/epgm/epgm.cxx | 12 +++---- filter/source/graphicfilter/epict/epict.cxx | 2 +- filter/source/graphicfilter/eppm/eppm.cxx | 12 +++---- filter/source/graphicfilter/eps/eps.cxx | 2 +- filter/source/graphicfilter/eras/eras.cxx | 6 ++-- filter/source/graphicfilter/etiff/etiff.cxx | 6 ++-- filter/source/graphicfilter/expm/expm.cxx | 6 ++-- filter/source/graphicfilter/icgm/cgm.cxx | 2 +- filter/source/graphicfilter/ieps/ieps.cxx | 6 ++-- filter/source/graphicfilter/ios2met/ios2met.cxx | 12 +++---- filter/source/graphicfilter/ipbm/ipbm.cxx | 2 +- filter/source/graphicfilter/ipcx/ipcx.cxx | 2 +- filter/source/graphicfilter/ipict/ipict.cxx | 10 +++--- filter/source/graphicfilter/ipsd/ipsd.cxx | 2 +- filter/source/graphicfilter/iras/iras.cxx | 2 +- filter/source/graphicfilter/itga/itga.cxx | 2 +- filter/source/graphicfilter/itiff/itiff.cxx | 11 +++---- filter/source/xmlfilterdetect/filterdetect.cxx | 2 +- include/svx/svdmodel.hxx | 44 ++++++++++++------------- include/tools/stream.hxx | 20 +++-------- sc/source/filter/excel/xeescher.cxx | 2 +- sc/source/filter/excel/xiescher.cxx | 2 +- sc/source/filter/xcl97/xcl97esc.cxx | 2 +- sc/source/ui/docshell/docsh.cxx | 4 +-- sc/source/ui/inc/impex.hxx | 14 +++++--- sd/source/filter/ppt/propread.cxx | 2 +- starmath/source/eqnolefilehdr.cxx | 2 +- starmath/source/mathtype.cxx | 4 +-- svtools/source/misc/imap.cxx | 16 ++++----- svx/source/svdraw/svdmodel.cxx | 4 +-- sw/source/core/edit/edglss.cxx | 4 +-- sw/source/core/unocore/unoobj.cxx | 4 +-- sw/source/filter/ascii/wrtasc.cxx | 3 +- sw/source/filter/ww8/wrtw8esh.cxx | 6 ++-- sw/source/filter/ww8/wrtww8.cxx | 6 ++-- sw/source/filter/ww8/ww8glsy.cxx | 4 +-- sw/source/filter/ww8/ww8par.cxx | 10 +++--- sw/source/filter/ww8/ww8par4.cxx | 6 ++-- sw/source/uibase/dochdl/swdtflvr.cxx | 4 +-- tools/qa/cppunit/test_stream.cxx | 4 +-- tools/source/generic/poly.cxx | 8 ++--- tools/source/stream/stream.cxx | 20 +++++------ vcl/source/filter/graphicfilter.cxx | 10 +++--- vcl/source/filter/graphicfilter2.cxx | 30 ++++++++--------- vcl/source/filter/igif/gifread.cxx | 6 ++-- vcl/source/filter/jpeg/Exif.cxx | 2 +- vcl/source/filter/wmf/wmf.cxx | 12 +++---- vcl/source/filter/wmf/wmfwr.cxx | 2 +- vcl/source/gdi/animate.cxx | 6 ++-- vcl/source/gdi/cvtsvm.cxx | 14 ++++---- vcl/source/gdi/dibtools.cxx | 12 +++---- vcl/source/gdi/gdimtf.cxx | 14 ++++---- vcl/source/gdi/impgraph.cxx | 24 +++++++------- vcl/source/gdi/pngread.cxx | 8 ++--- vcl/source/gdi/pngwrite.cxx | 6 ++-- 62 files changed, 228 insertions(+), 246 deletions(-) diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx index d28fa19c1dff..c5f876b13267 100644 --- a/connectivity/source/drivers/dbase/DIndex.cxx +++ b/connectivity/source/drivers/dbase/DIndex.cxx @@ -155,7 +155,7 @@ bool ODbaseIndex::openIndexFile() m_pFileStream = OFileTable::createStream_simpleError(sFile,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE); if(m_pFileStream) { - m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + m_pFileStream->SetEndian(SvStreamEndian::LITTLE); m_pFileStream->SetBufferSize(DINDEX_PAGE_SIZE); (*m_pFileStream) >> *this; } @@ -497,7 +497,7 @@ bool ODbaseIndex::CreateImpl() ::dbtools::throwGenericSQLException( sError, *this ); } - m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + m_pFileStream->SetEndian(SvStreamEndian::LITTLE); m_pFileStream->SetBufferSize(DINDEX_PAGE_SIZE); // firstly the result must be sorted diff --git a/connectivity/source/drivers/dbase/DIndexes.cxx b/connectivity/source/drivers/dbase/DIndexes.cxx index 67625a786a84..d3f2c87dcfeb 100644 --- a/connectivity/source/drivers/dbase/DIndexes.cxx +++ b/connectivity/source/drivers/dbase/DIndexes.cxx @@ -55,7 +55,7 @@ sdbcx::ObjectType ODbaseIndexes::createObject(const OUString& _rName) SvStream* pFileStream = ::connectivity::file::OFileTable::createStream_simpleError(sFile,STREAM_READ | STREAM_NOCREATE| STREAM_SHARE_DENYWRITE); if(pFileStream) { - pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + pFileStream->SetEndian(SvStreamEndian::LITTLE); pFileStream->SetBufferSize(DINDEX_PAGE_SIZE); ODbaseIndex::NDXHeader aHeader; diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 3abfc03090ee..f8746b920857 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -241,7 +241,7 @@ void ODbaseTable::readHeader() case dBaseIVMemoSQL: case dBaseIIIMemo: case FoxProMemo: - m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + m_pFileStream->SetEndian(SvStreamEndian::LITTLE); if ( m_aHeader.db_frei[17] != 0x00 && !m_aHeader.db_frei[18] && !m_aHeader.db_frei[19] && getConnection()->isTextEncodingDefaulted() ) { @@ -283,7 +283,7 @@ void ODbaseTable::readHeader() } break; case dBaseIVMemo: - m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + m_pFileStream->SetEndian(SvStreamEndian::LITTLE); break; default: { @@ -566,7 +566,7 @@ void ODbaseTable::construct() bool ODbaseTable::ReadMemoHeader() { - m_pMemoStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + m_pMemoStream->SetEndian(SvStreamEndian::LITTLE); m_pMemoStream->RefreshBuffer(); // make sure that the header information is actually read again m_pMemoStream->Seek(0L); @@ -603,7 +603,7 @@ bool ODbaseTable::ReadMemoHeader() case FoxProMemo: m_aMemoHeader.db_typ = MemoFoxPro; m_pMemoStream->Seek(6L); - m_pMemoStream->SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN); + m_pMemoStream->SetEndian(SvStreamEndian::BIG); (*m_pMemoStream).ReadUInt16( m_aMemoHeader.db_size ); break; default: diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx index ccc597c9b598..9e14d9b9863c 100644 --- a/extensions/source/scanner/sane.cxx +++ b/extensions/source/scanner/sane.cxx @@ -595,7 +595,7 @@ bool Sane::Start( BitmapTransporter& rBitmap ) rBitmap.lock(); SvMemoryStream& aConverter = rBitmap.getStream(); aConverter.Seek( 0 ); - aConverter.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + aConverter.SetEndian( SvStreamEndian::LITTLE ); // write bitmap stream header aConverter.WriteChar( 'B' ).WriteChar( 'M' ); diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx index 07e2193174a8..4cbbe2092955 100644 --- a/filter/source/graphicfilter/egif/egif.cxx +++ b/filter/source/graphicfilter/egif/egif.cxx @@ -116,7 +116,7 @@ bool GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfi if ( pFilterConfigItem ) nInterlaced = pFilterConfigItem->ReadInt32( "Interlaced", 0 ); - m_rGIF.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + m_rGIF.SetEndian( SvStreamEndian::LITTLE ); if( rGraphic.IsAnimated() ) { diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx index 36ffc74ffb27..18809d526dfa 100644 --- a/filter/source/graphicfilter/eos2met/eos2met.cxx +++ b/filter/source/graphicfilter/eos2met/eos2met.cxx @@ -581,7 +581,7 @@ void METWriter::WriteImageObject(const Bitmap & rBitmap) WriteDIB(rBitmap, aTemp, false, true); // read header of the Windows-BMP file: - aTemp.SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + aTemp.SetEndian(SvStreamEndian::LITTLE); aTemp.Seek(18); aTemp.ReadUInt32( nWidth ).ReadUInt32( nHeight ); aTemp.SeekRel(2); @@ -2510,7 +2510,7 @@ bool METWriter::WriteMET( const GDIMetaFile& rMTF, SvStream& rTargetStream, Filt nLastPercent=0; pMET=&rTargetStream; - pMET->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + pMET->SetEndian(SvStreamEndian::LITTLE); aPictureRect = Rectangle( Point(), rMTF.GetPrefSize() ); aTargetMapMode = aPictureMapMode = rMTF.GetPrefMapMode(); diff --git a/filter/source/graphicfilter/epbm/epbm.cxx b/filter/source/graphicfilter/epbm/epbm.cxx index 1705cb131e58..818883fef505 100644 --- a/filter/source/graphicfilter/epbm/epbm.cxx +++ b/filter/source/graphicfilter/epbm/epbm.cxx @@ -33,14 +33,13 @@ class PBMWriter { private: SvStream& m_rOStm; // the output PBM file - sal_uInt16 mpOStmOldModus; - bool mbStatus; + bool mbStatus; sal_Int32 mnMode; // 0 -> raw, 1-> ascii BitmapReadAccess* mpAcc; sal_uLong mnWidth, mnHeight; // size in pixel - bool ImplWriteHeader(); + bool ImplWriteHeader(); void ImplWriteBody(); void ImplWriteNumber( sal_Int32 ); @@ -57,7 +56,6 @@ public: PBMWriter::PBMWriter(SvStream &rPBM) : m_rOStm(rPBM) - , mpOStmOldModus(0) , mbStatus(true) , mnMode(0) , mpAcc(NULL) @@ -92,8 +90,8 @@ bool PBMWriter::WritePBM( const Graphic& rGraphic, FilterConfigItem* pFilterConf Bitmap aBmp = aBmpEx.GetBitmap(); aBmp.Convert( BMP_CONVERSION_1BIT_THRESHOLD ); - mpOStmOldModus = m_rOStm.GetNumberFormatInt(); - m_rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + SvStreamEndian aOStmOldModus = m_rOStm.GetEndian(); + m_rOStm.SetEndian( SvStreamEndian::BIG ); mpAcc = aBmp.AcquireReadAccess(); if( mpAcc ) @@ -106,7 +104,7 @@ bool PBMWriter::WritePBM( const Graphic& rGraphic, FilterConfigItem* pFilterConf else mbStatus = false; - m_rOStm.SetNumberFormatInt( mpOStmOldModus ); + m_rOStm.SetEndian( aOStmOldModus ); if ( xStatusIndicator.is() ) xStatusIndicator->end(); diff --git a/filter/source/graphicfilter/epgm/epgm.cxx b/filter/source/graphicfilter/epgm/epgm.cxx index fcd65b891ed4..a2a437d58e5f 100644 --- a/filter/source/graphicfilter/epgm/epgm.cxx +++ b/filter/source/graphicfilter/epgm/epgm.cxx @@ -33,14 +33,13 @@ class PGMWriter { private: SvStream& m_rOStm; // the output PGM file - sal_uInt16 mpOStmOldModus; - bool mbStatus; + bool mbStatus; sal_uInt32 mnMode; BitmapReadAccess* mpAcc; sal_uLong mnWidth, mnHeight; // image size in pixeln - bool ImplWriteHeader(); + bool ImplWriteHeader(); void ImplWriteBody(); void ImplWriteNumber( sal_Int32 ); @@ -56,7 +55,6 @@ public: //=================== Methoden von PGMWriter ============================== PGMWriter::PGMWriter(SvStream &rStream) : m_rOStm(rStream) - , mpOStmOldModus(0) , mbStatus(true) , mnMode(0) , mpAcc(NULL) @@ -87,8 +85,8 @@ bool PGMWriter::WritePGM( const Graphic& rGraphic, FilterConfigItem* pFilterConf Bitmap aBmp = aBmpEx.GetBitmap(); aBmp.Convert( BMP_CONVERSION_8BIT_GREYS ); - mpOStmOldModus = m_rOStm.GetNumberFormatInt(); - m_rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + SvStreamEndian aOStmOldModus = m_rOStm.GetEndian(); + m_rOStm.SetEndian( SvStreamEndian::BIG ); mpAcc = aBmp.AcquireReadAccess(); if( mpAcc ) @@ -102,7 +100,7 @@ bool PGMWriter::WritePGM( const Graphic& rGraphic, FilterConfigItem* pFilterConf else mbStatus = false; - m_rOStm.SetNumberFormatInt( mpOStmOldModus ); + m_rOStm.SetEndian( aOStmOldModus ); if ( xStatusIndicator.is() ) xStatusIndicator->end(); diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx index 8d67795820c7..4d33b4e8663e 100644 --- a/filter/source/graphicfilter/epict/epict.cxx +++ b/filter/source/graphicfilter/epict/epict.cxx @@ -2204,7 +2204,7 @@ bool PictWriter::WritePict(const GDIMetaFile & rMTF, SvStream & rTargetStream, F } pPict=&rTargetStream; - pPict->SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN); + pPict->SetEndian(SvStreamEndian::BIG); aLineColor=Color( COL_BLACK ); aFillColor=Color( COL_WHITE ); diff --git a/filter/source/graphicfilter/eppm/eppm.cxx b/filter/source/graphicfilter/eppm/eppm.cxx index 7bfde7bdd4b4..bd4289961f66 100644 --- a/filter/source/graphicfilter/eppm/eppm.cxx +++ b/filter/source/graphicfilter/eppm/eppm.cxx @@ -32,13 +32,12 @@ class PPMWriter { private: - SvStream& m_rOStm; // Die auszugebende PPM-Datei - sal_uInt16 mpOStmOldModus; + SvStream& m_rOStm; // Die auszugebende PPM-Datei bool mbStatus; sal_Int32 mnMode; BitmapReadAccess* mpAcc; - sal_uLong mnWidth, mnHeight; // Bildausmass in Pixeln + sal_uLong mnWidth, mnHeight; // Bildausmass in Pixeln bool ImplWriteHeader(); void ImplWriteBody(); @@ -56,7 +55,6 @@ public: //=================== Methods of PPMWriter ============================== PPMWriter::PPMWriter(SvStream &rStrm) : m_rOStm(rStrm) - , mpOStmOldModus(0) , mbStatus(true) , mnMode(0) , mpAcc(NULL) @@ -89,8 +87,8 @@ bool PPMWriter::WritePPM( const Graphic& rGraphic, FilterConfigItem* pFilterConf Bitmap aBmp = aBmpEx.GetBitmap(); aBmp.Convert( BMP_CONVERSION_24BIT ); - mpOStmOldModus = m_rOStm.GetNumberFormatInt(); - m_rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + SvStreamEndian aOStmOldModus = m_rOStm.GetEndian(); + m_rOStm.SetEndian( SvStreamEndian::BIG ); mpAcc = aBmp.AcquireReadAccess(); if( mpAcc ) @@ -104,7 +102,7 @@ bool PPMWriter::WritePPM( const Graphic& rGraphic, FilterConfigItem* pFilterConf else mbStatus = false; - m_rOStm.SetNumberFormatInt( mpOStmOldModus ); + m_rOStm.SetEndian( aOStmOldModus ); if ( xStatusIndicator.is() ) xStatusIndicator->end(); diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index f3a30e96f670..ff423e97a97e 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -328,7 +328,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter } mpPS = &rTargetStream; - mpPS->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + mpPS->SetEndian( SvStreamEndian::LITTLE ); // default values for the dialog options mnLevel = 2; diff --git a/filter/source/graphicfilter/eras/eras.cxx b/filter/source/graphicfilter/eras/eras.cxx index 2bf66dbf1bca..24d21d28b6de 100644 --- a/filter/source/graphicfilter/eras/eras.cxx +++ b/filter/source/graphicfilter/eras/eras.cxx @@ -111,8 +111,8 @@ bool RASWriter::WriteRAS( const Graphic& rGraphic, FilterConfigItem* pFilterConf mpAcc = aBmp.AcquireReadAccess(); if ( mpAcc ) { - sal_uInt16 nOStmOldModus = m_rOStm.GetNumberFormatInt(); - m_rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + SvStreamEndian nOStmOldModus = m_rOStm.GetEndian(); + m_rOStm.SetEndian( SvStreamEndian::BIG ); if ( ImplWriteHeader() ) { @@ -121,7 +121,7 @@ bool RASWriter::WriteRAS( const Graphic& rGraphic, FilterConfigItem* pFilterConf ImplWriteBody(); } - m_rOStm.SetNumberFormatInt( nOStmOldModus ); + m_rOStm.SetEndian( nOStmOldModus ); aBmp.ReleaseAccess( mpAcc ); } diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx index e265c9f2e4a0..408b48bbf61a 100644 --- a/filter/source/graphicfilter/etiff/etiff.cxx +++ b/filter/source/graphicfilter/etiff/etiff.cxx @@ -163,12 +163,12 @@ bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterCo } } - const sal_uInt16 nOldFormat = m_rOStm.GetNumberFormatInt(); + const SvStreamEndian nOldFormat = m_rOStm.GetEndian(); mnStreamOfs = m_rOStm.Tell(); // we will use the BIG Endian Mode // TIFF header - m_rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + m_rOStm.SetEndian( SvStreamEndian::BIG ); m_rOStm.WriteUInt32( 0x4d4d002a ); // TIFF identifier mnLatestIfdPos = m_rOStm.Tell(); m_rOStm.WriteUInt32( 0 ); @@ -230,7 +230,7 @@ bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterCo mbStatus = false; } } - m_rOStm.SetNumberFormatInt( nOldFormat ); + m_rOStm.SetEndian( nOldFormat ); if ( xStatusIndicator.is() ) xStatusIndicator->end(); diff --git a/filter/source/graphicfilter/expm/expm.cxx b/filter/source/graphicfilter/expm/expm.cxx index 3b5fd5bd1c33..18b0b2389112 100644 --- a/filter/source/graphicfilter/expm/expm.cxx +++ b/filter/source/graphicfilter/expm/expm.cxx @@ -119,8 +119,8 @@ bool XPMWriter::WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConf mpAcc = aBmp.AcquireReadAccess(); if ( mpAcc ) { - sal_uInt16 nOStmOldModus = m_rOStm.GetNumberFormatInt(); - m_rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + SvStreamEndian nOStmOldModus = m_rOStm.GetEndian(); + m_rOStm.SetEndian( SvStreamEndian::BIG ); mnColors = mpAcc->GetPaletteEntryCount(); if ( ImplWriteHeader() ) @@ -130,7 +130,7 @@ bool XPMWriter::WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConf m_rOStm.WriteCharPtr( "\x22XPMENDEXT\x22\x0a};" ); } - m_rOStm.SetNumberFormatInt(nOStmOldModus); + m_rOStm.SetEndian(nOStmOldModus); aBmp.ReleaseAccess( mpAcc ); } diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index fdf2582bf09f..d00c40a6a5ce 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -727,7 +727,7 @@ ImportCGM( OUString const & rFileName, uno::Reference< frame::XModel > const & r boost::scoped_ptr pIn(::utl::UcbStreamHelper::CreateStream( rFileName, STREAM_READ )); if ( pIn ) { - pIn->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + pIn->SetEndian( SvStreamEndian::BIG ); sal_uInt64 const nInSize = pIn->remainingSize(); pIn->Seek( 0 ); diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 30e3cd8c0dfe..db0b1654d033 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -545,8 +545,8 @@ GraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) sal_uInt32 nSizeTIFF = 0; sal_uInt32 nPosTIFF = 0; sal_uInt32 nOrigPos = nPSStreamPos = rStream.Tell(); - sal_uInt16 nOldFormat = rStream.GetNumberFormatInt(); - rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + SvStreamEndian nOldFormat = rStream.GetEndian(); + rStream.SetEndian( SvStreamEndian::LITTLE ); rStream.ReadUInt32( nSignature ); if ( nSignature == 0xc6d3d0c5 ) { @@ -755,7 +755,7 @@ GraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) delete[] pBuf; } delete[] pHeader; - rStream.SetNumberFormatInt(nOldFormat); + rStream.SetEndian(nOldFormat); rStream.Seek( nOrigPos ); return ( bRetValue ); } diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 317adee72cca..214e655a6e15 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -349,7 +349,6 @@ private: // While doing this a recording in the GDIMetaFile // will take place. sal_uLong nOrigPos; // initial position in pOS2MET - sal_uInt16 nOrigNumberFormat; // initial number format of pOS2MET Rectangle aBoundingRect; // bounding rectangle as stored in the file Rectangle aCalcBndRect; // bounding rectangle calculated on our own MapMode aGlobMapMode; // resolution of the picture @@ -444,7 +443,6 @@ OS2METReader::OS2METReader() , pOS2MET(NULL) , pVirDev(NULL) , nOrigPos(0) - , nOrigNumberFormat(0) , aBoundingRect() , aCalcBndRect() , aGlobMapMode() @@ -2204,7 +2202,7 @@ void OS2METReader::ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen) // inside this file we need the header and the palette. if (p->pBMP==NULL) { p->pBMP=new SvMemoryStream(); - p->pBMP->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + p->pBMP->SetEndian(SvStreamEndian::LITTLE); if (p->nWidth==0 || p->nHeight==0 || p->nBitsPerPixel==0) { pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR); ErrorCode=3; @@ -2543,7 +2541,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize) case DatGrfObjMagic: { if (pOrdFile==NULL) { pOrdFile = new SvMemoryStream; - pOrdFile->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + pOrdFile->SetEndian(SvStreamEndian::LITTLE); } boost::scoped_array pBuf(new sal_uInt8[nFieldSize]); pOS2MET->Read(pBuf.get(),nFieldSize); @@ -2567,7 +2565,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF pOS2MET = &rStreamOS2MET; nOrigPos = pOS2MET->Tell(); - nOrigNumberFormat = pOS2MET->GetNumberFormatInt(); + SvStreamEndian nOrigNumberFormat = pOS2MET->GetEndian(); bCoord32 = true; pPaletteStack=NULL; @@ -2623,7 +2621,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF pVirDev->EnableOutput(false); rGDIMetaFile.Record(pVirDev); - pOS2MET->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + pOS2MET->SetEndian(SvStreamEndian::LITTLE); sal_uInt64 const nStartPos = pOS2MET->Tell(); sal_uInt64 const nRemaining = pOS2MET->remainingSize(); @@ -2736,7 +2734,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF delete p; } - pOS2MET->SetNumberFormatInt(nOrigNumberFormat); + pOS2MET->SetEndian(nOrigNumberFormat); if (pOS2MET->GetError()) { SAL_INFO("filter.os2met","Error code: " << ErrorCode); diff --git a/filter/source/graphicfilter/ipbm/ipbm.cxx b/filter/source/graphicfilter/ipbm/ipbm.cxx index 63a8b094633c..113b67629bb8 100644 --- a/filter/source/graphicfilter/ipbm/ipbm.cxx +++ b/filter/source/graphicfilter/ipbm/ipbm.cxx @@ -92,7 +92,7 @@ bool PBMReader::ReadPBM(Graphic & rGraphic ) if ( mrPBM.GetError() ) return false; - mrPBM.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + mrPBM.SetEndian( SvStreamEndian::LITTLE ); // read header: diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx index 9622e9b9843c..6bbcc07f4577 100644 --- a/filter/source/graphicfilter/ipcx/ipcx.cxx +++ b/filter/source/graphicfilter/ipcx/ipcx.cxx @@ -93,7 +93,7 @@ bool PCXReader::ReadPCX(Graphic & rGraphic) if ( m_rPCX.GetError() ) return false; - m_rPCX.SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + m_rPCX.SetEndian(SvStreamEndian::LITTLE); // read header: diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index 38e7cde58b09..1022c2ff076e 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -149,8 +149,7 @@ private: // A recording into the GDIMetaFile will take place. sal_uLong nOrigPos; // Initial position in pPict. - sal_uInt16 nOrigNumberFormat; // Initial number format von pPict. - bool IsVersion2; // If it is a version 2 Pictfile. + bool IsVersion2; // If it is a version 2 Pictfile. Rectangle aBoundingRect; // Min/Max-Rectangle for the whole drawing. Point aPenPosition; @@ -248,7 +247,6 @@ public: : pPict(NULL) , pVirDev(NULL) , nOrigPos(0) - , nOrigNumberFormat(0) , IsVersion2(false) , eActROP(ROP_OVERPAINT) , eActMethod(PDM_UNDEFINED) @@ -1873,7 +1871,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ) pPict = &rStreamPict; nOrigPos = pPict->Tell(); - nOrigNumberFormat = pPict->GetNumberFormatInt(); + SvStreamEndian nOrigNumberFormat = pPict->GetEndian(); aActForeColor = Color(COL_BLACK); aActBackColor = Color(COL_WHITE); @@ -1893,7 +1891,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ) pVirDev->EnableOutput(false); rGDIMetaFile.Record(pVirDev); - pPict->SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN); + pPict->SetEndian(SvStreamEndian::BIG); sal_uInt64 const nStartPos=pPict->Tell(); sal_uInt64 const nRemaining = pPict->remainingSize(); @@ -1956,7 +1954,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile ) rGDIMetaFile.SetPrefMapMode( MapMode( MAP_INCH, Point(), aHRes, aVRes ) ); rGDIMetaFile.SetPrefSize( aBoundingRect.GetSize() ); - pPict->SetNumberFormatInt(nOrigNumberFormat); + pPict->SetEndian(nOrigNumberFormat); if (pPict->GetError()) pPict->Seek(nOrigPos); } diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx index c6bbca3dc62a..64b7233a9384 100644 --- a/filter/source/graphicfilter/ipsd/ipsd.cxx +++ b/filter/source/graphicfilter/ipsd/ipsd.cxx @@ -111,7 +111,7 @@ bool PSDReader::ReadPSD(Graphic & rGraphic ) if (m_rPSD.GetError()) return false; - m_rPSD.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + m_rPSD.SetEndian( SvStreamEndian::BIG ); // read header: diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx index 91d279bc78c7..facca761af63 100644 --- a/filter/source/graphicfilter/iras/iras.cxx +++ b/filter/source/graphicfilter/iras/iras.cxx @@ -95,7 +95,7 @@ bool RASReader::ReadRAS(Graphic & rGraphic) if ( m_rRAS.GetError() ) return false; - m_rRAS.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + m_rRAS.SetEndian( SvStreamEndian::BIG ); m_rRAS.ReadUInt32( nMagicNumber ); if ( nMagicNumber != SUNRASTER_MAGICNUMBER ) return false; diff --git a/filter/source/graphicfilter/itga/itga.cxx b/filter/source/graphicfilter/itga/itga.cxx index fb09d58730fc..23f9163873d5 100644 --- a/filter/source/graphicfilter/itga/itga.cxx +++ b/filter/source/graphicfilter/itga/itga.cxx @@ -137,7 +137,7 @@ bool TGAReader::ReadTGA(Graphic & rGraphic) if ( m_rTGA.GetError() ) return false; - m_rTGA.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + m_rTGA.SetEndian( SvStreamEndian::LITTLE ); // Kopf einlesen: diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index 1582a11773b7..cd56f63af437 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -57,7 +57,6 @@ private: BitmapWriteAccess* pMaskAcc; sal_uLong nOrigPos; // start position in pTIFF - sal_uInt16 nOrigNumberFormat; // number format of pTIFF at the beginning sal_uInt16 nDataType; @@ -134,7 +133,6 @@ public: , pAlphaMask(NULL) , pMaskAcc(NULL) , nOrigPos(0) - , nOrigNumberFormat(0) , nDataType(0) , bByteSwap(false) , nNewSubFile(0) @@ -1141,9 +1139,9 @@ void TIFFReader::ReadHeader() pTIFF->ReadUChar( nbyte1 ); if ( nbyte1 == 'I' ) - pTIFF->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + pTIFF->SetEndian( SvStreamEndian::LITTLE ); else - pTIFF->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + pTIFF->SetEndian( SvStreamEndian::BIG ); pTIFF->ReadUChar( nbyte2 ).ReadUInt16( nushort ); if ( nbyte1 != nbyte2 || ( nbyte1 != 'I' && nbyte1 != 'M' ) || nushort != 0x002a ) @@ -1176,7 +1174,8 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) pTIFF = &rTIFF; nMaxPos = nOrigPos = pTIFF->Tell(); - nOrigNumberFormat = pTIFF->GetNumberFormatInt(); + // number format of pTIFF at the beginning + SvStreamEndian nOrigNumberFormat = pTIFF->GetEndian(); MayCallback( 0 ); @@ -1399,7 +1398,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) } // seek to end of TIFF if succeeded - pTIFF->SetNumberFormatInt( nOrigNumberFormat ); + pTIFF->SetEndian( nOrigNumberFormat ); pTIFF->Seek( bStatus ? nMaxPos : nOrigPos ); if ( aAnimation.Count() ) diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx index b4d614f172cc..d797a9fca61d 100644 --- a/filter/source/xmlfilterdetect/filterdetect.cxx +++ b/filter/source/xmlfilterdetect/filterdetect.cxx @@ -109,7 +109,7 @@ OUString SAL_CALL FilterDetect::detect( com::sun::star::uno::Sequence< com::sun: else if ( nHeader == 0x3C00 ) { bTryUtf16 = true; - pInStream->SetEndianSwap( !pInStream->IsEndianSwap() ); + pInStream->SetEndian( pInStream->GetEndian() == SvStreamEndian::LITTLE ? SvStreamEndian::BIG : SvStreamEndian::LITTLE ); } pInStream->Seek( STREAM_SEEK_TO_BEGIN ); } diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 037cf60d83a5..bbca71019c30 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -181,32 +181,32 @@ protected: sfx2::LinkManager* pLinkManager; // LinkManager std::deque* pUndoStack; std::deque* pRedoStack; - SdrUndoGroup* pAktUndoGroup; // for deeper + SdrUndoGroup* pAktUndoGroup; // for deeper sal_uInt16 nUndoLevel; // undo nesting sal_uInt16 nProgressPercent; // for the ProgressBar-Handler sal_uInt16 nLoadVersion; // version number of the loaded file - bool bMyPool:1; // to clean up pMyPool from 303a - bool bUIOnlyKomma:1; // see eUIUnit - bool mbUndoEnabled:1; // If false no undo is recorded or we are during the execution of an undo action - bool bExtColorTable:1; // ne separate ColorTable - bool mbChanged:1; - bool bInfoChanged:1; - bool bPagNumsDirty:1; - bool bMPgNumsDirty:1; - bool bPageNotValid:1; // TRUE=Doc is only object container. Page is invalid. - bool bSavePortable:1; // save metafiles portably - bool bNoBitmapCaching:1; // cache bitmaps for screen output - bool bReadOnly:1; - bool bTransparentTextFrames:1; - bool bSaveCompressed:1; - bool bSwapGraphics:1; - bool bPasteResize:1; // Objects are beingresized due to Paste with different MapMode - bool bSaveOLEPreview:1; // save preview metafile of OLE objects - bool bSaveNative:1; - bool bStarDrawPreviewMode:1; - bool mbDisableTextEditUsesCommonUndoManager:1; + bool bMyPool:1; // to clean up pMyPool from 303a + bool bUIOnlyKomma:1; // see eUIUnit + bool mbUndoEnabled:1; // If false no undo is recorded or we are during the execution of an undo action + bool bExtColorTable:1; // ne separate ColorTable + bool mbChanged:1; + bool bInfoChanged:1; + bool bPagNumsDirty:1; + bool bMPgNumsDirty:1; + bool bPageNotValid:1; // TRUE=Doc is only object container. Page is invalid. + bool bSavePortable:1; // save metafiles portably + bool bNoBitmapCaching:1; // cache bitmaps for screen output + bool bReadOnly:1; + bool bTransparentTextFrames:1; + bool bSaveCompressed:1; + bool bSwapGraphics:1; + bool bPasteResize:1; // Objects are beingresized due to Paste with different MapMode + bool bSaveOLEPreview:1; // save preview metafile of OLE objects + bool bSaveNative:1; + bool bStarDrawPreviewMode:1; + bool mbDisableTextEditUsesCommonUndoManager:1; sal_uInt16 nStreamCompressMode; // write compressedly? - sal_uInt16 nStreamNumberFormat; + SvStreamEndian nStreamNumberFormat; sal_uInt16 nDefaultTabulator; sal_uInt32 nMaxUndoCount; diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index 19dae556192f..dd830ae37f6e 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -72,8 +72,7 @@ typedef sal_uInt16 StreamMode; #define STREAM_SEEK_TO_BEGIN 0L #define STREAM_SEEK_TO_END SAL_MAX_UINT64 -#define NUMBERFORMAT_INT_BIGENDIAN (sal_uInt16)0x0000 -#define NUMBERFORMAT_INT_LITTLEENDIAN (sal_uInt16)0xFFFF +enum class SvStreamEndian { BIG, LITTLE }; #define COMPRESSMODE_NONE (sal_uInt16)0x0000 #define COMPRESSMODE_ZBITMAP (sal_uInt16)0x0001 @@ -217,7 +216,7 @@ private: bool bSwap; bool bIsEof; sal_uInt32 nError; - sal_uInt16 nNumberFormatInt; + SvStreamEndian nEndian; sal_uInt16 nCompressMode; LineEnd eLineDelimiter; rtl_TextEncoding eStreamCharSet; @@ -269,10 +268,8 @@ public: void SetError( sal_uInt32 nErrorCode ); virtual void ResetError(); - void SetNumberFormatInt( sal_uInt16 nNewFormat ); - sal_uInt16 GetNumberFormatInt() const { return nNumberFormatInt; } - /// Enable/disable swapping of endians, may be needed for Unicode import/export - inline void SetEndianSwap( bool bVal ); + void SetEndian( SvStreamEndian SvStreamEndian ); + SvStreamEndian GetEndian() const { return nEndian; } /// returns status of endian swap flag bool IsEndianSwap() const { return bSwap; } @@ -481,15 +478,6 @@ inline SvStream& operator<<( SvStream& rStr, SvStrPtr f ) return rStr; } -inline void SvStream::SetEndianSwap( bool bVal ) -{ -#ifdef OSL_BIGENDIAN - SetNumberFormatInt( bVal ? NUMBERFORMAT_INT_LITTLEENDIAN : NUMBERFORMAT_INT_BIGENDIAN ); -#else - SetNumberFormatInt( bVal ? NUMBERFORMAT_INT_BIGENDIAN : NUMBERFORMAT_INT_LITTLEENDIAN ); -#endif -} - TOOLS_DLLPUBLIC SvStream& endl( SvStream& rStr ); /// same as endl() but Unicode TOOLS_DLLPUBLIC SvStream& endlu( SvStream& rStr ); diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index f3cd939ff3d2..5e5e213abc92 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1615,7 +1615,7 @@ void XclExpObjectManager::InitStream( bool bTempFile ) if( !mxDffStrm.get() ) mxDffStrm.reset( new SvMemoryStream ); - mxDffStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + mxDffStrm->SetEndian( SvStreamEndian::LITTLE ); } XclExpEmbeddedObjectManager::XclExpEmbeddedObjectManager( diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index f45a8b534c7e..8bca3fb69d93 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -4018,7 +4018,7 @@ void XclImpDrawing::ReadBmp( Graphic& rGraphic, const XclImpRoot& rRoot, XclImpS if( (nHdrSize == 12) && (nPlanes == 1) && (nDepth == 32) ) { rStrm.Ignore( 3 ); - aMemStrm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + aMemStrm.SetEndian( SvStreamEndian::LITTLE ); aMemStrm.WriteUInt32( nHdrSize ).WriteUInt16( nWidth ).WriteUInt16( nHeight ).WriteUInt16( nPlanes ).WriteUInt16( nDepth ); rStrm.CopyToStream( aMemStrm, rStrm.GetRecLeft() ); } diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index 271519abcc50..6bd7448a780e 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -87,7 +87,7 @@ SvStream* XclEscherExGlobal::ImplQueryPictureStream() { mxPicTempFile->EnableKillingFile(); mxPicStrm.reset( ::utl::UcbStreamHelper::CreateStream( mxPicTempFile->GetURL(), STREAM_STD_READWRITE ) ); - mxPicStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + mxPicStrm->SetEndian( SvStreamEndian::LITTLE ); } return mxPicStrm.get(); } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 96c527df0d4d..67b5d5d4a31c 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1814,7 +1814,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt rtl_TextEncoding eOldCharSet = rStream.GetStreamCharSet(); rStream.SetStreamCharSet( eCharSet ); - sal_uInt16 nOldNumberFormatInt = rStream.GetNumberFormatInt(); + SvStreamEndian nOldNumberFormatInt = rStream.GetEndian(); OString aStrDelimEncoded; // only used if not Unicode OUString aStrDelimDecoded; // only used if context encoding OString aDelimEncoded; @@ -2180,7 +2180,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt } rStream.SetStreamCharSet( eOldCharSet ); - rStream.SetNumberFormatInt( nOldNumberFormatInt ); + rStream.SetEndian( nOldNumberFormatInt ); } bool ScDocShell::ConvertTo( SfxMedium &rMed ) diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx index 22ced95b5e4f..1d070c142568 100644 --- a/sc/source/ui/inc/impex.hxx +++ b/sc/source/ui/inc/impex.hxx @@ -166,18 +166,18 @@ public: inline bool ScImportExport::IsEndianSwap( const SvStream& rStrm ) { #ifdef OSL_BIGENDIAN - return rStrm.GetNumberFormatInt() != NUMBERFORMAT_INT_BIGENDIAN; + return rStrm.GetEndian() != SvStreamEndian::BIG; #else - return rStrm.GetNumberFormatInt() != NUMBERFORMAT_INT_LITTLEENDIAN; + return rStrm.GetEndian() != SvStreamEndian::LITTLE; #endif } inline void ScImportExport::SetNoEndianSwap( SvStream& rStrm ) { #ifdef OSL_BIGENDIAN - rStrm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + rStrm.SetEndian( SvStreamEndian::BIG ); #else - rStrm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rStrm.SetEndian( SvStreamEndian::LITTLE ); #endif } @@ -190,7 +190,11 @@ public: rStr.getLength() * sizeof(sal_Unicode), STREAM_READ) { SetStreamCharSet( RTL_TEXTENCODING_UNICODE ); - SetEndianSwap( false ); +#ifdef OSL_BIGENDIAN + SetEndian(SvStreamEndian::BIG); +#else + SetEndian(SvStreamEndian::LITTLE); +#endif } }; diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx index 69034aadc7c2..ec95e409b8e6 100644 --- a/sd/source/filter/ppt/propread.cxx +++ b/sd/source/filter/ppt/propread.cxx @@ -512,7 +512,7 @@ PropRead::PropRead( SvStorage& rStorage, const OUString& rName ) : mpSvStream = rStorage.OpenSotStream( rName, STREAM_STD_READ ); if ( mpSvStream ) { - mpSvStream->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + mpSvStream->SetEndian( SvStreamEndian::LITTLE ); memset( mApplicationCLSID, 0, 16 ); mbStatus = true; } diff --git a/starmath/source/eqnolefilehdr.cxx b/starmath/source/eqnolefilehdr.cxx index 75d180f1587b..d1d7428af8cd 100644 --- a/starmath/source/eqnolefilehdr.cxx +++ b/starmath/source/eqnolefilehdr.cxx @@ -38,7 +38,7 @@ bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion ) if ( (!xSrc.Is()) || (SVSTREAM_OK != xSrc->GetError())) return bSuccess; SvStorageStream *pS = &xSrc; - pS->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + pS->SetEndian( SvStreamEndian::LITTLE ); EQNOLEFILEHDR aHdr; aHdr.Read(pS); diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 21800ce0e331..bdbc36ebc391 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -560,7 +560,7 @@ int MathType::Parse(SotStorage *pStor) if ( (!xSrc.Is()) || (SVSTREAM_OK != xSrc->GetError())) return 0; pS = &xSrc; - pS->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + pS->SetEndian( SvStreamEndian::LITTLE ); EQNOLEFILEHDR aHdr; aHdr.Read(pS); @@ -1934,7 +1934,7 @@ int MathType::ConvertFromStarMath( SfxMedium& rMedium ) return 0; pS = &xSrc; - pS->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + pS->SetEndian( SvStreamEndian::LITTLE ); pS->SeekRel(EQNOLEFILEHDR_SIZE); //Skip 28byte Header and fill it in later pS->WriteUChar( sal_uInt8(0x03) ); diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index 3f687c2a51e6..6ff356b22ade 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -945,11 +945,11 @@ void ImageMap::Write( SvStream& rOStm, const OUString& rBaseURL ) const { IMapCompat* pCompat; OUString aImageName( GetName() ); - sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt(); - sal_uInt16 nCount = (sal_uInt16) GetIMapObjectCount(); + SvStreamEndian nOldFormat = rOStm.GetEndian(); + sal_uInt16 nCount = (sal_uInt16) GetIMapObjectCount(); const rtl_TextEncoding eEncoding = osl_getThreadTextEncoding(); //vomit! - rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rOStm.SetEndian( SvStreamEndian::LITTLE ); // write MagicCode rOStm.WriteCharPtr( IMAPMAGIC ); @@ -967,7 +967,7 @@ void ImageMap::Write( SvStream& rOStm, const OUString& rBaseURL ) const ImpWriteImageMap( rOStm, rBaseURL ); - rOStm.SetNumberFormatInt( nOldFormat ); + rOStm.SetEndian( nOldFormat ); } @@ -979,11 +979,11 @@ void ImageMap::Write( SvStream& rOStm, const OUString& rBaseURL ) const void ImageMap::Read( SvStream& rIStm, const OUString& rBaseURL ) { - char cMagic[6]; - sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt(); + char cMagic[6]; + SvStreamEndian nOldFormat = rIStm.GetEndian(); sal_uInt16 nCount; - rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rIStm.SetEndian( SvStreamEndian::LITTLE ); rIStm.Read( cMagic, sizeof( cMagic ) ); if ( !memcmp( cMagic, IMAPMAGIC, sizeof( cMagic ) ) ) @@ -1012,7 +1012,7 @@ void ImageMap::Read( SvStream& rIStm, const OUString& rBaseURL ) else rIStm.SetError( SVSTREAM_GENERALERROR ); - rIStm.SetNumberFormatInt( nOldFormat ); + rIStm.SetEndian( nOldFormat ); } diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 5c2db6fb35fd..84efe695a76e 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -155,7 +155,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe bNoBitmapCaching=false; bReadOnly=false; nStreamCompressMode=COMPRESSMODE_NONE; - nStreamNumberFormat=NUMBERFORMAT_INT_BIGENDIAN; + nStreamNumberFormat=SvStreamEndian::BIG; nDefaultTabulator=0; mpNumberFormatter = NULL; bTransparentTextFrames=false; @@ -177,7 +177,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe get(); #ifdef OSL_LITENDIAN - nStreamNumberFormat=NUMBERFORMAT_INT_LITTLEENDIAN; + nStreamNumberFormat=SvStreamEndian::LITTLE; #endif bExtColorTable=bUseExtColorTable; diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index 9df9e667f016..f67c3dfd16ce 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -290,9 +290,9 @@ bool SwEditShell::GetSelectedText( OUString &rBuf, int nHndlParaBrk ) { SvMemoryStream aStream; #ifdef OSL_BIGENDIAN - aStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + aStream.SetEndian( SvStreamEndian::BIG ); #else - aStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + aStream.SetEndian( SvStreamEndian::LITTLE ); #endif WriterRef xWrt; SwReaderWriter::GetWriter( OUString(FILTER_TEXT), OUString(), xWrt ); diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index da3d5eadf10a..fdaf53d41f6d 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -167,9 +167,9 @@ void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, OUString & rBuffer) } SvMemoryStream aStream; #ifdef OSL_BIGENDIAN - aStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + aStream.SetEndian( SvStreamEndian::BIG ); #else - aStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + aStream.SetEndian( SvStreamEndian::LITTLE ); #endif WriterRef xWrt; // TODO/MBA: looks like a BaseURL doesn't make sense here diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx index e8cae7477a7a..66a671622c04 100644 --- a/sw/source/filter/ascii/wrtasc.cxx +++ b/sw/source/filter/ascii/wrtasc.cxx @@ -157,10 +157,11 @@ sal_uLong SwASCWriter::WriteStream() Strm().WriteUChar( 0xEF ).WriteUChar( 0xBB ).WriteUChar( 0xBF ); break; case RTL_TEXTENCODING_UCS2: - Strm().SetEndianSwap(false); #ifdef OSL_LITENDIAN + Strm().SetEndian(SvStreamEndian::LITTLE); Strm().WriteUChar( 0xFF ).WriteUChar( 0xFE ); #else + Strm().SetEndian(SvStreamEndian::BIG); Strm().WriteUChar( 0xFE ).WriteUChar( 0xFF ); #endif break; diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 3f2707fe4cf9..e79dd9d8f54e 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1447,7 +1447,7 @@ void WW8Export::CreateEscher() { OSL_ENSURE( !pEscher, "wer hat den Pointer nicht geloescht?" ); SvMemoryStream* pEscherStrm = new SvMemoryStream; - pEscherStrm->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + pEscherStrm->SetEndian(SvStreamEndian::LITTLE); pEscher = new SwEscherEx(pEscherStrm, *this); } } @@ -1495,7 +1495,7 @@ SvStream* SwEscherExGlobal::ImplQueryPictureStream() { // this function will be called exactly once mxPicStrm.reset( new SvMemoryStream ); - mxPicStrm->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + mxPicStrm->SetEndian(SvStreamEndian::LITTLE); return mxPicStrm.get(); } @@ -2113,7 +2113,7 @@ sal_Int32 SwEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt, MSO_SPT eShapeType { Polygon aPoly = CorrectWordWrapPolygonForExport(*pPolyPoly, pNd); SvMemoryStream aPolyDump; - aPolyDump.SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + aPolyDump.SetEndian(SvStreamEndian::LITTLE); sal_uInt16 nLen = aPoly.GetSize(); aPolyDump.WriteUInt16( nLen ); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 134b4aebbfc6..c45b7e97c924 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3151,15 +3151,15 @@ void WW8Export::ExportDocument_Impl() xDataStrm->SetBufferSize( 32768 ); // for graphics xTableStrm->SetBufferSize( 16384 ); // for the Font-/Style-Table, etc. - xTableStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - xDataStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + xTableStrm->SetEndian( SvStreamEndian::LITTLE ); + xDataStrm->SetEndian( SvStreamEndian::LITTLE ); } GetWriter().SetStream( & *xWwStrm ); pTableStrm = &xTableStrm; pDataStrm = &xDataStrm; - Strm().SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + Strm().SetEndian( SvStreamEndian::LITTLE ); utl::TempFile aTempMain; aTempMain.EnableKillingFile(); diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index cb60ebf19b13..680d26251f92 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -37,7 +37,7 @@ WW8Glossary::WW8Glossary(SvStorageStreamRef &refStrm, sal_uInt8 nVersion, SvStorage *pStg) : pGlossary(0), rStrm(refStrm), xStg(pStg), nStrings(0) { - refStrm->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + refStrm->SetEndian(SvStreamEndian::LITTLE); WW8Fib aWwFib(*refStrm, nVersion); if (aWwFib.nFibBack >= 0x6A) //Word97 @@ -47,7 +47,7 @@ WW8Glossary::WW8Glossary(SvStorageStreamRef &refStrm, sal_uInt8 nVersion, if (xTableStream.Is() && SVSTREAM_OK == xTableStream->GetError()) { - xTableStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + xTableStream->SetEndian(SvStreamEndian::LITTLE); pGlossary = new WW8GlossaryFib(*refStrm, nVersion, *xTableStream, aWwFib); } diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index f94ecbddfec9..1d7dcad7481b 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4237,7 +4237,7 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SvStorage* pStorage, , maCurrAttrCP(-1) , mbOnLoadingMain(false) { - pStrm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + pStrm->SetEndian( SvStreamEndian::LITTLE ); maApos.push_back(false); } @@ -4842,13 +4842,13 @@ bool SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom, lcl_createTemplateToProjectEntry( xPrjNameCache, aURL, aBasicImporter.getProjectName() ); // Read toolbars & menus SvStorageStreamRef refMainStream = rRoot->OpenSotStream( OUString( "WordDocument" )); - refMainStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + refMainStream->SetEndian(SvStreamEndian::LITTLE); WW8Fib aWwFib( *refMainStream, 8 ); SvStorageStreamRef xTableStream = rRoot->OpenSotStream(OUString::createFromAscii( aWwFib.fWhichTblStm ? SL::a1Table : SL::a0Table), STREAM_STD_READ); if (xTableStream.Is() && SVSTREAM_OK == xTableStream->GetError()) { - xTableStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + xTableStream->SetEndian(SvStreamEndian::LITTLE); WW8Customizations aGblCustomisations( xTableStream, aWwFib ); aGblCustomisations.Import( mpDocShell ); } @@ -5368,7 +5368,7 @@ sal_uLong SwWW8ImplReader::SetSubStreams(SvStorageStreamRef &rTableStream, STREAM_STD_READ); pTableStream = &rTableStream; - pTableStream->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + pTableStream->SetEndian( SvStreamEndian::LITTLE ); rDataStream = pStg->OpenSotStream(OUString(SL::aData), STREAM_STD_READ | STREAM_NOCREATE ); @@ -5376,7 +5376,7 @@ sal_uLong SwWW8ImplReader::SetSubStreams(SvStorageStreamRef &rTableStream, if (rDataStream.Is() && SVSTREAM_OK == rDataStream->GetError()) { pDataStream = &rDataStream; - pDataStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + pDataStream->SetEndian(SvStreamEndian::LITTLE); } else pDataStream = pStrm; diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index bc48b2932b41..afa58466ef4d 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -85,7 +85,7 @@ static bool SwWw8ReadScaling(long& rX, long& rY, SvStorageRef& rSrc1) SvStorageStreamRef xSrc3 = rSrc1->OpenSotStream( OUString("\3PIC"), STREAM_STD_READ | STREAM_NOCREATE); SvStorageStream* pS = xSrc3; - pS->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + pS->SetEndian( SvStreamEndian::LITTLE ); pS->Seek( STREAM_SEEK_TO_END ); OSL_ENSURE( pS->Tell() >= 76, "+OLE-PIC-Stream is shorter than 76 Byte" ); @@ -130,7 +130,7 @@ static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp, SvStorageStreamRef xSrc2 = rSrc1->OpenSotStream( OUString("\3META"), STREAM_STD_READ | STREAM_NOCREATE); SvStorageStream* pSt = xSrc2; - pSt->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + pSt->SetEndian( SvStreamEndian::LITTLE ); sal_uLong nRead = pSt->Read( pMfp, sizeof(*pMfp ) ); // Mini-Placable-Header lesen if (nRead != sizeof(*pMfp)) @@ -184,7 +184,7 @@ static bool SwWw6ReadMacPICTStream(Graphic& rGraph, SvStorageRef& rSrc1) // 03-META-Stream nicht da. Vielleicht ein 03-PICT ? SvStorageStreamRef xSrc4 = rSrc1->OpenSotStream(OUString("\3PICT")); SvStorageStream* pStp = xSrc4; - pStp->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + pStp->SetEndian( SvStreamEndian::LITTLE ); sal_uInt8 aTestA[10]; // Ist der 01Ole-Stream ueberhaupt vorhanden sal_uLong nReadTst = pStp->Read( aTestA, sizeof( aTestA ) ); if (nReadTst != sizeof(aTestA)) diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 41603a2ba010..3ff1a1e54b44 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -1645,9 +1645,9 @@ bool SwTransferable::_PasteFileContent( TransferableDataHelper& rData, sData.getLength() * sizeof( sal_Unicode ), STREAM_READ ); #ifdef OSL_BIGENDIAN - pStream->SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + pStream->SetEndian( SvStreamEndian::BIG ); #else - pStream->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + pStream->SetEndian( SvStreamEndian::LITTLE ); #endif SwAsciiOptions aAOpt; diff --git a/tools/qa/cppunit/test_stream.cxx b/tools/qa/cppunit/test_stream.cxx index 57c30e506eae..5c9d8fdc6ac8 100644 --- a/tools/qa/cppunit/test_stream.cxx +++ b/tools/qa/cppunit/test_stream.cxx @@ -187,7 +187,7 @@ namespace CPPUNIT_ASSERT(!aMemStream.bad()); CPPUNIT_ASSERT(aMemStream.eof()); - aMemStream.SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN); + aMemStream.SetEndian(SvStreamEndian::BIG); aMemStream.Seek(0); foo[0] = 0; foo[1] = 3; @@ -197,7 +197,7 @@ namespace CPPUNIT_ASSERT(!aMemStream.bad()); CPPUNIT_ASSERT(!aMemStream.eof()); - aMemStream.SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + aMemStream.SetEndian(SvStreamEndian::LITTLE); aMemStream.Seek(0); foo[0] = 3; foo[1] = 0; diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 5d8f88a0afc2..c1eb8b57efcb 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -1560,9 +1560,9 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly ) } #if (SAL_TYPES_SIZEOFLONG) == 4 #ifdef OSL_BIGENDIAN - if ( rIStream.GetNumberFormatInt() == NUMBERFORMAT_INT_BIGENDIAN ) + if ( rIStream.GetEndian() == SvStreamEndian::BIG ) #else - if ( rIStream.GetNumberFormatInt() == NUMBERFORMAT_INT_LITTLEENDIAN ) + if ( rIStream.GetEndian() == SvStreamEndian::LITTLE ) #endif rIStream.Read( rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point) ); else @@ -1595,9 +1595,9 @@ SvStream& WritePolygon( SvStream& rOStream, const Polygon& rPoly ) // Determine whether we need to write through operators #if (SAL_TYPES_SIZEOFLONG) == 4 #ifdef OSL_BIGENDIAN - if ( rOStream.GetNumberFormatInt() == NUMBERFORMAT_INT_BIGENDIAN ) + if ( rOStream.GetEndian() == SvStreamEndian::BIG ) #else - if ( rOStream.GetNumberFormatInt() == NUMBERFORMAT_INT_LITTLEENDIAN ) + if ( rOStream.GetEndian() == SvStreamEndian::LITTLE ) #endif { if ( nPoints ) diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 864876fc52e3..db4a39811671 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -388,7 +388,7 @@ void SvStream::ImpInit() eLineDelimiter = LINEEND_CRLF; // DOS-Format #endif - SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + SetEndian( SvStreamEndian::LITTLE ); m_nBufFilePos = 0; nBufActualPos = 0; @@ -450,15 +450,15 @@ void SvStream::SetError( sal_uInt32 nErrorCode ) nError = nErrorCode; } -void SvStream::SetNumberFormatInt( sal_uInt16 nNewFormat ) +void SvStream::SetEndian( SvStreamEndian nNewFormat ) { - nNumberFormatInt = nNewFormat; + nEndian = nNewFormat; bSwap = false; #ifdef OSL_BIGENDIAN - if( nNumberFormatInt == NUMBERFORMAT_INT_LITTLEENDIAN ) + if( nEndian == SvStreamEndian::LITTLE ) bSwap = true; #else - if( nNumberFormatInt == NUMBERFORMAT_INT_BIGENDIAN ) + if( nEndian == SvStreamEndian::BIG ) bSwap = true; #endif } @@ -795,11 +795,11 @@ bool SvStream::WriteUniOrByteChar( sal_Unicode ch, rtl_TextEncoding eDestCharSet bool SvStream::StartWritingUnicodeText() { - SetEndianSwap( false ); // write native format // BOM, Byte Order Mark, U+FEFF, see // http://www.unicode.org/faq/utf_bom.html#BOM // Upon read: 0xfeff(-257) => no swap; 0xfffe(-2) => swap - WriteUInt16( 0xfeff ); + sal_uInt16 v = 0xfeff; + WRITENUMBER_WITHOUT_SWAP(sal_uInt16, v); // write native format return nError == SVSTREAM_OK; } @@ -827,18 +827,18 @@ bool SvStream::StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet ) if ( eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW || eReadBomCharSet == RTL_TEXTENCODING_UNICODE) { - SetEndianSwap( !bSwap ); + SetEndian( nEndian == SvStreamEndian::BIG ? SvStreamEndian::LITTLE : SvStreamEndian::BIG ); nBack = 0; } break; case 0xefbb : - if (nNumberFormatInt == NUMBERFORMAT_INT_BIGENDIAN && + if (nEndian == SvStreamEndian::BIG && (eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW || eReadBomCharSet == RTL_TEXTENCODING_UTF8)) bTryUtf8 = true; break; case 0xbbef : - if (nNumberFormatInt == NUMBERFORMAT_INT_LITTLEENDIAN && + if (nEndian == SvStreamEndian::LITTLE && (eReadBomCharSet == RTL_TEXTENCODING_DONTKNOW || eReadBomCharSet == RTL_TEXTENCODING_UTF8)) bTryUtf8 = true; diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 9ef46c8d423e..cff0fed318ba 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -193,7 +193,7 @@ bool isPCT(SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen) { sal_uInt8 sBuf[3]; // store number format - sal_uInt16 oldNumberFormat = rStream.GetNumberFormatInt(); + SvStreamEndian oldNumberFormat = rStream.GetEndian(); sal_uInt32 nOffset; // in MS documents the pict format is used without the first 512 bytes for ( nOffset = 0; ( nOffset <= 512 ) && ( ( nStreamPos + nOffset + 14 ) <= nStreamLen ); nOffset += 512 ) { @@ -204,9 +204,9 @@ bool isPCT(SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen) // size of the pict in version 1 pict ( 2bytes) : ignored rStream.SeekRel(2); // bounding box (bytes 2 -> 9) - rStream.SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN); + rStream.SetEndian(SvStreamEndian::BIG); rStream.ReadInt16( y1 ).ReadInt16( x1 ).ReadInt16( y2 ).ReadInt16( x2 ); - rStream.SetNumberFormatInt(oldNumberFormat); // reset format + rStream.SetEndian(oldNumberFormat); // reset format if (x1 > x2 || y1 > y2 || // bad bdbox (x1 == x2 && y1 == y2) || // 1 pixel picture @@ -318,7 +318,7 @@ static bool ImpPeekGraphicFormat( SvStream& rStream, OUString& rFormatExtension, bSomethingTested=true; if( sFirstBytes[2] == 0xd3 ) { - rStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + rStream.SetEndian( SvStreamEndian::BIG ); rStream.Seek( nStreamPos ); sal_uInt16 nFieldSize; sal_uInt8 nMagic; @@ -331,7 +331,7 @@ static bool ImpPeekGraphicFormat( SvStream& rStream, OUString& rFormatExtension, rStream.ReadUInt16( nFieldSize ).ReadUChar( nMagic ); if (nMagic!=0xd3) { bOK=false; break; } } - rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rStream.SetEndian( SvStreamEndian::LITTLE ); if (bOK && !rStream.GetError()) { rFormatExtension = "MET"; return true; diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index 138b4fc47fb1..2752eebb1ba3 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -60,8 +60,8 @@ bool GraphicDescriptor::Detect( bool bExtendedInfo ) bool bRet = false; if ( pFileStm && !pFileStm->GetError() ) { - SvStream& rStm = *pFileStm; - sal_uInt16 nOldFormat = rStm.GetNumberFormatInt(); + SvStream& rStm = *pFileStm; + SvStreamEndian nOldFormat = rStm.GetEndian(); if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = true; else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = true; @@ -89,7 +89,7 @@ bool GraphicDescriptor::Detect( bool bExtendedInfo ) else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = true; else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = true; - rStm.SetNumberFormatInt( nOldFormat ); + rStm.SetEndian( nOldFormat ); } return bRet; } @@ -108,7 +108,7 @@ bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, bool bExtendedInfo ) bool bRet = false; sal_Int32 nStmPos = rStm.Tell(); - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rStm.SetEndian( SvStreamEndian::LITTLE ); rStm.ReadUInt16( nTemp16 ); // OS/2-BitmapArray @@ -183,7 +183,7 @@ bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, bool bExtendedInfo ) sal_uInt8 cByte = 0; sal_Int32 nStmPos = rStm.Tell(); - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rStm.SetEndian( SvStreamEndian::LITTLE ); rStm.ReadUInt32( n32 ); if ( n32 == 0x38464947 ) @@ -249,7 +249,7 @@ bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, bool bExtendedInfo ) sal_Int32 nStmPos = rStm.Tell(); - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + rStm.SetEndian( SvStreamEndian::BIG ); rStm.ReadUInt32( nTemp32 ); // compare upper 24 bits @@ -404,7 +404,7 @@ bool GraphicDescriptor::ImpDetectPCD( SvStream& rStm, bool ) bool bRet = false; sal_Int32 nStmPos = rStm.Tell(); - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rStm.SetEndian( SvStreamEndian::LITTLE ); sal_uInt32 nTemp32 = 0; sal_uInt16 nTemp16 = 0; @@ -438,7 +438,7 @@ bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, bool bExtendedInfo ) sal_uInt8 cByte = 0; sal_Int32 nStmPos = rStm.Tell(); - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rStm.SetEndian( SvStreamEndian::LITTLE ); rStm.ReadUChar( cByte ); if ( cByte == 0x0a ) @@ -515,7 +515,7 @@ bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, bool bExtendedInfo ) bool bRet = false; sal_Int32 nStmPos = rStm.Tell(); - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + rStm.SetEndian( SvStreamEndian::BIG ); rStm.ReadUInt32( nTemp32 ); if ( nTemp32 == 0x89504e47 ) @@ -618,12 +618,12 @@ bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, bool bExtendedInfo ) { if ( cByte1 == 0x49 ) { - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rStm.SetEndian( SvStreamEndian::LITTLE ); bDetectOk = true; } else if ( cByte1 == 0x4d ) { - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + rStm.SetEndian( SvStreamEndian::BIG ); bDetectOk = true; } @@ -825,7 +825,7 @@ bool GraphicDescriptor::ImpDetectRAS( SvStream& rStm, bool ) sal_uInt32 nMagicNumber = 0; bool bRet = false; sal_Int32 nStmPos = rStm.Tell(); - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + rStm.SetEndian( SvStreamEndian::BIG ); rStm.ReadUInt32( nMagicNumber ); if ( nMagicNumber == 0x59a66a95 ) { @@ -851,7 +851,7 @@ bool GraphicDescriptor::ImpDetectPSD( SvStream& rStm, bool bExtendedInfo ) sal_uInt32 nMagicNumber = 0; sal_Int32 nStmPos = rStm.Tell(); - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + rStm.SetEndian( SvStreamEndian::BIG ); rStm.ReadUInt32( nMagicNumber ); if ( nMagicNumber == 0x38425053 ) { @@ -907,7 +907,7 @@ bool GraphicDescriptor::ImpDetectEPS( SvStream& rStm, bool ) memset(nFirstBytes, 0, sizeof (nFirstBytes)); sal_Int32 nStmPos = rStm.Tell(); - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + rStm.SetEndian( SvStreamEndian::BIG ); rStm.ReadUInt32( nFirstLong ); rStm.SeekRel( -4 ); rStm.Read( &nFirstBytes, 20 ); @@ -1002,7 +1002,7 @@ bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, bool bExtendedInfo ) sal_uInt8 cByte = 0; sal_Int32 nStmPos = rStm.Tell(); - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rStm.SetEndian( SvStreamEndian::LITTLE ); rStm.ReadUInt32( n32 ); if ( n32 == 0x44475653 ) { diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 2ed44e0834a3..7b87230ced2c 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -805,11 +805,11 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic ) bool ImportGIF( SvStream & rStm, Graphic& rGraphic ) { GIFReader* pGIFReader = static_cast(rGraphic.GetContext()); - sal_uInt16 nOldFormat = rStm.GetNumberFormatInt(); + SvStreamEndian nOldFormat = rStm.GetEndian(); ReadState eReadState; bool bRet = true; - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rStm.SetEndian( SvStreamEndian::LITTLE ); if( !pGIFReader ) pGIFReader = new GIFReader( rStm ); @@ -830,7 +830,7 @@ bool ImportGIF( SvStream & rStm, Graphic& rGraphic ) rGraphic.SetContext( pGIFReader ); } - rStm.SetNumberFormatInt( nOldFormat ); + rStm.SetEndian( nOldFormat ); return bRet; } diff --git a/vcl/source/filter/jpeg/Exif.cxx b/vcl/source/filter/jpeg/Exif.cxx index 1a0f05b7471e..a39c2dbda9fc 100644 --- a/vcl/source/filter/jpeg/Exif.cxx +++ b/vcl/source/filter/jpeg/Exif.cxx @@ -93,7 +93,7 @@ bool Exif::processJpeg(SvStream& rStream, bool bSetValue) sal_uInt32 aSize = rStream.Tell(); rStream.Seek(STREAM_SEEK_TO_BEGIN); - rStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + rStream.SetEndian( SvStreamEndian::BIG ); rStream.ReadUInt16( aMagic16 ); // Compare JPEG magic bytes diff --git a/vcl/source/filter/wmf/wmf.cxx b/vcl/source/filter/wmf/wmf.cxx index 3d932f2c445a..21ab4a46c8be 100644 --- a/vcl/source/filter/wmf/wmf.cxx +++ b/vcl/source/filter/wmf/wmf.cxx @@ -28,8 +28,8 @@ bool ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, { sal_uInt32 nMetaType; sal_uInt32 nOrgPos = rStreamWMF.Tell(); - sal_uInt16 nOrigNumberFormat = rStreamWMF.GetNumberFormatInt(); - rStreamWMF.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + SvStreamEndian nOrigNumberFormat = rStreamWMF.GetEndian(); + rStreamWMF.SetEndian( SvStreamEndian::LITTLE ); rStreamWMF.Seek( 0x28 ); rStreamWMF.ReadUInt32( nMetaType ); rStreamWMF.Seek( nOrgPos ); @@ -49,7 +49,7 @@ bool ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, SAL_INFO("vcl.emf", "\t\t\tsize: " << rGDIMetaFile.GetSizeBytes()); #endif - rStreamWMF.SetNumberFormatInt( nOrigNumberFormat ); + rStreamWMF.SetEndian( nOrigNumberFormat ); return !rStreamWMF.GetError(); } @@ -58,11 +58,11 @@ bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* sal_uInt32 nMetaType(0); sal_uInt32 nOrgPos = rStream.Tell(); - sal_uInt16 nOrigNumberFormat = rStream.GetNumberFormatInt(); - rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + SvStreamEndian nOrigNumberFormat = rStream.GetEndian(); + rStream.SetEndian( SvStreamEndian::LITTLE ); //exception-safe reset nOrigNumberFormat at end of scope const ::comphelper::ScopeGuard aScopeGuard( - boost::bind(&SvStream::SetNumberFormatInt, ::boost::ref(rStream), + boost::bind(&SvStream::SetEndian, ::boost::ref(rStream), nOrigNumberFormat)); rStream.Seek( 0x28 ); diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index e2b4aef85535..de1c96e934bd 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -1722,7 +1722,7 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, nLastPercent=0; pWMF=&rTargetStream; - pWMF->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + pWMF->SetEndian(SvStreamEndian::LITTLE); nMaxRecordSize=0; diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index c6f24388b214..9666e0f49101 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -740,10 +740,10 @@ SvStream& ReadAnimation( SvStream& rIStm, Animation& rAnimation ) Bitmap aBmp; sal_uLong nStmPos = rIStm.Tell(); sal_uInt32 nAnimMagic1, nAnimMagic2; - sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt(); + SvStreamEndian nOldFormat = rIStm.GetEndian(); bool bReadAnimations = false; - rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rIStm.SetEndian( SvStreamEndian::LITTLE ); nStmPos = rIStm.Tell(); rIStm.ReadUInt32( nAnimMagic1 ).ReadUInt32( nAnimMagic2 ); @@ -799,7 +799,7 @@ SvStream& ReadAnimation( SvStream& rIStm, Animation& rAnimation ) rAnimation.ResetLoopCount(); } - rIStm.SetNumberFormatInt( nOldFormat ); + rIStm.SetEndian( nOldFormat ); return rIStm; } diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index c8676c04ac3f..4e0bb5a0d5a0 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -447,9 +447,9 @@ SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, sal_uLong nConver void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { const sal_uLong nPos = rIStm.Tell(); - const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt(); + const SvStreamEndian nOldFormat = rIStm.GetEndian(); - rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rIStm.SetEndian( SvStreamEndian::LITTLE ); char aCode[ 5 ]; Size aPrefSz; @@ -472,7 +472,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) || ( nVersion != 200 ) ) { rIStm.SetError( SVSTREAM_FILEFORMAT_ERROR ); - rIStm.SetNumberFormatInt( nOldFormat ); + rIStm.SetEndian( nOldFormat ); rIStm.Seek( nPos ); return; } @@ -1344,14 +1344,14 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) aLIStack.pop(); } - rIStm.SetNumberFormatInt( nOldFormat ); + rIStm.SetEndian( nOldFormat ); } void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf ) { sal_uLong nCountPos; vcl::Font aSaveFont; - const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt(); + const SvStreamEndian nOldFormat = rOStm.GetEndian(); rtl_TextEncoding eActualCharSet = osl_getThreadTextEncoding(); const Size aPrefSize( rMtf.GetPrefSize() ); bool bRop_0_1 = false; @@ -1359,7 +1359,7 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf ) Color aLineCol( COL_BLACK ); ::std::stack< Color* > aLineColStack; - rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rOStm.SetEndian( SvStreamEndian::LITTLE ); // Write MagicCode rOStm.WriteCharPtr( "SVGDI" ); // Identifier @@ -1379,7 +1379,7 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf ) rOStm.Seek( nCountPos ); rOStm.WriteInt32( nActCount ); rOStm.Seek( nActPos ); - rOStm.SetNumberFormatInt( nOldFormat ); + rOStm.SetEndian( nOldFormat ); // cleanup push-pop stack if necessary while ( !aLineColStack.empty() ) diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index af6a78ebb222..054c070264cd 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -1414,12 +1414,12 @@ bool ImplReadDIB( SvStream& rIStm, bool bFileHeader) { - const sal_uInt16 nOldFormat(rIStm.GetNumberFormatInt()); + const SvStreamEndian nOldFormat(rIStm.GetEndian()); const sal_uLong nOldPos(rIStm.Tell()); sal_uLong nOffset(0UL); bool bRet(false); - rIStm.SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + rIStm.SetEndian(SvStreamEndian::LITTLE); if(bFileHeader) { @@ -1443,7 +1443,7 @@ bool ImplReadDIB( rIStm.Seek(nOldPos); } - rIStm.SetNumberFormatInt(nOldFormat); + rIStm.SetEndian(nOldFormat); return bRet; } @@ -1462,7 +1462,7 @@ bool ImplWriteDIB( { BitmapReadAccess* pAcc = const_cast< Bitmap& >(rSource).AcquireReadAccess(); BitmapReadAccess* pAccAlpha = 0; - const sal_uInt16 nOldFormat(rOStm.GetNumberFormatInt()); + const SvStreamEndian nOldFormat(rOStm.GetEndian()); const sal_uLong nOldPos(rOStm.Tell()); if(pSourceAlpha) @@ -1479,7 +1479,7 @@ bool ImplWriteDIB( } } - rOStm.SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN); + rOStm.SetEndian(SvStreamEndian::LITTLE); if(pAcc) { @@ -1509,7 +1509,7 @@ bool ImplWriteDIB( rOStm.Seek(nOldPos); } - rOStm.SetNumberFormatInt(nOldFormat); + rOStm.SetEndian(nOldFormat); } return bRet; diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 20e4c2251315..1a49cdcd6892 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -2746,10 +2746,10 @@ SvStream& ReadGDIMetaFile( SvStream& rIStm, GDIMetaFile& rGDIMetaFile ) if( !rIStm.GetError() ) { char aId[ 7 ]; - sal_uLong nStmPos = rIStm.Tell(); - sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt(); + sal_uLong nStmPos = rIStm.Tell(); + SvStreamEndian nOldFormat = rIStm.GetEndian(); - rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rIStm.SetEndian( SvStreamEndian::LITTLE ); aId[ 0 ] = 0; aId[ 6 ] = 0; @@ -2805,7 +2805,7 @@ SvStream& ReadGDIMetaFile( SvStream& rIStm, GDIMetaFile& rGDIMetaFile ) rIStm.Seek( nStmPos ); } - rIStm.SetNumberFormatInt( nOldFormat ); + rIStm.SetEndian( nOldFormat ); } else { @@ -2857,9 +2857,9 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm ) { VersionCompat* pCompat; const sal_uInt32 nStmCompressMode = rOStm.GetCompressMode(); - sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt(); + SvStreamEndian nOldFormat = rOStm.GetEndian(); - rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rOStm.SetEndian( SvStreamEndian::LITTLE ); rOStm.Write( "VCLMTF", 6 ); pCompat = new VersionCompat( rOStm, STREAM_WRITE, 1 ); @@ -2882,7 +2882,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm ) pAct = (MetaAction*)NextAction(); } - rOStm.SetNumberFormatInt( nOldFormat ); + rOStm.SetEndian( nOldFormat ); return rOStm; } diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index bb31b81b1227..2c2a7473298f 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -948,10 +948,10 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) sal_uInt32 nId; sal_Int32 nType; sal_Int32 nLen; - const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt(); + const SvStreamEndian nOldFormat = rIStm.GetEndian(); bool bRet = false; - rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rIStm.SetEndian( SvStreamEndian::LITTLE ); rIStm.ReadUInt32( nId ); // check version @@ -1069,7 +1069,7 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) else bRet = true; - rIStm.SetNumberFormatInt( nOldFormat ); + rIStm.SetEndian( nOldFormat ); return bRet; } @@ -1082,10 +1082,10 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) { const MapMode aMapMode( ImplGetPrefMapMode() ); const Size aSize( ImplGetPrefSize() ); - const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt(); + const SvStreamEndian nOldFormat = rOStm.GetEndian(); sal_uLong nDataFieldPos; - rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rOStm.SetEndian( SvStreamEndian::LITTLE ); // write correct version ( old style/new style header ) if( rOStm.GetVersion() >= SOFFICE_FILEFORMAT_50 ) @@ -1144,7 +1144,7 @@ bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) } } - rOStm.SetNumberFormatInt( nOldFormat ); + rOStm.SetEndian( nOldFormat ); } return bRet; @@ -1484,10 +1484,10 @@ SvStream& ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic ) else { BitmapEx aBmpEx; - const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt(); + const SvStreamEndian nOldFormat = rIStm.GetEndian(); rIStm.SeekRel( -4 ); - rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + rIStm.SetEndian( SvStreamEndian::LITTLE ); ReadDIBBitmapEx(aBmpEx, rIStm); if( !rIStm.GetError() ) @@ -1565,7 +1565,7 @@ SvStream& ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic ) } } - rIStm.SetNumberFormatInt( nOldFormat ); + rIStm.SetEndian( nOldFormat ); } } } @@ -1599,8 +1599,8 @@ SvStream& WriteImpGraphic( SvStream& rOStm, const ImpGraphic& rImpGraphic ) else { // own format - const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt(); - rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); + const SvStreamEndian nOldFormat = rOStm.GetEndian(); + rOStm.SetEndian( SvStreamEndian::LITTLE ); switch( rImpGraphic.ImplGetType() ) { @@ -1643,7 +1643,7 @@ SvStream& WriteImpGraphic( SvStream& rOStm, const ImpGraphic& rImpGraphic ) break; } - rOStm.SetNumberFormatInt( nOldFormat ); + rOStm.SetEndian( nOldFormat ); } } else diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 36e6803e8e71..8c30c45e2d89 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -67,7 +67,7 @@ class PNGReaderImpl { private: SvStream& mrPNGStream; - sal_uInt16 mnOrigStreamMode; + SvStreamEndian mnOrigStreamMode; std::vector< vcl::PNGReader::ChunkData > maChunkSeq; std::vector< vcl::PNGReader::ChunkData >::iterator maChunkIter; @@ -211,8 +211,8 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream ) mpScanlineAlpha(0) { // prepare the PNG data stream - mnOrigStreamMode = mrPNGStream.GetNumberFormatInt(); - mrPNGStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + mnOrigStreamMode = mrPNGStream.GetEndian(); + mrPNGStream.SetEndian( SvStreamEndian::BIG ); // prepare the chunk reader maChunkSeq.reserve( 16 ); @@ -237,7 +237,7 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream ) PNGReaderImpl::~PNGReaderImpl() { - mrPNGStream.SetNumberFormatInt( mnOrigStreamMode ); + mrPNGStream.SetEndian( mnOrigStreamMode ); if ( mbzCodecInUse ) mpZCodec.EndCompression(); diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx index c1a73cf7df6e..683f6fc887db 100644 --- a/vcl/source/gdi/pngwrite.cxx +++ b/vcl/source/gdi/pngwrite.cxx @@ -241,8 +241,8 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx, bool PNGWriterImpl::Write( SvStream& rOStm ) { /* png signature is always an array of 8 bytes */ - sal_uInt16 nOldMode = rOStm.GetNumberFormatInt(); - rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); + SvStreamEndian nOldMode = rOStm.GetEndian(); + rOStm.SetEndian( SvStreamEndian::BIG ); rOStm.WriteUInt32( 0x89504e47 ); rOStm.WriteUInt32( 0x0d0a1a0a ); @@ -265,7 +265,7 @@ bool PNGWriterImpl::Write( SvStream& rOStm ) rOStm.WriteUInt32( nCRC ); ++aBeg; } - rOStm.SetNumberFormatInt( nOldMode ); + rOStm.SetEndian( nOldMode ); return mbStatus; } -- cgit v1.2.3