diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-19 11:28:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-19 21:11:02 +0000 |
commit | 4e7fff380a0b7cec8cc4bf5b4e43a6e91c97db6a (patch) | |
tree | 771ac4783afd8066d4232e8886fb603d6367186f /svx | |
parent | bb997c001982dc36ef393fbc76ace65dd12b461d (diff) |
remove ENABLE_BYTESTRING_STREAM_OPERATORS
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/galtheme.hxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmpage.cxx | 1 | ||||
-rw-r--r-- | svx/source/gallery2/gallery1.cxx | 37 | ||||
-rw-r--r-- | svx/source/gallery2/galobj.cxx | 37 | ||||
-rw-r--r-- | svx/source/gallery2/galtheme.cxx | 27 |
5 files changed, 58 insertions, 46 deletions
diff --git a/svx/inc/svx/galtheme.hxx b/svx/inc/svx/galtheme.hxx index 2dc845d8f087..2bfdddf8ab4f 100644 --- a/svx/inc/svx/galtheme.hxx +++ b/svx/inc/svx/galtheme.hxx @@ -31,8 +31,6 @@ #include "svx/svxdllapi.h" -#define ENABLE_BYTESTRING_STREAM_OPERATORS - #include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <vcl/salctype.hxx> diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx index 75b27ed6033a..3a99d49b0cbc 100644 --- a/svx/source/form/fmpage.cxx +++ b/svx/source/form/fmpage.cxx @@ -30,7 +30,6 @@ #include "precompiled_svx.hxx" #include <sal/macros.h> -#define ENABLE_BYTESTRING_STREAM_OPERATORS #include <svx/fmpage.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XNameContainer.hpp> diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 165936cae991..50d398a43711 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -29,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#define ENABLE_BYTESTRING_STREAM_OPERATORS - #include <tools/vcompat.hxx> #include <ucbhelper/content.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -44,8 +42,6 @@ #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/ucb/XContentAccess.hpp> -#define ENABLE_BYTESTRING_STREAM_OPERATORS - // -------------- // - Namespaces - // -------------- @@ -138,13 +134,16 @@ void GalleryThemeEntry::SetId( sal_uInt32 nNewId, sal_Bool bResetThemeName ) SvStream& operator<<( SvStream& rOut, const GalleryImportThemeEntry& rEntry ) { - ByteString aDummy; + rOut.WriteByteString(ByteString(rEntry.aThemeName, RTL_TEXTENCODING_UTF8)); - rOut << ByteString( rEntry.aThemeName, RTL_TEXTENCODING_UTF8 ) << - ByteString( rEntry.aUIName, RTL_TEXTENCODING_UTF8 ) << - ByteString( String(rEntry.aURL.GetMainURL( INetURLObject::NO_DECODE )), RTL_TEXTENCODING_UTF8 ) << - ByteString( rEntry.aImportName, RTL_TEXTENCODING_UTF8 ) << - aDummy; + rOut.WriteByteString(ByteString(rEntry.aUIName, RTL_TEXTENCODING_UTF8)); + + rOut.WriteByteString(ByteString(String(rEntry.aURL.GetMainURL( INetURLObject::NO_DECODE )), RTL_TEXTENCODING_UTF8)); + + rOut.WriteByteString(ByteString(rEntry.aImportName, RTL_TEXTENCODING_UTF8)); + + ByteString aDummy; + rOut.WriteByteString(aDummy); return rOut; } @@ -155,11 +154,19 @@ SvStream& operator>>( SvStream& rIn, GalleryImportThemeEntry& rEntry ) { ByteString aTmpStr; - rIn >> aTmpStr; rEntry.aThemeName = String( aTmpStr, RTL_TEXTENCODING_UTF8 ); - rIn >> aTmpStr; rEntry.aUIName = String( aTmpStr, RTL_TEXTENCODING_UTF8 ); - rIn >> aTmpStr; rEntry.aURL = INetURLObject( String( aTmpStr, RTL_TEXTENCODING_UTF8 ) ); - rIn >> aTmpStr; rEntry.aImportName = String( aTmpStr, RTL_TEXTENCODING_UTF8 ); - rIn >> aTmpStr; + rIn.ReadByteString(aTmpStr); + rEntry.aThemeName = String( aTmpStr, RTL_TEXTENCODING_UTF8 ); + + rIn.ReadByteString(aTmpStr); + rEntry.aUIName = String( aTmpStr, RTL_TEXTENCODING_UTF8 ); + + rIn.ReadByteString(aTmpStr); + rEntry.aURL = INetURLObject( String( aTmpStr, RTL_TEXTENCODING_UTF8 ) ); + + rIn.ReadByteString(aTmpStr); + rEntry.aImportName = String( aTmpStr, RTL_TEXTENCODING_UTF8 ); + + rIn.ReadByteString(aTmpStr); return rIn; } diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 928e060e338e..2ec60838a962 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -29,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#define ENABLE_BYTESTRING_STREAM_OPERATORS - #include <com/sun/star/lang/XUnoTunnel.hpp> #include <sfx2/objsh.hxx> #include <sfx2/docfac.hxx> @@ -172,14 +170,13 @@ void SgaObject::WriteData( SvStream& rOut, const String& rDestDir ) const String aURLWithoutDestDir = String(aURL.GetMainURL( INetURLObject::NO_DECODE )); aURLWithoutDestDir.SearchAndReplace(rDestDir, String()); - rOut << ByteString( aURLWithoutDestDir, RTL_TEXTENCODING_UTF8 ); + rOut.WriteByteString(ByteString(aURLWithoutDestDir, RTL_TEXTENCODING_UTF8)); } // ------------------------------------------------------------------------ void SgaObject::ReadData(SvStream& rIn, sal_uInt16& rReadVersion ) { - ByteString aTmpStr; sal_uInt32 nTmp32; sal_uInt16 nTmp16; @@ -190,7 +187,9 @@ void SgaObject::ReadData(SvStream& rIn, sal_uInt16& rReadVersion ) else rIn >> aThumbMtf; - rIn >> aTmpStr; aURL = INetURLObject( String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 ) ); + ByteString aTmpStr; + rIn.ReadByteString(aTmpStr); + aURL = INetURLObject(rtl::OStringToOUString(aTmpStr,RTL_TEXTENCODING_UTF8)); } // ------------------------------------------------------------------------ @@ -293,28 +292,29 @@ void SgaObjectBmp::Init( const Graphic& rGraphic, const INetURLObject& rURL ) void SgaObjectBmp::WriteData( SvStream& rOut, const String& rDestDir ) const { - String aDummyStr; - char aDummy[ 10 ]; - // Version setzen SgaObject::WriteData( rOut, rDestDir ); + char aDummy[ 10 ]; rOut.Write( aDummy, 10 ); - rOut << ByteString( aDummyStr, RTL_TEXTENCODING_UTF8 ) << ByteString( aTitle, RTL_TEXTENCODING_UTF8 ); + String aDummyStr; + rOut.WriteByteString(rtl::OUStringToOString(aDummyStr, RTL_TEXTENCODING_UTF8)); + rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8)); } // ------------------------------------------------------------------------ void SgaObjectBmp::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) { - ByteString aTmpStr; SgaObject::ReadData( rIn, rReadVersion ); rIn.SeekRel( 10 ); // 16, 16, 32, 16 - rIn >> aTmpStr; // dummy + ByteString aTmpStr; + rIn.ReadByteString(aTmpStr); // dummy if( rReadVersion >= 5 ) { - rIn >> aTmpStr; aTitle = String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 ); + rIn.ReadByteString(aTmpStr); + aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); } } @@ -381,7 +381,8 @@ Bitmap SgaObjectSound::GetThumbBmp() const void SgaObjectSound::WriteData( SvStream& rOut, const String& rDestDir ) const { SgaObject::WriteData( rOut, rDestDir ); - rOut << (sal_uInt16) eSoundType << ByteString( aTitle, RTL_TEXTENCODING_UTF8 ); + rOut << (sal_uInt16) eSoundType; + rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8)); } // ------------------------------------------------------------------------ @@ -392,14 +393,15 @@ void SgaObjectSound::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) if( rReadVersion >= 5 ) { - ByteString aTmpStr; sal_uInt16 nTmp16; rIn >> nTmp16; eSoundType = (GalSoundType) nTmp16; if( rReadVersion >= 6 ) { - rIn >> aTmpStr; aTitle = String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 ); + ByteString aTmpStr; + rIn.ReadByteString(aTmpStr); + aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); } } } @@ -591,7 +593,7 @@ sal_Bool SgaObjectSvDraw::DrawCentered( OutputDevice* pOut, const FmFormModel& r void SgaObjectSvDraw::WriteData( SvStream& rOut, const String& rDestDir ) const { SgaObject::WriteData( rOut, rDestDir ); - rOut << ByteString( aTitle, RTL_TEXTENCODING_UTF8 ); + rOut.WriteByteString(rtl::OUStringToOString(aTitle, RTL_TEXTENCODING_UTF8)); } // ------------------------------------------------------------------------ @@ -603,7 +605,8 @@ void SgaObjectSvDraw::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) if( rReadVersion >= 5 ) { ByteString aTmpStr; - rIn >> aTmpStr; aTitle = String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 ); + rIn.ReadByteString(aTmpStr); + aTitle = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); } } diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 2926a812846e..791a2a907c09 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -29,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#define ENABLE_BYTESTRING_STREAM_OPERATORS - #include <tools/urlobj.hxx> #include <tools/vcompat.hxx> #include <unotools/streamwrap.hxx> @@ -736,9 +734,10 @@ GalleryThemeEntry* GalleryTheme::CreateThemeEntry( const INetURLObject& rURL, sa if( nVersion <= 0x00ff ) { sal_uInt32 nThemeId = 0; - ByteString aTmpStr; - *pIStm >> aTmpStr; aThemeName = String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 ); + ByteString aTmpStr; + pIStm->ReadByteString(aTmpStr); + aThemeName = rtl::OStringToOUString(aTmpStr, RTL_TEXTENCODING_UTF8); // Charakterkonvertierung durchfuehren if( nVersion >= 0x0004 ) @@ -1363,7 +1362,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const sal_Bool bRel; rOStm << (sal_uInt16) 0x0004; - rOStm << ByteString( GetRealName(), RTL_TEXTENCODING_UTF8 ); + rOStm.WriteByteString(rtl::OUStringToOString(GetRealName(), RTL_TEXTENCODING_UTF8)); rOStm << nCount << (sal_uInt16) gsl_getSystemTextEncoding(); for( sal_uInt32 i = 0; i < nCount; i++ ) @@ -1402,7 +1401,9 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const } aPath.SearchAndReplace(m_aDestDir, String()); - rOStm << bRel << ByteString( aPath, RTL_TEXTENCODING_UTF8 ) << pObj->nOffset << (sal_uInt16) pObj->eObjKind; + rOStm << bRel; + rOStm.WriteByteString(rtl::OUStringToOString(aPath, RTL_TEXTENCODING_UTF8)); + rOStm << pObj->nOffset << (sal_uInt16) pObj->eObjKind; } // neuerdings wird ein 512-Byte-Reservepuffer gechrieben; @@ -1436,12 +1437,14 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) { sal_uInt32 nCount; sal_uInt16 nVersion; - ByteString aTmpStr; String aThemeName; rtl_TextEncoding nTextEncoding; aImportName = String(); - rIStm >> nVersion >> aTmpStr >> nCount; + rIStm >> nVersion; + ByteString aTmpStr; + rIStm.ReadByteString(aTmpStr); + rIStm >> nCount; if( nVersion >= 0x0004 ) { @@ -1452,7 +1455,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) else nTextEncoding = RTL_TEXTENCODING_UTF8; - aThemeName = String( aTmpStr.GetBuffer(), nTextEncoding ); + aThemeName = rtl::OStringToOUString(aTmpStr, nTextEncoding); if( nCount <= ( 1L << 14 ) ) { @@ -1480,10 +1483,12 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) String aPath; sal_uInt16 nTemp; - rIStm >> bRel >> aTempFileName >> pObj->nOffset; + rIStm >> bRel; + rIStm.ReadByteString(aTempFileName); + rIStm >> pObj->nOffset; rIStm >> nTemp; pObj->eObjKind = (SgaObjKind) nTemp; - aFileName = String( aTempFileName.GetBuffer(), gsl_getSystemTextEncoding() ); + aFileName = rtl::OStringToOUString(aTempFileName, gsl_getSystemTextEncoding()); if( bRel ) { |