summaryrefslogtreecommitdiff
path: root/include/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-01-05 08:47:31 +0200
committerNoel Grandin <noel@peralex.com>2015-01-05 12:57:18 +0200
commit8130714148d58dd2bf1ef12dcc6dd6d5838be0d1 (patch)
treebf8cf91d9837b9d03e1e3e336be7eb35667d4de9 /include/tools
parent54942f0d093e42b06c7a6c10e93d632bfe0c6519 (diff)
fdo#84938: replace NUMBERFORMAT_INT_ constants with 'enum class'
Change-Id: I9c67de31f5571b282adc132d973b79bccb35fdc9
Diffstat (limited to 'include/tools')
-rw-r--r--include/tools/stream.hxx20
1 files changed, 4 insertions, 16 deletions
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 );