remove ENABLE_BYTESTRING_STREAM_OPERATORS

This commit is contained in:
Caolán McNamara
2011-11-19 11:28:50 +00:00
parent bb997c0019
commit 4e7fff380a
10 changed files with 64 additions and 64 deletions

View File

@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_automation.hxx"
#define ENABLE_BYTESTRING_STREAM_OPERATORS
#include <tools/solar.h>
#include <automation/simplecm.hxx>
#include <osl/diagnose.h>
@@ -286,7 +284,7 @@ void SimpleCommunicationLinkViaSocket::SetApplication( const ByteString& aApp )
{
CommunicationLink::SetApplication( aApp );
SvStream* pData = GetBestCommunicationStream();
*pData << aApp;
pData->WriteByteString(aApp);
SendHandshake( CH_SetApplication, pData );
delete pData;
}
@@ -458,7 +456,7 @@ void CommunicationManager::CallDataReceived( CommunicationLink* pCL )
case CH_SetApplication:
{
ByteString aApplication;
*pData >> aApplication;
pData->ReadByteString(aApplication);
pCL->CommunicationLink::SetApplication( aApplication );
#if OSL_DEBUG_LEVEL > 1
debug_printf( "Setting Application to " );

View File

@@ -33,9 +33,8 @@
#include <expat.h>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include "tools/string.hxx"
#define ENABLE_BYTESTRING_STREAM_OPERATORS
#include "tools/stream.hxx"
#include <tools/string.hxx>
#include <tools/stream.hxx>
#include "export.hxx"
#include "xmlutil.hxx"

View File

@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
#define ENABLE_BYTESTRING_STREAM_OPERATORS
#include <algorithm>
#include <tools/vcompat.hxx>
@@ -1139,7 +1137,7 @@ SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj )
if( bLink )
{
rIStm >> aLink;
rIStm.ReadByteString(aLink);
rGraphicObj.SetLink( UniString( aLink, RTL_TEXTENCODING_UTF8 ) );
}
else
@@ -1158,7 +1156,7 @@ SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj )
rOStm << rGraphicObj.GetGraphic() << rGraphicObj.GetAttr() << bLink;
if( bLink )
rOStm << rtl::OUStringToOString(rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8);
rOStm.WriteByteString(rtl::OUStringToOString(rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8));
return rOStm;
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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;
}

View File

@@ -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);
}
}

View File

@@ -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 )
{

View File

@@ -346,9 +346,6 @@ public:
SvStream& operator>>( unsigned char& rChar );
SvStream& operator>>( float& rFloat );
SvStream& operator>>( double& rDouble );
#ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
SvStream& operator>>( ByteString& rString ) { return ReadByteString(rString); }
#endif
#ifdef ENABLE_STRING_STREAM_OPERATORS
SvStream& operator>>( UniString& rString ) { return ReadByteString(rString); }
#endif
@@ -367,9 +364,6 @@ public:
SvStream& operator<<( const double& rDouble );
SvStream& operator<<( const char* pBuf );
SvStream& operator<<( const unsigned char* pBuf );
#ifdef ENABLE_BYTESTRING_STREAM_OPERATORS
SvStream& operator<<( const ByteString& rString ) { return WriteByteString( rString ); }
#endif
#ifdef ENABLE_STRING_STREAM_OPERATORS
SvStream& operator<<( const UniString& rString ) { return WriteByteString(rString); }
#endif

View File

@@ -52,7 +52,6 @@ c >>= 4; \
c |= nSwapTmp;
#include <tools/debug.hxx>
#define ENABLE_BYTESTRING_STREAM_OPERATORS
#include <tools/stream.hxx>
#include <osl/thread.h>
#include <algorithm>