You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/01/10 18:28:42 UTC

svn commit: r1431512 [2/2] - in /openoffice/trunk/main: automation/source/server/ avmedia/source/win/ basic/source/runtime/ canvas/source/vcl/ chart2/source/controller/main/ drawinglayer/source/processor2d/ drawinglayer/source/tools/ dtrans/source/win3...

Modified: openoffice/trunk/main/svtools/source/misc/transfer.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svtools/source/misc/transfer.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/svtools/source/misc/transfer.cxx (original)
+++ openoffice/trunk/main/svtools/source/misc/transfer.cxx Thu Jan 10 17:28:40 2013
@@ -19,8 +19,6 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_svtools.hxx"
 #ifdef WNT
@@ -68,6 +66,9 @@
 #include <svtools/imap.hxx>
 #include <svtools/transfer.hxx>
 #include <cstdio>
+#include <vcl/dibtools.hxx>
+#include <vcl/pngread.hxx>
+#include <vcl/pngwrite.hxx>
 
 // --------------
 // - Namespaces -
@@ -370,9 +371,9 @@ Any SAL_CALL TransferableHelper::getTran
 			    GetData( aSubstFlavor );
                 bDone = maAny.hasValue();
             }
-            else if( SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_BMP, aSubstFlavor ) &&
-                     TransferableDataHelper::IsEqual( aSubstFlavor, rFlavor ) &&
-                     SotExchange::GetFormatDataFlavor( FORMAT_BITMAP, aSubstFlavor ) )
+            else if(SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_BMP, aSubstFlavor ) 
+                && TransferableDataHelper::IsEqual( aSubstFlavor, rFlavor )
+                && SotExchange::GetFormatDataFlavor(FORMAT_BITMAP, aSubstFlavor))
             {
 			    GetData( aSubstFlavor );
                 bDone = sal_True;
@@ -698,6 +699,7 @@ void TransferableHelper::AddFormat( cons
 		if( FORMAT_BITMAP == aFlavorEx.mnSotId )
 		{
 			AddFormat( SOT_FORMATSTR_ID_BMP );
+			AddFormat( SOT_FORMATSTR_ID_PNG );
 		}
 		else if( FORMAT_GDIMETAFILE == aFlavorEx.mnSotId )
 		{
@@ -798,14 +800,38 @@ sal_Bool TransferableHelper::SetString( 
 
 // -----------------------------------------------------------------------------
 
-sal_Bool TransferableHelper::SetBitmap( const Bitmap& rBitmap, const DataFlavor& )
+sal_Bool TransferableHelper::SetBitmapEx( const BitmapEx& rBitmapEx, const DataFlavor& rFlavor )
 {
-	if( !rBitmap.IsEmpty() )
+	if( !rBitmapEx.IsEmpty() )
 	{
-		SvMemoryStream aMemStm( 65535, 65535 );
+        SvMemoryStream aMemStm( 65535, 65535 );
 
-		aMemStm << rBitmap;
-		maAny <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) );
+        if(rFlavor.MimeType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("image/png")))
+        {
+            // write a PNG
+            ::vcl::PNGWriter aPNGWriter(rBitmapEx);
+
+            aPNGWriter.Write(aMemStm);
+        }
+        else
+        {
+            const Bitmap aBitmap(rBitmapEx.GetBitmap());
+
+            if(rBitmapEx.IsTransparent())
+            {
+                const Bitmap aMask(rBitmapEx.GetAlpha().GetBitmap());
+
+                // explicitely use Bitmap::Write with bCompressed = sal_False and bFileHeader = sal_True
+                WriteDIBV5(aBitmap, aMask, aMemStm);
+            }
+            else
+            {
+                // explicitely use Bitmap::Write with bCompressed = sal_False and bFileHeader = sal_True
+                WriteDIB(aBitmap, aMemStm, false, true);
+            }
+        }
+
+        maAny <<= Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aMemStm.GetData() ), aMemStm.Seek( STREAM_SEEK_TO_END ) );
 	}
 
 	return( maAny.hasValue() );
@@ -1441,7 +1467,7 @@ void TransferableDataHelper::FillDataFla
 		    rDataFlavorExVector.push_back( aFlavorEx );
 
             // add additional formats for special mime types
-            if( SOT_FORMATSTR_ID_BMP == aFlavorEx.mnSotId )
+            if(SOT_FORMATSTR_ID_BMP == aFlavorEx.mnSotId || SOT_FORMATSTR_ID_PNG == aFlavorEx.mnSotId)
 		    {
 			    if( SotExchange::GetFormatDataFlavor( SOT_FORMAT_BITMAP, aFlavorEx ) )
 			    {
@@ -1755,57 +1781,101 @@ sal_Bool TransferableDataHelper::GetStri
 
 // -----------------------------------------------------------------------------
 
-sal_Bool TransferableDataHelper::GetBitmap( SotFormatStringId nFormat, Bitmap& rBmp )
+sal_Bool TransferableDataHelper::GetBitmapEx( SotFormatStringId nFormat, BitmapEx& rBmpEx )
 {
-	DataFlavor aFlavor;
-	return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetBitmap( aFlavor, rBmp ) );
+    if(FORMAT_BITMAP == nFormat)
+    {
+        // try to get PNG first
+        DataFlavor aFlavor;
+
+        if(SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_PNG, aFlavor))
+        {
+            if(GetBitmapEx(aFlavor, rBmpEx))
+            {
+                return true;
+            }
+        }
+    }
+
+    DataFlavor aFlavor;
+    return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetBitmapEx( aFlavor, rBmpEx ) );
 }
 
 // -----------------------------------------------------------------------------
 
-sal_Bool TransferableDataHelper::GetBitmap( const DataFlavor& rFlavor, Bitmap& rBmp )
+sal_Bool TransferableDataHelper::GetBitmapEx( const DataFlavor& rFlavor, BitmapEx& rBmpEx )
 {
-	SotStorageStreamRef xStm;
-	DataFlavor			aSubstFlavor;
-	sal_Bool			bRet = GetSotStorageStream( rFlavor, xStm );
+    SotStorageStreamRef xStm;
+    DataFlavor aSubstFlavor;
+    bool bRet(GetSotStorageStream(rFlavor, xStm));
 
-	if( bRet )
-	{
-		*xStm >> rBmp;
-		bRet = ( xStm->GetError() == ERRCODE_NONE );
+    if(!bRet && HasFormat(SOT_FORMATSTR_ID_PNG) && SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_PNG, aSubstFlavor))
+    {
+        // when no direct success, try if PNG is available
+        bRet = GetSotStorageStream(aSubstFlavor, xStm);
+    }
 
-		/* SJ: #110748# At the moment we are having problems with DDB inserted as DIB. The
-		   problem is, that some graphics are inserted much too big because the nXPelsPerMeter
-		   and nYPelsPerMeter of the bitmap fileheader isn't including the correct value.
-		   Due to this reason the following code assumes that bitmaps with a logical size
-		   greater than 50 cm aren't having the correct mapmode set.
-
-		   The following code should be removed if DDBs and DIBs are supported via clipboard
-		   properly.
-		*/
-		if ( bRet )
-		{
-			MapMode aMapMode = rBmp.GetPrefMapMode();
-			if ( aMapMode.GetMapUnit() != MAP_PIXEL )
-			{
-				Size aSize = OutputDevice::LogicToLogic( rBmp.GetPrefSize(), aMapMode, MAP_100TH_MM );
-				if ( ( aSize.Width() > 5000 ) || ( aSize.Height() > 5000 ) )
-					rBmp.SetPrefMapMode( MAP_PIXEL );
-			}
-		}
-	}
+    if(!bRet && HasFormat(SOT_FORMATSTR_ID_BMP) && SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_BMP, aSubstFlavor))
+    {
+        // when no direct success, try if BMP is available
+        bRet = GetSotStorageStream(aSubstFlavor, xStm);
+    }
 
-	if( !bRet &&
-		HasFormat( SOT_FORMATSTR_ID_BMP ) &&
-		SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_BMP, aSubstFlavor ) &&
-		GetSotStorageStream( aSubstFlavor, xStm ) )
-	{
-	    xStm->ResetError();
-		*xStm >> rBmp;
-		bRet = ( xStm->GetError() == ERRCODE_NONE );
-	}
+    if(bRet)
+    {
+        if(rFlavor.MimeType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("image/png")))
+        {
+            // it's a PNG, import to BitmapEx
+            ::vcl::PNGReader aPNGReader(*xStm);
 
-	return bRet;
+            rBmpEx = aPNGReader.Read();
+        }
+        else
+        {
+            Bitmap aBitmap;
+            Bitmap aMask;
+
+            // explicitely use Bitmap::Read with bFileHeader = sal_True
+            ReadDIBV5(aBitmap, aMask, *xStm);
+
+            if(aMask.IsEmpty())
+            {
+                rBmpEx = aBitmap;
+            }
+            else
+            {
+                rBmpEx = BitmapEx(aBitmap, aMask);
+            }
+        }
+
+        bRet = (ERRCODE_NONE == xStm->GetError());
+
+        /* SJ: #110748# At the moment we are having problems with DDB inserted as DIB. The
+           problem is, that some graphics are inserted much too big because the nXPelsPerMeter
+           and nYPelsPerMeter of the bitmap fileheader isn't including the correct value.
+           Due to this reason the following code assumes that bitmaps with a logical size
+           greater than 50 cm aren't having the correct mapmode set.
+        
+           The following code should be removed if DDBs and DIBs are supported via clipboard
+           properly.
+        */
+        if(bRet)
+        {
+            const MapMode aMapMode(rBmpEx.GetPrefMapMode());
+
+            if(MAP_PIXEL != aMapMode.GetMapUnit())
+            {
+                const Size aSize(OutputDevice::LogicToLogic(rBmpEx.GetPrefSize(), aMapMode, MAP_100TH_MM));
+
+                if((aSize.Width() > 5000) || (aSize.Height() > 5000))
+                {
+                    rBmpEx.SetPrefMapMode(MAP_PIXEL);
+                }
+            }
+        }
+    }
+
+    return bRet;
 }
 
 // -----------------------------------------------------------------------------
@@ -1865,8 +1935,22 @@ sal_Bool TransferableDataHelper::GetGDIM
 
 sal_Bool TransferableDataHelper::GetGraphic( SotFormatStringId nFormat, Graphic& rGraphic )
 {
-	DataFlavor aFlavor;
-	return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetGraphic( aFlavor, rGraphic ) );
+    if(FORMAT_BITMAP == nFormat)
+    {
+        // try to get PNG first
+        DataFlavor aFlavor;
+
+        if(SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_PNG, aFlavor))
+        {
+            if(GetGraphic(aFlavor, rGraphic))
+            {
+                return true;
+            }
+        }
+    }
+
+    DataFlavor aFlavor;
+    return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetGraphic( aFlavor, rGraphic ) );
 }
 
 // -----------------------------------------------------------------------------
@@ -1876,13 +1960,22 @@ sal_Bool TransferableDataHelper::GetGrap
 	DataFlavor	aFlavor;
 	sal_Bool	bRet = sal_False;
 
-	if(	SotExchange::GetFormatDataFlavor( SOT_FORMAT_BITMAP, aFlavor ) &&
+    if(SotExchange::GetFormatDataFlavor(SOT_FORMATSTR_ID_PNG, aFlavor) && 
+        TransferableDataHelper::IsEqual(aFlavor, rFlavor))
+	{
+        // try to get PNG first
+		BitmapEx aBmpEx;
+
+		if( ( bRet = GetBitmapEx( aFlavor, aBmpEx ) ) == sal_True )
+			rGraphic = aBmpEx;
+	}
+	else if(SotExchange::GetFormatDataFlavor( SOT_FORMAT_BITMAP, aFlavor ) &&
 		TransferableDataHelper::IsEqual( aFlavor, rFlavor ) )
 	{
-		Bitmap aBmp;
+		BitmapEx aBmpEx;
 
-		if( ( bRet = GetBitmap( aFlavor, aBmp ) ) == sal_True )
-			rGraphic = aBmp;
+		if( ( bRet = GetBitmapEx( aFlavor, aBmpEx ) ) == sal_True )
+			rGraphic = aBmpEx;
 	}
 	else if( SotExchange::GetFormatDataFlavor( SOT_FORMAT_GDIMETAFILE, aFlavor ) &&
 			 TransferableDataHelper::IsEqual( aFlavor, rFlavor ) )

Modified: openoffice/trunk/main/svx/inc/svx/xoutbmp.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/inc/svx/xoutbmp.hxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/svx/inc/svx/xoutbmp.hxx (original)
+++ openoffice/trunk/main/svx/inc/svx/xoutbmp.hxx Thu Jan 10 17:28:40 2013
@@ -61,19 +61,11 @@ public:
 
 	static GraphicFilter* pGrfFilter;
 
-	static BitmapEx		CreateQuickDrawBitmapEx( const Graphic& rGraphic, const OutputDevice& rCompDev,
-												 const MapMode& rMapMode, const Size& rLogSize,
-												 const Point& rPoint, const Size& rSize );
 	static Graphic		MirrorGraphic( const Graphic& rGraphic, const sal_uIntPtr nMirrorFlags );
 	static Animation	MirrorAnimation( const Animation& rAnimation, sal_Bool bHMirr, sal_Bool bVMirr );
 	static sal_uInt16		WriteGraphic( const Graphic& rGraphic, String& rFileName,
 									  const String& rFilterName, const sal_uIntPtr nFlags = 0L,
 									  const Size* pMtfSize_100TH_MM = NULL );
-	static void			DrawQuickDrawBitmapEx( OutputDevice* pOutDev, const Point& rPt,
-											   const Size& rSize, const BitmapEx& rBmpEx );
-	static void			DrawTiledBitmapEx( OutputDevice* pOutDev, const Point& rStartPt, const Size& rGrfSize,
-										   const Rectangle& rTileRect, const BitmapEx& rBmpEx );
-
 	static sal_uInt16		ExportGraphic( const Graphic& rGraphic, const INetURLObject& rURL,
 									   GraphicFilter& rFilter, const sal_uInt16 nFormat,
 									   const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData = NULL );

Modified: openoffice/trunk/main/svx/source/gallery2/galmisc.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/gallery2/galmisc.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/gallery2/galmisc.cxx (original)
+++ openoffice/trunk/main/svx/source/gallery2/galmisc.cxx Thu Jan 10 17:28:40 2013
@@ -606,7 +606,7 @@ sal_Bool GalleryTransferable::GetData( c
 	}
 	else if( ( FORMAT_BITMAP == nFormat ) && mpGraphicObject )
 	{
-		bRet = SetBitmap( mpGraphicObject->GetGraphic().GetBitmap(), rFlavor );
+		bRet = SetBitmapEx( mpGraphicObject->GetGraphic().GetBitmapEx(), rFlavor );
 	}
 
 	return bRet;

Modified: openoffice/trunk/main/svx/source/gallery2/galobj.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/gallery2/galobj.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/gallery2/galobj.cxx (original)
+++ openoffice/trunk/main/svx/source/gallery2/galobj.cxx Thu Jan 10 17:28:40 2013
@@ -29,10 +29,8 @@
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <sfx2/objsh.hxx>
 #include <sfx2/docfac.hxx>
-
 #include <comphelper/classids.hxx>
 #include <unotools/pathoptions.hxx>
-
 #include <tools/rcid.h>
 #include <tools/vcompat.hxx>
 #include <vcl/virdev.hxx>
@@ -45,7 +43,7 @@
 #include "galobj.hxx"
 #include <vcl/salbtype.hxx>		// FRound
 #include <vcl/svapp.hxx>
-
+#include <vcl/dibtools.hxx>
 #include "gallerydrawmodel.hxx"
 
 using namespace ::com::sun::star;
@@ -160,7 +158,7 @@ void SgaObject::WriteData( SvStream& rOu
 		rOut.SetCompressMode( COMPRESSMODE_ZBITMAP );
 		rOut.SetVersion( SOFFICE_FILEFORMAT_50 );
 
-		rOut << aThumbBmp;
+        WriteDIBBitmapEx(aThumbBmp, rOut);
 
 		rOut.SetVersion( nOldVersion );
 		rOut.SetCompressMode( nOldCompressMode );
@@ -184,9 +182,13 @@ void SgaObject::ReadData(SvStream& rIn, 
 	rIn >> nTmp32 >> nTmp16 >> rReadVersion >> nTmp16 >> bIsThumbBmp;
 
 	if( bIsThumbBmp )
-		rIn >> aThumbBmp;
+    {
+        ReadDIBBitmapEx(aThumbBmp, rIn);
+    }
 	else
+    {
 		rIn >> aThumbMtf;
+    }
 
 	rIn >> aTmpStr; aURL = INetURLObject( String( aTmpStr.GetBuffer(), RTL_TEXTENCODING_UTF8 ) );
 }

Modified: openoffice/trunk/main/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sdr/overlay/overlaymanagerbuffered.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sdr/overlay/overlaymanagerbuffered.cxx (original)
+++ openoffice/trunk/main/svx/source/sdr/overlay/overlaymanagerbuffered.cxx Thu Jan 10 17:28:40 2013
@@ -19,8 +19,6 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_svx.hxx"
 #include <svx/sdr/overlay/overlaymanagerbuffered.hxx>
@@ -33,6 +31,7 @@
 #include <tools/stream.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <vcl/cursor.hxx>
+#include <vcl/dibtools.hxx>
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -253,7 +252,7 @@ namespace sdr
                 {
                     const Bitmap aBitmap(maBufferDevice.GetBitmap(aTopLeft, aSize));
                     SvFileStream aNew((const String&)String(ByteString( "c:\\test.bmp" ), RTL_TEXTENCODING_UTF8), STREAM_WRITE|STREAM_TRUNC);
-                    aNew << aBitmap;
+                    WriteDIB(aBitmap, aNew, false, true);
                 }
 #endif
             }

Modified: openoffice/trunk/main/svx/source/xoutdev/_xoutbmp.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/xoutdev/_xoutbmp.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/xoutdev/_xoutbmp.cxx (original)
+++ openoffice/trunk/main/svx/source/xoutdev/_xoutbmp.cxx Thu Jan 10 17:28:40 2013
@@ -19,8 +19,6 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_svx.hxx"
 
@@ -37,6 +35,7 @@
 #include "svx/xoutbmp.hxx"
 #include <svtools/FilterConfigItem.hxx>
 #include <svtools/filter.hxx>
+#include <vcl/dibtools.hxx>
 
 // -----------
 // - Defines -
@@ -53,186 +52,6 @@
 
 GraphicFilter* XOutBitmap::pGrfFilter = NULL;
 
-// -----------------------------------------------------------------------------
-
-BitmapEx XOutBitmap::CreateQuickDrawBitmapEx( const Graphic& rGraphic, const OutputDevice& rCompDev,
-											  const MapMode& rMapMode, const Size& rLogSize,
-											  const Point& rPoint, const Size& rSize )
-{
-	BitmapEx aRetBmp;
-
-	if( rGraphic.IsAlpha() )
-		aRetBmp = rGraphic.GetBitmapEx();
-	else
-	{
-		VirtualDevice	aVDev( rCompDev );
-		MapMode			aMap( rMapMode );
-
-		aMap.SetOrigin( Point() );
-		aVDev.SetMapMode( aMap );
-
-		Point	aPoint( aVDev.LogicToPixel( rPoint ) );
-		Size	aOldSize( aVDev.LogicToPixel( rSize ) );
-		Size	aAbsSize( aOldSize );
-		Size	aQSizePix( aVDev.LogicToPixel( rLogSize ) );
-
-		aVDev.SetMapMode( MapMode() );
-
-		if( aOldSize.Width() < 0 )
-			aAbsSize.Width() = -aAbsSize.Width();
-
-		if( aOldSize.Height() < 0 )
-			aAbsSize.Height() = -aAbsSize.Height();
-
-		if( aVDev.SetOutputSizePixel( aAbsSize ) )
-		{
-			Point		aNewOrg( -aPoint.X(), -aPoint.Y() );
-			const Point	aNullPoint;
-
-			// horizontale Spiegelung ggf. beruecksichtigen
-			if( aOldSize.Width() < 0 )
-			{
-				aNewOrg.X() -= aOldSize.Width();
-
-				// und jetzt noch einen abziehen
-				aNewOrg.X()--;
-			}
-
-			// vertikale Spiegelung ggf. beruecksichtigen
-			if( rSize.Height() < 0 )
-			{
-				aNewOrg.Y() -= aOldSize.Height();
-
-				// und jetzt noch einen abziehen
-				aNewOrg.Y()--;
-			}
-
-			if( rGraphic.GetType() != GRAPHIC_BITMAP )
-			{
-				rGraphic.Draw( &aVDev, aNewOrg, aQSizePix );
-
-				const Bitmap	aBmp( aVDev.GetBitmap( aNullPoint, aAbsSize ) );
-				Bitmap			aMask;
-
-				Graphic( rGraphic.GetGDIMetaFile().GetMonochromeMtf( COL_BLACK ) ).Draw( &aVDev, aNewOrg, aQSizePix );
-				aMask = aVDev.GetBitmap( aNullPoint, aAbsSize );
-				aRetBmp = BitmapEx( aBmp, aMask );
-			}
-			else
-			{
-				Bitmap	aBmp( rGraphic.GetBitmap() );
-
-// UNX has got problems with 1x1 bitmaps which are transparent (KA 02.11.1998)
-#ifdef UNX
-				const Size	aBmpSize( aBmp.GetSizePixel() );
-				sal_Bool		bFullTrans = sal_False;
-
-				if( aBmpSize.Width() == 1 && aBmpSize.Height() == 1 && rGraphic.IsTransparent() )
-				{
-					Bitmap				aTrans( rGraphic.GetBitmapEx().GetMask() );
-					BitmapReadAccess*	pMAcc = aBmp.AcquireReadAccess();
-
-					if( pMAcc )
-					{
-						if( pMAcc->GetColor( 0, 0 ) == BitmapColor( Color( COL_WHITE ) ) )
-							bFullTrans = sal_True;
-
-						aTrans.ReleaseAccess( pMAcc );
-					}
-				}
-
-				if( !bFullTrans )
-#endif // UNX
-
-				{
-					DitherBitmap( aBmp );
-					aVDev.DrawBitmap( aNewOrg, aQSizePix, aBmp );
-					aBmp = aVDev.GetBitmap( aNullPoint, aAbsSize );
-
-					if( !rGraphic.IsTransparent() )
-						aRetBmp = BitmapEx( aBmp );
-					else
-					{
-						Bitmap	aTrans( rGraphic.GetBitmapEx().GetMask() );
-
-						if( !aTrans )
-							aRetBmp = BitmapEx( aBmp, rGraphic.GetBitmapEx().GetTransparentColor() );
-						else
-						{
-							aVDev.DrawBitmap( aNewOrg, aQSizePix, aTrans );
-							aRetBmp = BitmapEx( aBmp, aVDev.GetBitmap( Point(), aAbsSize ) );
-						}
-					}
-				}
-			}
-		}
-	}
-
-	return aRetBmp;
-}
-
-// ------------------------------------------------------------------------
-
-void XOutBitmap::DrawQuickDrawBitmapEx( OutputDevice* pOutDev, const Point& rPt,
-										const Size& rSize, const BitmapEx& rBmpEx )
-{
-	const Size		aBmpSizePix( rBmpEx.GetSizePixel() );
-	const Size		aSizePix( pOutDev->LogicToPixel( rSize ) );
-
-	if ( ( aSizePix.Width() - aBmpSizePix.Width() ) || ( aSizePix.Height() - aBmpSizePix.Height() ) )
-		rBmpEx.Draw( pOutDev, rPt, rSize );
-	else
-		rBmpEx.Draw( pOutDev, rPt );
-}
-
-// ------------------------------------------------------------------------
-
-void XOutBitmap::DrawTiledBitmapEx( OutputDevice* pOutDev,
-									const Point& rStartPt, const Size& rGrfSize,
-									const Rectangle& rTileRect, const BitmapEx& rBmpEx )
-{
-	Rectangle		aClipRect( pOutDev->LogicToPixel( pOutDev->GetClipRegion().GetBoundRect() ) );
-	Rectangle		aPixRect( pOutDev->LogicToPixel( rTileRect ) );
-	const Size		aPixSize( pOutDev->LogicToPixel( rGrfSize ) );
-	const Point		aPixPoint( pOutDev->LogicToPixel( rStartPt ) );
-	Point  			aOrg;
-	const long		nWidth = aPixSize.Width();
-	const long 		nHeight = aPixSize.Height();
-	long			nXPos = aPixPoint.X() + ( ( aPixRect.Left() - aPixPoint.X() ) / nWidth ) * nWidth;
-	long			nYPos = aPixPoint.Y() + ( ( aPixRect.Top() - aPixPoint.Y() ) / nHeight ) * nHeight;
-	const long		nBottom = aPixRect.Bottom();
-	const long		nRight = aPixRect.Right();
-	const long		nLeft = nXPos;
-	const sal_Bool		bNoSize = ( aPixSize == rBmpEx.GetSizePixel() );
-
-	pOutDev->Push();
-	pOutDev->SetMapMode( MapMode() );
-
-	// ggf. neue ClipRegion berechnen und setzen
-	if ( pOutDev->IsClipRegion() )
-		aPixRect.Intersection( aClipRect );
-
-	pOutDev->SetClipRegion( aPixRect );
-
-	while( nYPos <= nBottom )
-	{
-		while( nXPos <= nRight )
-		{
-			if ( bNoSize )
-				rBmpEx.Draw( pOutDev, Point( nXPos, nYPos ) );
-			else
-				rBmpEx.Draw( pOutDev, Point( nXPos, nYPos ), aPixSize );
-
-			nXPos += nWidth;
-		}
-
-		nXPos = nLeft;
-		nYPos += nHeight;
-	}
-
-	pOutDev->Pop();
-}
-
 // ------------------------------------------------------------------------
 
 Animation XOutBitmap::MirrorAnimation( const Animation& rAnimation, sal_Bool bHMirr, sal_Bool bVMirr )
@@ -577,8 +396,8 @@ Bitmap XOutBitmap::DetectEdges( const Bi
 				const long			nHeight = aSize.Height();
 				const long			nHeight2 = nHeight - 2L;
 				const long			lThres2 = (long) cThreshold * cThreshold;
-				const sal_uInt8 nWhitePalIdx = pWriteAcc->GetBestPaletteIndex( Color( COL_WHITE ) );
-				const sal_uInt8 nBlackPalIdx = pWriteAcc->GetBestPaletteIndex( Color( COL_BLACK ) );
+				const sal_uInt8 nWhitePalIdx(static_cast< sal_uInt8 >(pWriteAcc->GetBestPaletteIndex(Color(COL_WHITE))));
+				const sal_uInt8 nBlackPalIdx(static_cast< sal_uInt8 >(pWriteAcc->GetBestPaletteIndex(Color(COL_BLACK))));
 				long				nSum1;
 				long				nSum2;
 				long				lGray;

Modified: openoffice/trunk/main/svx/source/xoutdev/xattrbmp.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/xoutdev/xattrbmp.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/xoutdev/xattrbmp.cxx (original)
+++ openoffice/trunk/main/svx/source/xoutdev/xattrbmp.cxx Thu Jan 10 17:28:40 2013
@@ -42,6 +42,7 @@
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <vcl/salbtype.hxx>
 #include <vcl/bmpacc.hxx>
+#include <vcl/dibtools.hxx>
 
 using namespace ::com::sun::star;
 
@@ -154,7 +155,7 @@ XFillBitmapItem::XFillBitmapItem(SvStrea
 		    // Behandlung der alten Bitmaps
 		    Bitmap aBmp;
 
-		    rIn >> aBmp;
+            ReadDIB(aBmp, rIn, true);
             maGraphicObject = Graphic(aBmp);
 	    }
 	    else if(1 == nVer)
@@ -174,7 +175,7 @@ XFillBitmapItem::XFillBitmapItem(SvStrea
 		    {
 			    Bitmap aBmp;
 
-                rIn >> aBmp;
+                ReadDIB(aBmp, rIn, true);
                 maGraphicObject = Graphic(aBmp);
 		    }
 		    else if(XBITMAP_8X8 == iTmp)
@@ -201,7 +202,7 @@ XFillBitmapItem::XFillBitmapItem(SvStrea
         {
 		    BitmapEx aBmpEx;
 
-		    rIn >> aBmpEx;
+            ReadDIBBitmapEx(aBmpEx, rIn);
             maGraphicObject = Graphic(aBmpEx);
         }
     }
@@ -253,7 +254,7 @@ SvStream& XFillBitmapItem::Store( SvStre
 
 	if(!IsIndex())
 	{
-        rOut << maGraphicObject.GetGraphic().GetBitmapEx();
+        WriteDIBBitmapEx(maGraphicObject.GetGraphic().GetBitmapEx(), rOut);
 	}
 
 	return rOut;

Modified: openoffice/trunk/main/sw/source/core/view/viewsh.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/core/view/viewsh.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/core/view/viewsh.cxx (original)
+++ openoffice/trunk/main/sw/source/core/view/viewsh.cxx Thu Jan 10 17:28:40 2013
@@ -19,25 +19,18 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sw.hxx"
 
-
 #define _SVX_PARAITEM_HXX
 #define _SVX_TEXTITEM_HXX
 
 #include <com/sun/star/accessibility/XAccessible.hpp>
-
 #include <sfx2/viewfrm.hxx>
 #include <sfx2/progress.hxx>
 #include <svx/srchdlg.hxx>
 #include <svx/svdobj.hxx>
 #include <sfx2/viewsh.hxx>
-#ifndef _SHL_HXX
-//#include <tools/shl.hxx>
-#endif
 #include <swwait.hxx>
 #include <swmodule.hxx>
 #include <fesh.hxx>
@@ -59,9 +52,7 @@
 #include <fntcache.hxx>
 #include <ptqueue.hxx>
 #include <tabfrm.hxx>
-#ifndef _DOCSH_HXX
 #include <docsh.hxx>
-#endif
 #include <pagedesc.hxx>
 #include <ndole.hxx>
 #include <ndindex.hxx>
@@ -69,27 +60,17 @@
 #include <svtools/colorcfg.hxx>
 #include <svtools/accessibilityoptions.hxx>
 #include <accessibilityoptions.hxx>
-#ifndef _STATSTR_HRC
 #include <statstr.hrc>
-#endif
-#ifndef _COMCORE_HRC
 #include <comcore.hrc>
-#endif
-// OD 14.01.2003 #103492#
 #include <pagepreviewlayout.hxx>
-// --> OD 2004-05-24 #i28701#
 #include <sortedobjs.hxx>
 #include <anchoredobject.hxx>
-// <--
-
 #include "../../ui/inc/view.hxx"
 #include <PostItMgr.hxx>
 #include <vcl/virdev.hxx>
-
 #include <vcl/svapp.hxx>
-
-// #i74769#
 #include <svx/sdrpaintwindow.hxx>
+#include <vcl/dibtools.hxx>
 
 sal_Bool ViewShell::bLstAct = sal_False;
 ShellResource *ViewShell::pShellRes = 0;
@@ -1447,7 +1428,7 @@ sal_Bool ViewShell::SmoothScroll( long l
 					const Bitmap aBitmap(pVout->GetBitmap(Point(), pVout->GetOutputSizePixel()));
                     const String aTmpString(ByteString( "c:\\test.bmp" ), RTL_TEXTENCODING_UTF8);
                     SvFileStream aNew(aTmpString, STREAM_WRITE|STREAM_TRUNC);
-					aNew << aBitmap;
+                    WriteDIB(aBitmap, aNew, false, true);
 					pVout->EnableMapMode(bMapModeWasEnabledVDev);
 				}
 			}

Modified: openoffice/trunk/main/sw/source/filter/ww1/w1filter.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/filter/ww1/w1filter.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/filter/ww1/w1filter.cxx (original)
+++ openoffice/trunk/main/sw/source/filter/ww1/w1filter.cxx Thu Jan 10 17:28:40 2013
@@ -19,28 +19,21 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sw.hxx"
 #include <hintids.hxx>
-
 #include <tools/solar.h>
 #include <comphelper/string.hxx>
 #include <editeng/paperinf.hxx>
 #include <svtools/filter.hxx>
-#ifndef _GRAPH_HXX //autogen
 #include <vcl/graph.hxx>
-#endif
 #include <editeng/fontitem.hxx>
 #include <editeng/lrspitem.hxx>
 #include <editeng/ulspitem.hxx>
 #include <editeng/wghtitem.hxx>
 #include <editeng/postitem.hxx>
 #include <editeng/crsditem.hxx>
-#ifndef _SVX_CNTRITEM_HXX //autogen
 #include <editeng/cntritem.hxx>
-#endif
 #include <editeng/cmapitem.hxx>
 #include <editeng/fhgtitem.hxx>
 #include <editeng/udlnitem.hxx>
@@ -48,9 +41,7 @@
 #include <editeng/colritem.hxx>
 #include <editeng/kernitem.hxx>
 #include <editeng/escpitem.hxx>
-#ifndef _SVX_TSTPITEM_HXX //autogen
 #include <editeng/tstpitem.hxx>
-#endif
 #include <svl/urihelper.hxx>
 #include <fmtfsize.hxx>
 #include <doc.hxx>
@@ -65,19 +56,14 @@
 #include <section.hxx>			// class SwSection
 #include <fltini.hxx>
 #include <w1par.hxx>
-
 #include <docsh.hxx>
 #include <swerror.h>
 #include <mdiexp.hxx>
-#ifndef _STATSTR_HRC
 #include <statstr.hrc>
-#endif
-#if OSL_DEBUG_LEVEL > 1
 #include <stdio.h>
-#endif
-
 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
 #include <com/sun/star/document/XDocumentProperties.hpp>
+#include <vcl/dibtools.hxx>
 
 #define MAX_FIELDLEN 64000
 
@@ -1970,7 +1956,7 @@ void Ww1Picture::Out(Ww1Shell& rOut, Ww1
 		SvMemoryStream aOut(nSiz, 8192);
 		WriteBmp(aOut);
 		Bitmap aBmp;
-		aOut >> aBmp;
+        ReadDIB(aBmp, aOut, true);
 		pGraphic = new Graphic(aBmp);
 	}
 	default:

Modified: openoffice/trunk/main/sw/source/filter/ww8/ww8par.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/filter/ww8/ww8par.hxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/filter/ww8/ww8par.hxx (original)
+++ openoffice/trunk/main/sw/source/filter/ww8/ww8par.hxx Thu Jan 10 17:28:40 2013
@@ -192,7 +192,7 @@ public:
     SwNumRule* CreateNextRule(bool bSimple);
     ~WW8ListManager();
 	SwNumRule* GetNumRule(sal_uInt16 i);	
-	sal_uInt16 GetWW8LSTInfoNum() const{return maLSTInfos.size();}
+	sal_uInt16 GetWW8LSTInfoNum() const{return static_cast< sal_uInt16 >(maLSTInfos.size());}
 private:
     wwSprmParser maSprmParser;
     SwWW8ImplReader& rReader;

Modified: openoffice/trunk/main/sw/source/ui/dochdl/swdtflvr.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sw/source/ui/dochdl/swdtflvr.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/sw/source/ui/dochdl/swdtflvr.cxx (original)
+++ openoffice/trunk/main/sw/source/ui/dochdl/swdtflvr.cxx Thu Jan 10 17:28:40 2013
@@ -540,11 +540,10 @@ sal_Bool SwTransferable::GetData( const 
 				bOK = SetGDIMetaFile( pClpGraphic->GetGDIMetaFile(), rFlavor );
 			break;
 		case SOT_FORMAT_BITMAP:
+        case SOT_FORMATSTR_ID_PNG:
             // #126398#  Neither pClpBitmap nor pClpGraphic are necessarily set
             if( (eBufferType & TRNSFR_GRAPHIC) && (pClpBitmap != 0 || pClpGraphic != 0))
-				bOK = SetBitmap( (pClpBitmap ? pClpBitmap
-											 : pClpGraphic)->GetBitmap(),
-								 rFlavor );
+				bOK = SetBitmapEx( (pClpBitmap ? pClpBitmap : pClpGraphic)->GetBitmapEx(), rFlavor );
 			break;
 
 		case SOT_FORMATSTR_ID_SVIM:
@@ -794,6 +793,7 @@ int SwTransferable::PrepareForCopy( sal_
         // <--
 		{
 			AddFormat( FORMAT_GDIMETAFILE );
+            AddFormat( SOT_FORMATSTR_ID_PNG );
 			AddFormat( FORMAT_BITMAP );
 		}
 		eBufferType = TRNSFR_GRAPHIC;
@@ -900,6 +900,7 @@ int SwTransferable::PrepareForCopy( sal_
 			if ( nSelection & nsSelectionType::SEL_DRW )
 			{
 				AddFormat( FORMAT_GDIMETAFILE );
+                AddFormat( SOT_FORMATSTR_ID_PNG );
 				AddFormat( FORMAT_BITMAP );
 			}
 			eBufferType = (TransferBufferType)( TRNSFR_GRAPHIC | eBufferType );
@@ -2990,6 +2991,7 @@ void SwTransferable::SetDataForDragAndDr
         // <--
 		{
 			AddFormat( FORMAT_GDIMETAFILE );
+            AddFormat( SOT_FORMATSTR_ID_PNG );
 			AddFormat( FORMAT_BITMAP );
 		}
 		eBufferType = TRNSFR_GRAPHIC;
@@ -3039,6 +3041,7 @@ void SwTransferable::SetDataForDragAndDr
 			if ( nSelection & nsSelectionType::SEL_DRW )
 			{
 				AddFormat( FORMAT_GDIMETAFILE );
+                AddFormat( SOT_FORMATSTR_ID_PNG );
 				AddFormat( FORMAT_BITMAP );
 			}
 			eBufferType = (TransferBufferType)( TRNSFR_GRAPHIC | eBufferType );

Modified: openoffice/trunk/main/toolkit/source/awt/vclxbitmap.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/toolkit/source/awt/vclxbitmap.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/toolkit/source/awt/vclxbitmap.cxx (original)
+++ openoffice/trunk/main/toolkit/source/awt/vclxbitmap.cxx Thu Jan 10 17:28:40 2013
@@ -19,18 +19,16 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_toolkit.hxx"
 
-
 #include <toolkit/awt/vclxbitmap.hxx>
 #include <toolkit/helper/macros.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <tools/stream.hxx>
 #include <rtl/memory.h>
 #include <rtl/uuid.h>
+#include <vcl/dibtools.hxx>
 
 //	----------------------------------------------------
 //	class VCLXBitmap
@@ -71,7 +69,7 @@ IMPL_XTYPEPROVIDER_END
 	::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
 	SvMemoryStream aMem;
-	aMem << maBitmap.GetBitmap();
+    WriteDIB(maBitmap.GetBitmap(), aMem, false, true);
 	return ::com::sun::star::uno::Sequence<sal_Int8>( (sal_Int8*) aMem.GetData(), aMem.Tell() );
 }
 
@@ -80,10 +78,8 @@ IMPL_XTYPEPROVIDER_END
 	::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
 
 	SvMemoryStream aMem;
-	aMem << maBitmap.GetMask();
+    WriteDIB(maBitmap.GetMask(), aMem, false, true);
 	return ::com::sun::star::uno::Sequence<sal_Int8>( (sal_Int8*) aMem.GetData(), aMem.Tell() );
 }
 
-
-
-
+// eof

Modified: openoffice/trunk/main/toolkit/source/helper/vclunohelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/toolkit/source/helper/vclunohelper.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/toolkit/source/helper/vclunohelper.cxx (original)
+++ openoffice/trunk/main/toolkit/source/helper/vclunohelper.cxx Thu Jan 10 17:28:40 2013
@@ -19,8 +19,6 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_toolkit.hxx"
 
@@ -42,9 +40,7 @@
 #include <com/sun/star/awt/MouseButton.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/embed/EmbedMapUnits.hpp>
-
 #include <com/sun/star/graphic/XGraphic.hpp>
-
 #include <toolkit/helper/vclunohelper.hxx>
 #include <toolkit/helper/convert.hxx>
 #include <toolkit/awt/vclxbitmap.hxx>
@@ -55,12 +51,11 @@
 #include <toolkit/awt/vclxfont.hxx>
 #include <toolkit/controls/unocontrolcontainer.hxx>
 #include <toolkit/controls/unocontrolcontainermodel.hxx>
-
 #include <vcl/graph.hxx>
 #include <comphelper/processfactory.hxx>
-
 #include <com/sun/star/awt/Size.hpp>
 #include <com/sun/star/awt/Point.hpp>
+#include <vcl/dibtools.hxx>
 
 using namespace ::com::sun::star;
 
@@ -101,12 +96,12 @@ BitmapEx VCLUnoHelper::GetBitmap( const 
 			{
 				::com::sun::star::uno::Sequence<sal_Int8> aBytes = rxBitmap->getDIB();
 				SvMemoryStream aMem( (char*) aBytes.getArray(), aBytes.getLength(), STREAM_READ );
-				aMem >> aDIB;
+                ReadDIB(aDIB, aMem, true);
 			}
 			{
 				::com::sun::star::uno::Sequence<sal_Int8> aBytes = rxBitmap->getMaskDIB();
 				SvMemoryStream aMem( (char*) aBytes.getArray(), aBytes.getLength(), STREAM_READ );
-				aMem >> aMask;
+                ReadDIB(aMask, aMem, true);
 			}
 			aBmp = BitmapEx( aDIB, aMask );
 		}

Modified: openoffice/trunk/main/vcl/Library_vcl.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/Library_vcl.mk?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/Library_vcl.mk (original)
+++ openoffice/trunk/main/vcl/Library_vcl.mk Thu Jan 10 17:28:40 2013
@@ -321,7 +321,6 @@ $(eval $(call gb_Library_add_exception_o
     vcl/source/gdi/alpha \
     vcl/source/gdi/animate \
     vcl/source/gdi/base14 \
-    vcl/source/gdi/bitmap2 \
     vcl/source/gdi/bitmap3 \
     vcl/source/gdi/bitmap4 \
     vcl/source/gdi/bitmap \
@@ -334,6 +333,7 @@ $(eval $(call gb_Library_add_exception_o
     vcl/source/gdi/configsettings \
     vcl/source/gdi/cvtgrf \
     vcl/source/gdi/cvtsvm \
+    vcl/source/gdi/dibtools \
     vcl/source/gdi/extoutdevdata \
     vcl/source/gdi/font \
     vcl/source/gdi/gdimtf \

Modified: openoffice/trunk/main/vcl/Package_inc.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/Package_inc.mk?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/Package_inc.mk (original)
+++ openoffice/trunk/main/vcl/Package_inc.mk Thu Jan 10 17:28:40 2013
@@ -30,6 +30,7 @@ $(eval $(call gb_Package_add_file,vcl_in
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/arrange.hxx,vcl/arrange.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/bitmapex.hxx,vcl/bitmapex.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/bitmap.hxx,vcl/bitmap.hxx))
+$(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/dibtools.hxx,vcl/dibtools.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/bmpacc.hxx,vcl/bmpacc.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/btndlg.hxx,vcl/btndlg.hxx))
 $(eval $(call gb_Package_add_file,vcl_inc,inc/vcl/button.hxx,vcl/button.hxx))

Modified: openoffice/trunk/main/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/dtrans/DataFlavorMapping.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/dtrans/DataFlavorMapping.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/dtrans/DataFlavorMapping.cxx Thu Jan 10 17:28:40 2013
@@ -125,8 +125,8 @@ namespace // private
 	{
 	  { NSStringPboardType, "text/plain;charset=utf-16", "Unicode Text (UTF-16)", CPPUTYPE_OUSTRING },
 	  { NSRTFPboardType, "text/richtext", "Rich Text Format", CPPUTYPE_SEQINT8 },
-	  { NSTIFFPboardType, "image/bmp", "Windows Bitmap", CPPUTYPE_SEQINT8 },
-	  { NSPICTPboardType, "image/bmp", "Windows Bitmap", CPPUTYPE_SEQINT8 },
+	  { NSTIFFPboardType, "image/png", "Portable Network Graphics", CPPUTYPE_SEQINT8 },
+	  { NSPICTPboardType, "image/png", "Portable Network Graphics", CPPUTYPE_SEQINT8 },
 	  { NSHTMLPboardType, "text/html", "Plain Html", CPPUTYPE_SEQINT8 },
 	  { NSFilenamesPboardType, "application/x-openoffice-filelist;windows_formatname=\"FileList\"", "FileList", CPPUTYPE_SEQINT8 }, 
 	  { PBTYPE_SESX, FLAVOR_SESX, "Star Embed Source (XML)", CPPUTYPE_SEQINT8 },
@@ -371,73 +371,65 @@ Any HTMLFormatDataProvider::getOOoData()
 
 //###########################
 
-class BMPDataProvider : public DataProviderBaseImpl
+class PNGDataProvider : public DataProviderBaseImpl
 {
-    NSBitmapImageFileType meImageType;
+	NSBitmapImageFileType meImageType;
 public:
-  BMPDataProvider(const Any& data, NSBitmapImageFileType eImageType );
+	PNGDataProvider( const Any&, NSBitmapImageFileType);
 
-  BMPDataProvider(NSData* data, NSBitmapImageFileType eImageType);
+	PNGDataProvider( NSData*, NSBitmapImageFileType);
 
-  virtual NSData* getSystemData();
+	virtual NSData* getSystemData();
 
-  virtual Any getOOoData();
+	virtual Any getOOoData();
 };
 
-BMPDataProvider::BMPDataProvider(const Any& data, NSBitmapImageFileType eImageType) :
+PNGDataProvider::PNGDataProvider( const Any& data, NSBitmapImageFileType eImageType) :
   DataProviderBaseImpl(data),
   meImageType( eImageType )
 {
 }
 
-BMPDataProvider::BMPDataProvider(NSData* data, NSBitmapImageFileType eImageType) :
+PNGDataProvider::PNGDataProvider( NSData* data, NSBitmapImageFileType eImageType) :
   DataProviderBaseImpl(data),
   meImageType( eImageType )
 {
 }
 
-NSData* BMPDataProvider::getSystemData()
+NSData* PNGDataProvider::getSystemData()
 {
-  Sequence<sal_Int8> bmpData;
-  mData >>= bmpData;
+	Sequence<sal_Int8> pngData;
+	mData >>= pngData;
 
-  Sequence<sal_Int8> pictData;
-  NSData* sysData = NULL;
+	Sequence<sal_Int8> imgData;
+	NSData* sysData = NULL;
+	if( PNGToImage( pngData, imgData, meImageType))
+		sysData = [NSData dataWithBytes: imgData.getArray() length: imgData.getLength()];
 
-  if (BMPToImage(bmpData, pictData, meImageType))
-	{
-	  sysData = [NSData dataWithBytes: pictData.getArray() length: pictData.getLength()];
-	}
-
-  return sysData;
+	return sysData;
 }
 
-/* At the moment the OOo 'PCT' filter is not good enough to be used
-   and there is no flavor defined for exchanging 'PCT' with OOo so
-   we will at the moment convert 'PCT' to a Windows BMP and provide
-   this to OOo 
+/* The AOO 'PCT' filter is not yet good enough to be used
+   and there is no flavor defined for exchanging 'PCT' with AOO
+   so we convert 'PCT' to a PNG and provide this to AOO 
 */
-Any BMPDataProvider::getOOoData()
+Any PNGDataProvider::getOOoData()
 {
-  Any oOOData;
+	Any oOOData;
 
-  if (mSystemData)
+	if( mSystemData)
 	{
-	  unsigned int flavorDataLength = [mSystemData length];
-	  Sequence<sal_Int8> pictData(flavorDataLength);
-
-	  memcpy(pictData.getArray(), [mSystemData bytes], flavorDataLength);
+		const unsigned int flavorDataLength = [mSystemData length];
+		Sequence<sal_Int8> imgData( flavorDataLength);
+		memcpy( imgData.getArray(), [mSystemData bytes], flavorDataLength);
 
-	  Sequence<sal_Int8> bmpData;
-	  
-	  if (ImageToBMP(pictData, bmpData, meImageType))
-		{
-		  oOOData = makeAny(bmpData);
-		}
+		Sequence<sal_Int8> pngData;
+		if( ImageToPNG( imgData, pngData, meImageType))
+			oOOData = makeAny( pngData);
 	}
-  else
+	else
 	{
-	  oOOData = mData;
+		oOOData = mData;
 	}
   
   return oOOData;
@@ -617,11 +609,11 @@ DataProviderPtr_t DataFlavorMapper::getD
 		  */
 		  if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
 			{
-			  dp = DataProviderPtr_t(new BMPDataProvider(data, PICTImageFileType));
+			  dp = DataProviderPtr_t( new PNGDataProvider( data, PICTImageFileType));
 			}
 		  else if ([systemFlavor caseInsensitiveCompare: NSTIFFPboardType] == NSOrderedSame)
 			{
-			  dp = DataProviderPtr_t(new BMPDataProvider(data, NSTIFFFileType));
+			  dp = DataProviderPtr_t( new PNGDataProvider( data, NSTIFFFileType));
 			}
 		  else if ([systemFlavor caseInsensitiveCompare: NSFilenamesPboardType] == NSOrderedSame)
 			{
@@ -666,11 +658,11 @@ DataProviderPtr_t DataFlavorMapper::getD
 	}
   else if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
 	{
-	  dp = DataProviderPtr_t(new BMPDataProvider(systemData, PICTImageFileType));
+	  dp = DataProviderPtr_t( new PNGDataProvider(systemData, PICTImageFileType));
 	}
   else if ([systemFlavor caseInsensitiveCompare: NSTIFFPboardType] == NSOrderedSame)
 	{
-	  dp = DataProviderPtr_t(new BMPDataProvider(systemData, NSTIFFFileType));
+	  dp = DataProviderPtr_t( new PNGDataProvider(systemData, NSTIFFFileType));
 	}
   else if ([systemFlavor caseInsensitiveCompare: NSFilenamesPboardType] == NSOrderedSame)
 	{

Modified: openoffice/trunk/main/vcl/aqua/source/dtrans/OSXTransferable.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/dtrans/OSXTransferable.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/dtrans/OSXTransferable.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/dtrans/OSXTransferable.cxx Thu Jan 10 17:28:40 2013
@@ -85,7 +85,7 @@ Any SAL_CALL OSXTransferable::getTransfe
 	}
 
   NSString* sysFormat = 
-      (aFlavor.MimeType.compareToAscii( "image/bmp", 9 ) == 0)
+      (aFlavor.MimeType.compareToAscii( "image/png", 9 ) == 0)
       ? mDataFlavorMapper->openOfficeImageToSystemFlavor( mPasteboard )
       : mDataFlavorMapper->openOfficeToSystemFlavor(aFlavor);
   DataProviderPtr_t dp;

Modified: openoffice/trunk/main/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/dtrans/PictToBmpFlt.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/dtrans/PictToBmpFlt.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/dtrans/PictToBmpFlt.cxx Thu Jan 10 17:28:40 2013
@@ -36,159 +36,130 @@
 
 #include "PictToBmpFlt.hxx"
 
-bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict, 
-			   com::sun::star::uno::Sequence<sal_Int8>& aBmp)
+bool PICTtoPNG( com::sun::star::uno::Sequence<sal_Int8>& rPictData,
+			com::sun::star::uno::Sequence<sal_Int8>& rPngData)
 {
-    
-  bool result = false;
-
-  ComponentInstance bmpExporter;
-  if (OpenADefaultComponent(GraphicsExporterComponentType,
-							kQTFileTypeBMP,
-							&bmpExporter) != noErr)
-	{
-	  return result;
-	}
-
-  Handle hPict;
-  if (PtrToHand(aPict.getArray(), &hPict, aPict.getLength()) != noErr)
-	{
-	  return result;
-	}
-
-  Handle hBmp;
-  if ((GraphicsExportSetInputPicture(bmpExporter, (PicHandle)hPict) != noErr) || 
-	  ((hBmp = NewHandleClear(0)) == NULL))
-	{
-	  CloseComponent(bmpExporter);
-	  DisposeHandle(hPict);
-	  return result;
-	}
-
-  if ((GraphicsExportSetOutputHandle(bmpExporter, hBmp) == noErr) &&
-	  (GraphicsExportDoExport(bmpExporter, NULL) == noErr))
-	{
-	  size_t sz = GetHandleSize(hBmp);
-	  aBmp.realloc(sz);
-
-	  HLock(hBmp);
-	  rtl_copyMemory(aBmp.getArray(), ((sal_Int8*)*hBmp), sz);
-	  HUnlock(hBmp);
-
-	  result = true;
+	ComponentInstance pngExporter = NULL;
+	if( OpenADefaultComponent( GraphicsExporterComponentType, kQTFileTypePNG, &pngExporter) != noErr)
+		return false;
+
+	Handle hPict = NULL;
+	if( PtrToHand( rPictData.getArray(), &hPict, rPictData.getLength()) != noErr)
+		hPict = NULL;
+
+	Handle hPng = NULL;
+	if( hPict && GraphicsExportSetInputPicture( pngExporter, (PicHandle)hPict) == noErr)
+		hPng = NewHandleClear(0);
+
+	size_t nPngSize = 0;
+	if( hPng
+	&& (GraphicsExportSetOutputHandle( pngExporter, hPng) == noErr)
+	&& (GraphicsExportDoExport( pngExporter, NULL) == noErr))
+	{
+		nPngSize = GetHandleSize( hPng);
+		rPngData.realloc( nPngSize);
+
+		HLock( hPng);
+		rtl_copyMemory( rPngData.getArray(), ((sal_Int8*)*hPng), nPngSize);
+		HUnlock( hPng);
 	} 
 
-  DisposeHandle(hPict);
-  DisposeHandle(hBmp);
-  CloseComponent(bmpExporter);
+	if( hPict)
+		DisposeHandle( hPict);
+	if( hPng)
+		DisposeHandle( hPng);
+	if( pngExporter)
+		CloseComponent( pngExporter);
 
-  return result;
+	return (nPngSize > 0);
 }
 
-bool BMPtoPICT(com::sun::star::uno::Sequence<sal_Int8>& aBmp, 
-			   com::sun::star::uno::Sequence<sal_Int8>& aPict)
-{
-  bool result = false;
 
-  Handle hBmp;
-  ComponentInstance pictExporter;
-  if ((PtrToHand(aBmp.getArray(), &hBmp, aBmp.getLength()) != noErr)) 
-	{
-	  return result;
-	}
-
-  if (OpenADefaultComponent(GraphicsImporterComponentType,
-							kQTFileTypeBMP,
-							&pictExporter) != noErr)
-	{
-	  DisposeHandle(hBmp);
-	  return result;
-	}
+bool PNGtoPICT( com::sun::star::uno::Sequence<sal_Int8>& rPngData,
+			   com::sun::star::uno::Sequence<sal_Int8>& rPictData)
+{
+	ComponentInstance pictExporter;
+	if( OpenADefaultComponent( GraphicsImporterComponentType, kQTFileTypePNG, &pictExporter) != noErr)
+		return false;
+
+	Handle hPng = NULL;
+	if( PtrToHand( rPngData.getArray(), &hPng, rPngData.getLength()) != noErr)
+		hPng = NULL;
   
-  if (GraphicsImportSetDataHandle(pictExporter, hBmp) != noErr)
-	{
-	  DisposeHandle(hBmp);
-	  CloseComponent(pictExporter);
-	  return result;
-	}
-
-  PicHandle hPict;
-  if (GraphicsImportGetAsPicture(pictExporter, &hPict) == noErr)
-	{
-	  size_t sz = GetHandleSize((Handle)hPict);
-	  aPict.realloc(sz);
-
-	  HLock((Handle)hPict);
-	  rtl_copyMemory(aPict.getArray(), ((sal_Int8*)*hPict), sz);
-	  HUnlock((Handle)hPict);
-
-	  // Release the data associated with the picture
-	  // Note: This function is deprecated in Mac OS X 
-	  // 10.4.
-	  KillPicture(hPict); 
-
-	  result = true;
+	size_t nPictSize = 0;
+	PicHandle hPict = NULL;
+	if( hPng
+	&& (GraphicsImportSetDataHandle( pictExporter, hPng) == noErr)
+	&& (GraphicsImportGetAsPicture( pictExporter, &hPict) == noErr))
+	{
+		nPictSize = GetHandleSize( (Handle)hPict);
+		rPictData.realloc( nPictSize);
+
+		HLock( (Handle)hPict);
+		rtl_copyMemory( rPictData.getArray(), ((sal_Int8*)*hPict), nPictSize);
+		HUnlock( (Handle)hPict);
+
+		// Release the data associated with the picture
+		// Note: This function is deprecated in Mac OSX 10.4
+		KillPicture( hPict);
 	}
   
-  DisposeHandle(hBmp);
-  CloseComponent(pictExporter);
+	if( hPng)
+		DisposeHandle( hPng);
+	if( pictExporter)
+		CloseComponent( pictExporter);
   
-  return result;
+	return (nPictSize > 512);
 }
 
-bool ImageToBMP( com::sun::star::uno::Sequence<sal_Int8>& aPict, 
-			     com::sun::star::uno::Sequence<sal_Int8>& aBmp,
+bool ImageToPNG( com::sun::star::uno::Sequence<sal_Int8>& rImgData, 
+			     com::sun::star::uno::Sequence<sal_Int8>& rPngData,
 			     NSBitmapImageFileType eInFormat)
 {
-    if( eInFormat == PICTImageFileType )
-        return PICTtoBMP( aPict, aBmp );
-    
-    bool bResult = false;
-    
-    NSData* pData = [NSData dataWithBytesNoCopy: (void*)aPict.getConstArray() length: aPict.getLength() freeWhenDone: 0];
-    if( pData )
-    {
-        NSBitmapImageRep* pRep = [NSBitmapImageRep imageRepWithData: pData];
-        if( pRep )
-        {
-            NSData* pOut = [pRep representationUsingType: NSBMPFileType properties: nil];
-            if( pOut )
-            {
-                aBmp.realloc( [pOut length] );
-                [pOut getBytes: aBmp.getArray() length: aBmp.getLength()];
-                bResult = (aBmp.getLength() != 0);
-            }
-        }
-    }
-    
-    return bResult;
+	if( eInFormat == PICTImageFileType)
+		return PICTtoPNG( rImgData, rPngData);
+
+	NSData* pData = [NSData dataWithBytesNoCopy: (void*)rImgData.getConstArray() length: rImgData.getLength() freeWhenDone: 0];
+	if( !pData)
+		return false;
+
+	NSBitmapImageRep* pRep =[NSBitmapImageRep imageRepWithData: pData];
+        if( !pRep)
+		return false;
+
+	NSData* pOut = [pRep representationUsingType: NSPNGFileType properties: nil];
+	if( !pOut)
+		return false;
+
+	const size_t nPngSize = [pOut length];
+	rPngData.realloc( nPngSize);
+	[pOut getBytes: rPngData.getArray() length: nPngSize];
+	return (nPngSize > 0);
 }
 
-bool BMPToImage( com::sun::star::uno::Sequence<sal_Int8>& aBmp, 
-			     com::sun::star::uno::Sequence<sal_Int8>& aPict,
+bool PNGToImage( com::sun::star::uno::Sequence<sal_Int8>& rPngData,
+			     com::sun::star::uno::Sequence<sal_Int8>& rImgData,
 			     NSBitmapImageFileType eOutFormat
 			    )
 {
-    if( eOutFormat == PICTImageFileType )
-        return BMPtoPICT( aBmp, aPict );
-    
-    bool bResult = false;
+	if( eOutFormat == PICTImageFileType)
+		return PNGtoPICT( rPngData, rImgData);
     
-    NSData* pData = [NSData dataWithBytesNoCopy: const_cast<sal_Int8*>(aBmp.getConstArray()) length: aBmp.getLength() freeWhenDone: 0];
-    if( pData )
-    {
+	NSData* pData = [NSData dataWithBytesNoCopy: const_cast<sal_Int8*>(rPngData.getConstArray()) length: rPngData.getLength() freeWhenDone: 0];
+	if( !pData)
+		return false;
+
         NSBitmapImageRep* pRep = [NSBitmapImageRep imageRepWithData: pData];
-        if( pRep )
-        {
-            NSData* pOut = [pRep representationUsingType: eOutFormat properties: nil];
-            if( pOut )
-            {
-                aPict.realloc( [pOut length] );
-                [pOut getBytes: aPict.getArray() length: aPict.getLength()];
-                bResult = (aPict.getLength() != 0);
-            }
-        }
-    }
-    
-    return bResult;
+        if( !pRep)
+		return false;
+
+	NSData* pOut = [pRep representationUsingType: eOutFormat properties: nil];
+	if( !pOut)
+		return false;
+
+	const size_t nImgSize = [pOut length];
+	rImgData.realloc( nImgSize);
+	[pOut getBytes: rImgData.getArray() length: nImgSize];
+	return (nImgSize > 0);
 }
+

Modified: openoffice/trunk/main/vcl/aqua/source/dtrans/PictToBmpFlt.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/dtrans/PictToBmpFlt.hxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/dtrans/PictToBmpFlt.hxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/dtrans/PictToBmpFlt.hxx Thu Jan 10 17:28:40 2013
@@ -28,31 +28,31 @@
 #include <Cocoa/Cocoa.h>
 #include <postmac.h>
 
-/* Transform PICT into the a Window BMP.
+/** Transform an image from PICT to PNG format
 
    Returns true if the conversion was successful false 
    otherwise.
  */
-bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict, 
-			   com::sun::star::uno::Sequence<sal_Int8>& aBmp);
+bool PICTtoPNG(com::sun::star::uno::Sequence<sal_Int8>& rPictData, 
+			   com::sun::star::uno::Sequence<sal_Int8>& rPngData);
 
-/* Transform a Windows BMP to a PICT.
+/** Transform an image from PNG to a PICT format
 
    Returns true if the conversion was successful false
    otherwise.
  */
-bool BMPtoPICT(com::sun::star::uno::Sequence<sal_Int8>& aBmp, 
-			   com::sun::star::uno::Sequence<sal_Int8>& aPict);
+bool PNGtoPICT(com::sun::star::uno::Sequence<sal_Int8>& rPngData,
+			   com::sun::star::uno::Sequence<sal_Int8>& rPictData);
 
 #define PICTImageFileType ((NSBitmapImageFileType)~0)
 
-bool ImageToBMP( com::sun::star::uno::Sequence<sal_Int8>& aPict, 
-			     com::sun::star::uno::Sequence<sal_Int8>& aBmp,
+bool ImageToPNG( com::sun::star::uno::Sequence<sal_Int8>& rImgData,
+			     com::sun::star::uno::Sequence<sal_Int8>& rPngData,
 			     NSBitmapImageFileType eInFormat);
 
-bool BMPToImage( com::sun::star::uno::Sequence<sal_Int8>& aBmp, 
-			     com::sun::star::uno::Sequence<sal_Int8>& aPict,
-			     NSBitmapImageFileType eOutFormat
-			    );
+bool PNGToImage( com::sun::star::uno::Sequence<sal_Int8>& rPngData,
+			     com::sun::star::uno::Sequence<sal_Int8>& rImgData,
+			     NSBitmapImageFileType eOutFormat);
 
 #endif
+

Modified: openoffice/trunk/main/vcl/inc/vcl/alpha.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/alpha.hxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/alpha.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/alpha.hxx Thu Jan 10 17:28:40 2013
@@ -36,11 +36,10 @@ class BitmapEx;
 
 class VCL_DLLPUBLIC AlphaMask : private Bitmap
 {
+private:
 	friend class BitmapEx;
 	friend class OutputDevice;
-	friend VCL_DLLPUBLIC SvStream& operator<<( SvStream&, const ImageList& );
-
-private:
+    friend bool VCL_DLLPUBLIC ReadDIBBitmapEx(BitmapEx& rTarget, SvStream& rIStm);
 
 	SAL_DLLPRIVATE const Bitmap&    ImplGetBitmap() const;
 	SAL_DLLPRIVATE void             ImplSetBitmap( const Bitmap& rBitmap );
@@ -97,14 +96,7 @@ public:
     BitmapReadAccess*		AcquireReadAccess() { return Bitmap::AcquireReadAccess(); }
     BitmapWriteAccess*		AcquireWriteAccess() { return Bitmap::AcquireWriteAccess(); }
     void					ReleaseAccess( BitmapReadAccess* pAccess );
-
-public:
-
-    sal_Bool					Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True ) { return Bitmap::Read( rIStm, bFileHeader ); }
-	sal_Bool					Write( SvStream& rOStm, sal_Bool bCompressed = sal_True, sal_Bool bFileHeader = sal_True ) const { return Bitmap::Write( rOStm, bCompressed, bFileHeader ); }
-
-	friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
-	friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
 };
 
 #endif // _SV_ALPHA_HXX
+// eof

Modified: openoffice/trunk/main/vcl/inc/vcl/bitmap.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/bitmap.hxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/bitmap.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/bitmap.hxx Thu Jan 10 17:28:40 2013
@@ -343,8 +343,6 @@ class   BitmapWriteAccess;
 class   BitmapPalette;
 class   ImpBitmap;
 class   Color;
-class   SvStream;
-struct  DIBInfoHeader;
 class   ResId;
 class	GDIMetaFile;
 class	AlphaMask;
@@ -383,20 +381,6 @@ public:
     SAL_DLLPRIVATE void                 ImplSetImpBitmap( ImpBitmap* pImpBmp );
     SAL_DLLPRIVATE void                 ImplAssignWithSize( const Bitmap& rBitmap );
 
-    SAL_DLLPRIVATE static sal_Bool          ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset );
-    SAL_DLLPRIVATE static sal_Bool          ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset );
-    SAL_DLLPRIVATE static sal_Bool          ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown );
-    SAL_DLLPRIVATE static sal_Bool          ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, sal_Bool bQuad );
-    SAL_DLLPRIVATE static sal_Bool          ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, BitmapWriteAccess& rAcc, sal_Bool bTopDown );
-    SAL_DLLPRIVATE sal_Bool                 ImplWriteDIB( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bCompressed ) const;
-    SAL_DLLPRIVATE static sal_Bool          ImplWriteDIBFileHeader( SvStream& rOStm, BitmapReadAccess& rAcc );
-    SAL_DLLPRIVATE static sal_Bool          ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc );
-    SAL_DLLPRIVATE static sal_Bool          ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
-                                                             sal_uLong nCompression, sal_uInt32& rImageSize );
-    SAL_DLLPRIVATE static void          ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
-                                           BitmapWriteAccess& rAcc, sal_Bool bRLE4 );
-    SAL_DLLPRIVATE static sal_Bool          ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool bRLE4 );
-
     SAL_DLLPRIVATE void                     ImplAdaptBitCount(Bitmap& rNew) const;
     SAL_DLLPRIVATE sal_Bool                 ImplScaleFast( const double& rScaleX, const double& rScaleY );
     SAL_DLLPRIVATE sal_Bool                 ImplScaleInterpolate( const double& rScaleX, const double& rScaleY );
@@ -878,18 +862,9 @@ public:
 									const BmpFilterParam* pFilterParam = NULL,
 									const Link* pProgress = NULL );
 
-public:
     BitmapReadAccess*       AcquireReadAccess();
     BitmapWriteAccess*      AcquireWriteAccess();
     void                    ReleaseAccess( BitmapReadAccess* pAccess );
-
-public:
-
-    sal_Bool                    Read( SvStream& rIStm, sal_Bool bFileHeader = sal_True );
-    sal_Bool                    Write( SvStream& rOStm, sal_Bool bCompressed = sal_True, sal_Bool bFileHeader = sal_True ) const;
-
-    friend VCL_DLLPUBLIC SvStream&        operator>>( SvStream& rIStm, Bitmap& rBitmap );
-    friend VCL_DLLPUBLIC SvStream&        operator<<( SvStream& rOStm, const Bitmap& rBitmap );
 };
 
 // -----------

Modified: openoffice/trunk/main/vcl/inc/vcl/bitmapex.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/bitmapex.hxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/bitmapex.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/bitmapex.hxx Thu Jan 10 17:28:40 2013
@@ -46,9 +46,9 @@ enum TransparentType
 
 class VCL_DLLPUBLIC BitmapEx
 {
-	friend class ImpGraphic;
-
 private:
+	friend class ImpGraphic;
+    friend bool VCL_DLLPUBLIC WriteDIBBitmapEx(const BitmapEx& rSource, SvStream& rOStm);
 
 	Bitmap				aBitmap;
 	Bitmap				aMask;
@@ -59,15 +59,9 @@ private:
 
 public:
 
-//#if 0 // _SOLAR__PRIVATE
-
     SAL_DLLPRIVATE  ImpBitmap*  ImplGetBitmapImpBitmap() const { return aBitmap.ImplGetImpBitmap(); }
     SAL_DLLPRIVATE  ImpBitmap*  ImplGetMaskImpBitmap() const { return aMask.ImplGetImpBitmap(); }
 
-//#endif // PRIVATE
-
-public:
-
 						BitmapEx();
 						BitmapEx( const ResId& rResId );
 						BitmapEx( const BitmapEx& rBitmapEx );
@@ -386,11 +380,6 @@ public:
                 0 is not transparent, 255 is fully transparent
      */
     sal_uInt8 GetTransparency(sal_Int32 nX, sal_Int32 nY) const;
-
-public:
-
-	friend VCL_DLLPUBLIC SvStream&	operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx );
-	friend VCL_DLLPUBLIC SvStream&	operator>>( SvStream& rIStm, BitmapEx& rBitmapEx );
 };
 
 #endif // _SV_BITMAPEX_HXX

Modified: openoffice/trunk/main/vcl/inc/vcl/pngwrite.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/pngwrite.hxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/pngwrite.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/pngwrite.hxx Thu Jan 10 17:28:40 2013
@@ -44,7 +44,7 @@ namespace vcl
 
 	public:
 
-		PNGWriter( const BitmapEx& BmpEx,
+		explicit PNGWriter( const BitmapEx&,
 			const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData = NULL );
 		~PNGWriter();
 

Modified: openoffice/trunk/main/vcl/inc/vcl/salbtype.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/salbtype.hxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/salbtype.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/salbtype.hxx Thu Jan 10 17:28:40 2013
@@ -255,6 +255,7 @@ public:
 	inline void 		SetColorFor24Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
 
 	inline void 		GetColorFor32Bit( BitmapColor& rColor, ConstHPBYTE pPixel ) const;
+	inline void 		GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8& rAlpha, ConstHPBYTE pPixel ) const;
 	inline void 		SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const;
 };
 
@@ -880,6 +881,21 @@ inline void ColorMask::GetColorFor32Bit(
 
 // ------------------------------------------------------------------
 
+inline void ColorMask::GetColorAndAlphaFor32Bit( BitmapColor& rColor, sal_uInt8& rAlpha, ConstHPBYTE pPixel ) const
+{
+#ifdef OSL_BIGENDIAN
+	const sal_uInt32 nVal = (sal_uInt32) pPixel[ 0 ] | ( (sal_uInt32) pPixel[ 1 ] << 8UL ) |
+						( (sal_uInt32) pPixel[ 2 ] << 16UL ) | ( (sal_uInt32) pPixel[ 3 ] << 24UL );
+#else
+	const sal_uInt32 nVal = *(sal_uInt32*) pPixel;
+#endif
+    rAlpha = (sal_uInt8)(nVal >> 24);
+
+	MASK_TO_COLOR( nVal, mnRMask, mnGMask, mnBMask, mnRShift, mnGShift, mnBShift, rColor );
+}
+
+// ------------------------------------------------------------------
+
 inline void ColorMask::SetColorFor32Bit( const BitmapColor& rColor, HPBYTE pPixel ) const
 {
 #ifdef OSL_BIGENDIAN

Modified: openoffice/trunk/main/vcl/inc/vcl/wall.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/vcl/wall.hxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/vcl/wall.hxx (original)
+++ openoffice/trunk/main/vcl/inc/vcl/wall.hxx Thu Jan 10 17:28:40 2013
@@ -97,7 +97,7 @@ public:
 					Wallpaper();
 					Wallpaper( const Wallpaper& rWallpaper );
 					Wallpaper( const Color& rColor );
-					Wallpaper( const BitmapEx& rBmpEx );
+					explicit Wallpaper( const BitmapEx& rBmpEx );
 					Wallpaper( const Gradient& rGradient );
 					~Wallpaper();
 

Modified: openoffice/trunk/main/vcl/source/gdi/animate.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/animate.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/animate.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/animate.cxx Thu Jan 10 17:28:40 2013
@@ -32,6 +32,8 @@
 #include <vcl/virdev.hxx>
 #include <vcl/window.hxx>
 #include <impanmvw.hxx>
+#include <vcl/dibtools.hxx>
+
 DBG_NAME( Animation )
 
 // -----------
@@ -830,9 +832,9 @@ SvStream& operator<<( SvStream& rOStm, c
 		// Falls keine BitmapEx gesetzt wurde, schreiben wir
 		// einfach die erste Bitmap der Animation
 		if( !rAnimation.GetBitmapEx().GetBitmap() )
-			rOStm << rAnimation.Get( 0 ).aBmpEx;
+			WriteDIBBitmapEx(rAnimation.Get( 0 ).aBmpEx, rOStm);
 		else
-			rOStm << rAnimation.GetBitmapEx();
+			WriteDIBBitmapEx(rAnimation.GetBitmapEx(), rOStm);
 
 		// Kennung schreiben ( SDANIMA1 )
 		rOStm << (sal_uInt32) 0x5344414e << (sal_uInt32) 0x494d4931;
@@ -843,7 +845,7 @@ SvStream& operator<<( SvStream& rOStm, c
 			const sal_uInt16			nRest = nCount - i - 1;
 
 			// AnimationBitmap schreiben
-			rOStm << rAnimBmp.aBmpEx;
+			WriteDIBBitmapEx(rAnimBmp.aBmpEx, rOStm);
 			rOStm << rAnimBmp.aPosPix;
 			rOStm << rAnimBmp.aSizePix;
 			rOStm << rAnimation.maGlobalSize;
@@ -886,7 +888,7 @@ SvStream& operator>>( SvStream& rIStm, A
 	else
 	{
 		rIStm.Seek( nStmPos );
-		rIStm >> rAnimation.maBitmapEx;
+        ReadDIBBitmapEx(rAnimation.maBitmapEx, rIStm);
 		nStmPos = rIStm.Tell();
 		rIStm >> nAnimMagic1 >> nAnimMagic2;
 
@@ -908,7 +910,7 @@ SvStream& operator>>( SvStream& rIStm, A
 
 		do
 		{
-			rIStm >> aAnimBmp.aBmpEx;
+            ReadDIBBitmapEx(aAnimBmp.aBmpEx, rIStm);
 			rIStm >> aAnimBmp.aPosPix;
 			rIStm >> aAnimBmp.aSizePix;
 			rIStm >> rAnimation.maGlobalSize;

Modified: openoffice/trunk/main/vcl/source/gdi/bitmapex.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/bitmapex.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/bitmapex.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/bitmapex.cxx Thu Jan 10 17:28:40 2013
@@ -19,19 +19,14 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"
 
 #include <ctype.h>
-
 #include <rtl/crc.h>
-
 #include <tools/stream.hxx>
 #include <tools/debug.hxx>
 #include <tools/rc.h>
-
 #include <vcl/salbtype.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/alpha.hxx>
@@ -39,7 +34,7 @@
 #include <vcl/pngread.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/bmpacc.hxx>
-
+#include <vcl/dibtools.hxx>
 #include <image.h>
 #include <impimagetree.hxx>
 
@@ -838,85 +833,4 @@ sal_uInt8 BitmapEx::GetTransparency(sal_
 }
 
 // ------------------------------------------------------------------
-
-SvStream& operator<<( SvStream& rOStm, const BitmapEx& rBitmapEx )
-{
-	rBitmapEx.aBitmap.Write( rOStm );
-
-	rOStm << (sal_uInt32) 0x25091962;
-	rOStm << (sal_uInt32) 0xACB20201;
-	rOStm << (sal_uInt8) rBitmapEx.eTransparent;
-
-	if( rBitmapEx.eTransparent == TRANSPARENT_BITMAP )
-		rBitmapEx.aMask.Write( rOStm );
-	else if( rBitmapEx.eTransparent == TRANSPARENT_COLOR )
-		rOStm << rBitmapEx.aTransparentColor;
-
-	return rOStm;
-}
-
-// ------------------------------------------------------------------
-
-SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
-{
-	Bitmap aBmp;
-
-	rIStm >> aBmp;
-
-	if( !rIStm.GetError() )
-	{
-		const sal_uLong nStmPos = rIStm.Tell();
-		sal_uInt32		nMagic1 = 0;
-		sal_uInt32		nMagic2 = 0;
-
-		rIStm >> nMagic1 >> nMagic2;
-
-		if( ( nMagic1 != 0x25091962 ) || ( nMagic2 != 0xACB20201 ) || rIStm.GetError() )
-		{
-			rIStm.ResetError();
-			rIStm.Seek( nStmPos );
-			rBitmapEx = aBmp;
-		}
-		else
-		{
-			sal_uInt8 bTransparent = false;
-
-			rIStm >> bTransparent;
-
-			if( bTransparent == (sal_uInt8) TRANSPARENT_BITMAP )
-			{
-				Bitmap aMask;
-
-				rIStm >> aMask;
-
-				if( !!aMask)
-				{
-					// do we have an alpha mask?
-					if( ( 8 == aMask.GetBitCount() ) && aMask.HasGreyPalette() )
-					{
-						AlphaMask aAlpha;
-
-						// create alpha mask quickly (without greyscale conversion)
-						aAlpha.ImplSetBitmap( aMask );
-						rBitmapEx = BitmapEx( aBmp, aAlpha );
-					}
-					else
-						rBitmapEx = BitmapEx( aBmp, aMask );
-				}
-				else
-					rBitmapEx = aBmp;
-			}
-			else if( bTransparent == (sal_uInt8) TRANSPARENT_COLOR )
-			{
-				Color aTransparentColor;
-
-				rIStm >> aTransparentColor;
-				rBitmapEx = BitmapEx( aBmp, aTransparentColor );
-			}
-			else
-				rBitmapEx = aBmp;
-		}
-	}
-
-	return rIStm;
-}
+// eof

Modified: openoffice/trunk/main/vcl/source/gdi/bmpacc2.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/bmpacc2.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/bmpacc2.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/bmpacc2.cxx Thu Jan 10 17:28:40 2013
@@ -315,7 +315,7 @@ IMPL_FORMAT_SETPIXEL_NOMASK( _32BIT_TC_R
 IMPL_FORMAT_GETPIXEL( _32BIT_TC_MASK )
 {
 	BitmapColor aColor;
-	rMask.GetColorFor32Bit( aColor, pScanline + ( nX << 2UL ) );
+    rMask.GetColorFor32Bit( aColor, pScanline + ( nX << 2UL ) );
 	return aColor;
 }
 

Modified: openoffice/trunk/main/vcl/source/gdi/bmpconv.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/bmpconv.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/bmpconv.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/bmpconv.cxx Thu Jan 10 17:28:40 2013
@@ -19,8 +19,6 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"
 
@@ -32,7 +30,7 @@
 #include "com/sun/star/script/XInvocation.hpp"
 #include "com/sun/star/awt/XBitmap.hpp"
 #include "cppuhelper/compbase1.hxx"
-
+#include <vcl/dibtools.hxx>
 
 using namespace com::sun::star::uno;
 using namespace com::sun::star::script;
@@ -149,7 +147,9 @@ Any SAL_CALL BmpConverter::invoke(
 
         SvMemoryStream aStream( aDIB.getArray(), aDIB.getLength(), STREAM_READ | STREAM_WRITE );
         Bitmap aBM;
-        aBM.Read( aStream, sal_True );
+        
+        ReadDIB(aBM, aStream, true);
+        
         if( nTargetDepth < 4 )
             nTargetDepth = 1;
         else if( nTargetDepth < 8 )
@@ -183,8 +183,11 @@ BmpTransporter::BmpTransporter( const Bi
 {
     m_aSize.Width = rBM.GetSizePixel().Width();
     m_aSize.Height = rBM.GetSizePixel().Height();
+    
     SvMemoryStream aStream;
-    rBM.Write( aStream, sal_False, sal_True );
+
+    WriteDIB(rBM, aStream, false, true);
+
     m_aBM = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aStream.GetData()),
                 aStream.GetEndOfData());
 }

Modified: openoffice/trunk/main/vcl/source/gdi/cvtsvm.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/cvtsvm.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/cvtsvm.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/cvtsvm.cxx Thu Jan 10 17:28:40 2013
@@ -36,6 +36,7 @@
 #include <vcl/lineinfo.hxx>
 #include <vcl/salbtype.hxx>
 #include <vcl/cvtsvm.hxx>
+#include <vcl/dibtools.hxx>
 
 // -----------
 // - Defines -
@@ -983,7 +984,8 @@ void SVMConverter::ImplConvertFromSVM1( 
 				{
 					Bitmap aBmp;
 
-					rIStm >> aPt >> aBmp;
+					rIStm >> aPt;
+                    ReadDIB(aBmp, rIStm, true);
 					rMtf.AddAction( new MetaBmpAction( aPt, aBmp ) );
 				}
 				break;
@@ -992,7 +994,8 @@ void SVMConverter::ImplConvertFromSVM1( 
 				{
 					Bitmap aBmp;
 
-					rIStm >> aPt >> aSz >> aBmp;
+					rIStm >> aPt >> aSz;
+                    ReadDIB(aBmp, rIStm, true);
 					rMtf.AddAction( new MetaBmpScaleAction( aPt, aSz, aBmp ) );
 				}
 				break;
@@ -1002,7 +1005,8 @@ void SVMConverter::ImplConvertFromSVM1( 
 					Bitmap	aBmp;
 					Size	aSz2;
 
-					rIStm >> aPt >> aSz >> aPt1 >> aSz2 >> aBmp;
+					rIStm >> aPt >> aSz >> aPt1 >> aSz2;
+                    ReadDIB(aBmp, rIStm, true);
 					rMtf.AddAction( new MetaBmpScalePartAction( aPt, aSz, aPt1, aSz2, aBmp ) );
 				}
 				break;
@@ -1827,7 +1831,7 @@ sal_uLong SVMConverter::ImplWriteActions
 				rOStm << (sal_Int16) GDI_BITMAP_ACTION;
 				rOStm << (sal_Int32) 12;
 				rOStm << pAct->GetPoint();
-				rOStm << pAct->GetBitmap();
+                WriteDIB(pAct->GetBitmap(), rOStm, false, true);
 				nCount++;
 			}
 			break;
@@ -1840,7 +1844,7 @@ sal_uLong SVMConverter::ImplWriteActions
 				rOStm << (sal_Int32) 20;
 				rOStm << pAct->GetPoint();
 				rOStm << pAct->GetSize();
-				rOStm << pAct->GetBitmap();
+                WriteDIB(pAct->GetBitmap(), rOStm, false, true);
 				nCount++;
 			}
 			break;
@@ -1855,7 +1859,7 @@ sal_uLong SVMConverter::ImplWriteActions
 				rOStm << pAct->GetDestSize();
 				rOStm << pAct->GetSrcPoint();
 				rOStm << pAct->GetSrcSize();
-				rOStm << pAct->GetBitmap();
+                WriteDIB(pAct->GetBitmap(), rOStm, false, true);
 				nCount++;
 			}
 			break;
@@ -1868,7 +1872,7 @@ sal_uLong SVMConverter::ImplWriteActions
 				rOStm << (sal_Int16) GDI_BITMAP_ACTION;
 				rOStm << (sal_Int32) 12;
 				rOStm << pAct->GetPoint();
-				rOStm << aBmp;
+                WriteDIB(aBmp, rOStm, false, true);
 				nCount++;
 			}
 			break;
@@ -1882,7 +1886,7 @@ sal_uLong SVMConverter::ImplWriteActions
 				rOStm << (sal_Int32) 20;
 				rOStm << pAct->GetPoint();
 				rOStm << pAct->GetSize();
-				rOStm << aBmp;
+                WriteDIB(aBmp, rOStm, false, true);
 				nCount++;
 			}
 			break;
@@ -1898,7 +1902,7 @@ sal_uLong SVMConverter::ImplWriteActions
 				rOStm << pAct->GetDestSize();
 				rOStm << pAct->GetSrcPoint();
 				rOStm << pAct->GetSrcSize();
-				rOStm << aBmp;
+                WriteDIB(aBmp, rOStm, false, true);
 				nCount++;
 			}
 			break;

Modified: openoffice/trunk/main/vcl/source/gdi/impgraph.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/impgraph.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/impgraph.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/impgraph.cxx Thu Jan 10 17:28:40 2013
@@ -19,8 +19,6 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"
 
@@ -40,6 +38,7 @@
 #include <vcl/metaact.hxx>
 #include <impgraph.hxx>
 #include <com/sun/star/ucb/CommandAbortedException.hpp>
+#include <vcl/dibtools.hxx>
 
 // -----------
 // - Defines -
@@ -1794,7 +1793,7 @@ SvStream& operator>>( SvStream& rIStm, I
 
 			    rIStm.SeekRel( -4 );
 			    rIStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
-			    rIStm >> aBmpEx;
+                ReadDIBBitmapEx(aBmpEx, rIStm);
 
 			    if( !rIStm.GetError() )
 			    {
@@ -1937,7 +1936,7 @@ SvStream& operator<<( SvStream& rOStm, c
                         }
 						else
                         {
-							rOStm << rImpGraphic.maEx;
+                            WriteDIBBitmapEx(rImpGraphic.maEx, rOStm);
                         }
 					}
 					break;

Modified: openoffice/trunk/main/vcl/source/gdi/impimagetree.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/impimagetree.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/impimagetree.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/impimagetree.cxx Thu Jan 10 17:28:40 2013
@@ -19,18 +19,14 @@
  * 
  *************************************************************/
 
-
-
 #include "precompiled_vcl.hxx"
 
 #include "sal/config.h"
-
 #include <list>
 #include <memory>
 #include <utility>
 #include <vector>
 #include <hash_map>
-
 #include "com/sun/star/container/XNameAccess.hpp"
 #include "com/sun/star/io/XInputStream.hpp"
 #include "com/sun/star/lang/Locale.hpp"
@@ -39,30 +35,24 @@
 #include "com/sun/star/uno/Reference.hxx"
 #include "com/sun/star/uno/RuntimeException.hpp"
 #include "com/sun/star/uno/Sequence.hxx"
-
 #include "comphelper/processfactory.hxx"
-
 #include "osl/file.hxx"
 #include "osl/diagnose.h"
-
 #include "rtl/bootstrap.hxx"
 #include "rtl/string.h"
 #include "rtl/textenc.h"
 #include "rtl/ustrbuf.hxx"
 #include "rtl/ustring.h"
 #include "rtl/ustring.hxx"
-
 #include "sal/types.h"
-
 #include "tools/stream.hxx"
 #include "tools/urlobj.hxx"
-
 #include "vcl/bitmapex.hxx"
 #include "vcl/pngread.hxx"
 #include "vcl/settings.hxx"
 #include "vcl/svapp.hxx"
-
 #include "impimagetree.hxx"
+#include <vcl/dibtools.hxx>
 
 namespace {
 
@@ -109,8 +99,10 @@ void loadFromStream(
 		vcl::PNGReader aPNGReader( *s );
 		aPNGReader.SetIgnoreGammaChunk( sal_True );
         bitmap = aPNGReader.Read();
-    } else {
-        *s >> bitmap;
+    } 
+    else 
+    {
+        ReadDIBBitmapEx(bitmap, *s);
     }
 }
 

Modified: openoffice/trunk/main/vcl/source/gdi/metaact.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/metaact.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/metaact.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/metaact.cxx Thu Jan 10 17:28:40 2013
@@ -19,8 +19,6 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"
 
@@ -34,8 +32,8 @@
 #include <vcl/salbtype.hxx>
 #include <vcl/metaact.hxx>
 #include <vcl/graphictools.hxx>
-//#include <svgio/svgreader/svgreader.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <vcl/dibtools.hxx>
 
 // ========================================================================
 
@@ -1832,7 +1830,8 @@ void MetaBmpAction::Write( SvStream& rOS
 	if( !!maBmp )
 	{
 		WRITE_BASE_COMPAT( rOStm, 1, pData );
-		rOStm << maBmp << maPt;
+        WriteDIB(maBmp, rOStm, false, true);
+		rOStm << maPt;
 	}
 }
 
@@ -1841,7 +1840,8 @@ void MetaBmpAction::Write( SvStream& rOS
 void MetaBmpAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
 	COMPAT( rIStm );
-	rIStm >> maBmp >> maPt;
+    ReadDIB(maBmp, rIStm, true);
+	rIStm >> maPt;
 }
 
 // ========================================================================
@@ -1908,7 +1908,8 @@ void MetaBmpScaleAction::Write( SvStream
 	if( !!maBmp )
 	{
 		WRITE_BASE_COMPAT( rOStm, 1, pData );
-		rOStm << maBmp << maPt << maSz;
+        WriteDIB(maBmp, rOStm, false, true);
+		rOStm << maPt << maSz;
 	}
 }
 
@@ -1917,7 +1918,8 @@ void MetaBmpScaleAction::Write( SvStream
 void MetaBmpScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
 	COMPAT( rIStm );
-	rIStm >> maBmp >> maPt >> maSz;
+    ReadDIB(maBmp, rIStm, true);
+	rIStm >> maPt >> maSz;
 }
 
 // ========================================================================
@@ -1989,7 +1991,8 @@ void MetaBmpScalePartAction::Write( SvSt
 	if( !!maBmp )
 	{
 		WRITE_BASE_COMPAT( rOStm, 1, pData );
-		rOStm << maBmp << maDstPt << maDstSz << maSrcPt << maSrcSz;
+        WriteDIB(maBmp, rOStm, false, true);
+		rOStm << maDstPt << maDstSz << maSrcPt << maSrcSz;
 	}
 }
 
@@ -1998,7 +2001,8 @@ void MetaBmpScalePartAction::Write( SvSt
 void MetaBmpScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
 	COMPAT( rIStm );
-	rIStm >> maBmp >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
+    ReadDIB(maBmp, rIStm, true);
+	rIStm >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
 }
 
 // ========================================================================
@@ -2059,7 +2063,8 @@ void MetaBmpExAction::Write( SvStream& r
 	if( !!maBmpEx.GetBitmap() )
 	{
 		WRITE_BASE_COMPAT( rOStm, 1, pData );
-		rOStm << maBmpEx << maPt;
+        WriteDIBBitmapEx(maBmpEx, rOStm);
+		rOStm << maPt;
 	}
 }
 
@@ -2068,7 +2073,8 @@ void MetaBmpExAction::Write( SvStream& r
 void MetaBmpExAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
 	COMPAT( rIStm );
-	rIStm >> maBmpEx >> maPt;
+    ReadDIBBitmapEx(maBmpEx, rIStm);
+	rIStm >> maPt;
 }
 
 // ========================================================================
@@ -2135,7 +2141,8 @@ void MetaBmpExScaleAction::Write( SvStre
 	if( !!maBmpEx.GetBitmap() )
 	{
 		WRITE_BASE_COMPAT( rOStm, 1, pData );
-		rOStm << maBmpEx << maPt << maSz;
+        WriteDIBBitmapEx(maBmpEx, rOStm);
+		rOStm << maPt << maSz;
 	}
 }
 
@@ -2144,7 +2151,8 @@ void MetaBmpExScaleAction::Write( SvStre
 void MetaBmpExScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
 	COMPAT( rIStm );
-	rIStm >> maBmpEx >> maPt >> maSz;
+    ReadDIBBitmapEx(maBmpEx, rIStm);
+	rIStm >> maPt >> maSz;
 }
 
 // ========================================================================
@@ -2216,7 +2224,8 @@ void MetaBmpExScalePartAction::Write( Sv
 	if( !!maBmpEx.GetBitmap() )
 	{
 		WRITE_BASE_COMPAT( rOStm, 1, pData );
-		rOStm << maBmpEx << maDstPt << maDstSz << maSrcPt << maSrcSz;
+        WriteDIBBitmapEx(maBmpEx, rOStm);
+		rOStm << maDstPt << maDstSz << maSrcPt << maSrcSz;
 	}
 }
 
@@ -2225,7 +2234,8 @@ void MetaBmpExScalePartAction::Write( Sv
 void MetaBmpExScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
 	COMPAT( rIStm );
-	rIStm >> maBmpEx >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
+    ReadDIBBitmapEx(maBmpEx, rIStm);
+	rIStm >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
 }
 
 // ========================================================================
@@ -2290,7 +2300,8 @@ void MetaMaskAction::Write( SvStream& rO
 	if( !!maBmp )
 	{
 		WRITE_BASE_COMPAT( rOStm, 1, pData );
-		rOStm << maBmp << maPt;
+        WriteDIB(maBmp, rOStm, false, true);
+		rOStm << maPt;
 	}
 }
 
@@ -2299,7 +2310,8 @@ void MetaMaskAction::Write( SvStream& rO
 void MetaMaskAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
 	COMPAT( rIStm );
-	rIStm >> maBmp >> maPt;
+    ReadDIB(maBmp, rIStm, true);
+	rIStm >> maPt;
 }
 
 // ========================================================================
@@ -2369,7 +2381,8 @@ void MetaMaskScaleAction::Write( SvStrea
 	if( !!maBmp )
 	{
 		WRITE_BASE_COMPAT( rOStm, 1, pData );
-		rOStm << maBmp << maPt << maSz;
+        WriteDIB(maBmp, rOStm, false, true);
+		rOStm << maPt << maSz;
 	}
 }
 
@@ -2378,7 +2391,8 @@ void MetaMaskScaleAction::Write( SvStrea
 void MetaMaskScaleAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
 	COMPAT( rIStm );
-	rIStm >> maBmp >> maPt >> maSz;
+    ReadDIB(maBmp, rIStm, true);
+	rIStm >> maPt >> maSz;
 }
 
 // ========================================================================
@@ -2453,7 +2467,7 @@ void MetaMaskScalePartAction::Write( SvS
 	if( !!maBmp )
 	{
 		WRITE_BASE_COMPAT( rOStm, 1, pData );
-		rOStm << maBmp;
+        WriteDIB(maBmp, rOStm, false, true);
 		maColor.Write( rOStm, sal_True );
 		rOStm << maDstPt << maDstSz << maSrcPt << maSrcSz;
 	}
@@ -2464,7 +2478,7 @@ void MetaMaskScalePartAction::Write( SvS
 void MetaMaskScalePartAction::Read( SvStream& rIStm, ImplMetaReadData* )
 {
 	COMPAT( rIStm );
-	rIStm >> maBmp;
+    ReadDIB(maBmp, rIStm, true);
 	maColor.Read( rIStm, sal_True );
 	rIStm >> maDstPt >> maDstSz >> maSrcPt >> maSrcSz;
 }

Modified: openoffice/trunk/main/vcl/source/gdi/pdfwriter_impl2.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/pdfwriter_impl2.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/pdfwriter_impl2.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/pdfwriter_impl2.cxx Thu Jan 10 17:28:40 2013
@@ -172,7 +172,7 @@ void PDFWriterImpl::implWriteBitmapEx( c
 					SvMemoryStream aTemp;
 					aTemp.SetCompressMode( aTemp.GetCompressMode() | COMPRESSMODE_ZBITMAP );
 					aTemp.SetVersion( SOFFICE_FILEFORMAT_40 );	// sj: up from version 40 our bitmap stream operator
-					aTemp << aBitmapEx;							// is capable of zlib stream compression
+                    WriteDIBBitmapEx(aBitmapEx, aTemp); // is capable of zlib stream compression
 					aTemp.Seek( STREAM_SEEK_TO_END );
 					nZippedFileSize = aTemp.Tell();
 				}

Modified: openoffice/trunk/main/vcl/source/gdi/wall.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/wall.cxx?rev=1431512&r1=1431511&r2=1431512&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/wall.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/wall.cxx Thu Jan 10 17:28:40 2013
@@ -19,22 +19,18 @@
  * 
  *************************************************************/
 
-
-
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"
 
 #include <tools/stream.hxx>
 #include <tools/vcompat.hxx>
 #include <tools/debug.hxx>
-
 #include <vcl/bitmapex.hxx>
 #include <vcl/gradient.hxx>
 #include <vcl/wall.hxx>
 #include <vcl/svapp.hxx>
-
 #include <wall2.hxx>
-
+#include <vcl/dibtools.hxx>
 
 DBG_NAME( Wallpaper )
 
@@ -147,7 +143,7 @@ SvStream& operator>>( SvStream& rIStm, I
 		if( bBmp )
 		{
 			rImplWallpaper.mpBitmap = new BitmapEx;
-			rIStm >> *rImplWallpaper.mpBitmap;
+            ReadDIBBitmapEx(*rImplWallpaper.mpBitmap, rIStm);
 		}
 
 		// version 3 (new color format)
@@ -183,7 +179,7 @@ SvStream& operator<<( SvStream& rOStm, c
 		rOStm << *rImplWallpaper.mpGradient;
 
 	if( bBmp )
-		rOStm << *rImplWallpaper.mpBitmap;
+		WriteDIBBitmapEx(*rImplWallpaper.mpBitmap, rOStm);
 
 	// version 3 (new color format)
 	( (Color&) rImplWallpaper.maColor ).Write( rOStm, sal_True );