diff options
Diffstat (limited to 'vcl/source/gdi/gfxlink.cxx')
-rw-r--r-- | vcl/source/gdi/gfxlink.cxx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 3a5b48ad2a0d..8f9dd042e605 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,11 +46,11 @@ // ----------- GfxLink::GfxLink() : - meType ( GFX_LINK_TYPE_NONE ), - mpBuf ( NULL ), - mpSwap ( NULL ), - mnBufSize ( 0 ), - mnUserId ( 0UL ), + meType ( GFX_LINK_TYPE_NONE ), + mpBuf ( NULL ), + mpSwap ( NULL ), + mnBufSize ( 0 ), + mnUserId ( 0UL ), mpImpData ( new ImpGfxLink ) { } @@ -83,7 +83,7 @@ GfxLink::GfxLink( BYTE* pBuf, sal_uInt32 nSize, GfxLinkType nType, BOOL bOwns ) mpBuf = new ImpBuffer( nSize ); memcpy( mpBuf->mpBuffer, pBuf, nSize ); } - else + else mpBuf = NULL; } @@ -132,7 +132,7 @@ sal_Bool GfxLink::IsEqual( const GfxLink& rGfxLink ) const sal_uInt32 nDestSize = rGfxLink.GetDataSize(); if ( pSource && pDest && ( nSourceSize == nDestSize ) ) { - bIsEqual = memcmp( pSource, pDest, nSourceSize ) == 0; + bIsEqual = memcmp( pSource, pDest, nSourceSize ) == 0; } else if ( ( pSource == 0 ) && ( pDest == 0 ) ) bIsEqual = sal_True; @@ -191,7 +191,7 @@ const BYTE* GfxLink::GetData() const // ------------------------------------------------------------------------ -const Size& GfxLink::GetPrefSize() const +const Size& GfxLink::GetPrefSize() const { return mpImpData->maPrefSize; } @@ -245,8 +245,8 @@ BOOL GfxLink::LoadNative( Graphic& rGraphic ) if( pData ) { - SvMemoryStream aMemStm; - ULONG nCvtType; + SvMemoryStream aMemStm; + ULONG nCvtType; aMemStm.SetBuffer( (char*) pData, mnBufSize, FALSE, mnBufSize ); @@ -259,7 +259,7 @@ BOOL GfxLink::LoadNative( Graphic& rGraphic ) case( GFX_LINK_TYPE_NATIVE_WMF ): nCvtType = CVT_WMF; break; case( GFX_LINK_TYPE_NATIVE_MET ): nCvtType = CVT_MET; break; case( GFX_LINK_TYPE_NATIVE_PCT ): nCvtType = CVT_PCT; break; - + default: nCvtType = CVT_UNKNOWN; break; } @@ -301,7 +301,7 @@ void GfxLink::SwapIn() if( IsSwappedOut() ) { mpBuf = new ImpBuffer( mpSwap->GetData() ); - + if( !( --mpSwap->mnRefCount ) ) delete mpSwap; @@ -329,15 +329,15 @@ BOOL GfxLink::ExportNative( SvStream& rOStream ) const SvStream& operator<<( SvStream& rOStream, const GfxLink& rGfxLink ) { VersionCompat* pCompat = new VersionCompat( rOStream, STREAM_WRITE, 2 ); - + // Version 1 rOStream << (UINT16) rGfxLink.GetType() << rGfxLink.GetDataSize() << rGfxLink.GetUserId(); - + // Version 2 - rOStream << rGfxLink.GetPrefSize() << rGfxLink.GetPrefMapMode(); - + rOStream << rGfxLink.GetPrefSize() << rGfxLink.GetPrefMapMode(); + delete pCompat; - + if( rGfxLink.GetDataSize() ) { if( rGfxLink.IsSwappedOut() ) @@ -355,12 +355,12 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink) { Size aSize; MapMode aMapMode; - sal_uInt32 nSize; - sal_uInt32 nUserId; - UINT16 nType; - BYTE* pBuf; - bool bMapAndSizeValid( false ); - VersionCompat* pCompat = new VersionCompat( rIStream, STREAM_READ ); + sal_uInt32 nSize; + sal_uInt32 nUserId; + UINT16 nType; + BYTE* pBuf; + bool bMapAndSizeValid( false ); + VersionCompat* pCompat = new VersionCompat( rIStream, STREAM_READ ); // Version 1 rIStream >> nType >> nSize >> nUserId; @@ -370,12 +370,12 @@ SvStream& operator>>( SvStream& rIStream, GfxLink& rGfxLink) rIStream >> aSize >> aMapMode; bMapAndSizeValid = true; } - + delete pCompat; pBuf = new BYTE[ nSize ]; rIStream.Read( pBuf, nSize ); - + rGfxLink = GfxLink( pBuf, nSize, (GfxLinkType) nType, TRUE ); rGfxLink.SetUserId( nUserId ); |