diff -rup svtools-clean/source/filter.vcl/wmf/enhwmf.cxx svtools/source/filter.vcl/wmf/enhwmf.cxx
--- svtools-clean/source/filter.vcl/wmf/enhwmf.cxx	2007-06-04 15:15:09.000000000 +0200
+++ svtools/source/filter.vcl/wmf/enhwmf.cxx	2007-06-04 17:12:21.000000000 +0200
@@ -857,7 +858,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
                         aBitmap.Crop( aCropRect );
                     }
 				}
-				aBmpSaveList.Insert( new BSaveStruct( aBitmap, aRect, dwRop ), LIST_APPEND );
+				aBmpSaveList.Insert( new BSaveStruct( aBitmap, aRect, dwRop, pOut->GetFillStyle () ), LIST_APPEND );
 			}
 			break;
 
@@ -904,7 +905,7 @@ BOOL EnhWMFReader::ReadEnhWMF()
                     aBitmap.Crop( aCropRect );
                 }
 
-				aBmpSaveList.Insert( new BSaveStruct( aBitmap, aRect, dwRop ), LIST_APPEND );
+				aBmpSaveList.Insert( new BSaveStruct( aBitmap, aRect, dwRop, pOut->GetFillStyle () ), LIST_APPEND );
 			}
 			break;
 
@@ -1152,6 +1153,49 @@ BOOL EnhWMFReader::ReadEnhWMF()
             }
             break;
 
+            case EMR_CREATEDIBPATTERNBRUSHPT :
+            {
+                static int count = 0;
+				UINT32	nStart = pWMF->Tell() - 8;
+                Bitmap aBitmap;
+
+				*pWMF >> nIndex;
+
+				if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
+				{
+                    UINT32 usage, offBmi, cbBmi, offBits, cbBits;
+
+                    *pWMF >> usage;
+                    *pWMF >> offBmi;
+                    *pWMF >> cbBmi;
+                    *pWMF >> offBits;
+                    *pWMF >> cbBits;
+
+                    if ( offBmi )
+                    {
+                        UINT32	nSize = cbBmi + cbBits + 14;
+                        char*	pBuf = new char[ nSize ];
+
+                        SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE );
+                        aTmp.ObjectOwnsMemory( TRUE );
+                        aTmp << (BYTE)'B'
+                             << (BYTE)'M'
+                             << (UINT32)cbBits
+                             << (UINT16)0
+                             << (UINT16)0
+                             << (UINT32)cbBmi + 14;
+                        pWMF->Seek( nStart + offBmi );
+                        pWMF->Read( pBuf + 14, cbBmi );
+                        pWMF->Seek( nStart + offBits );
+                        pWMF->Read( pBuf + 14 + cbBmi, cbBits );
+                        aTmp.Seek( 0 );
+                        aBitmap.Read( aTmp, TRUE );
+                    }
+				}
+
+                pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( aBitmap ) );
+            }
+            break;
 
 #ifdef WIN_MTF_ASSERT
             default :                           WinMtfAssertHandler( "Unknown Meta Action" );       break;
@@ -1171,7 +1215,6 @@ BOOL EnhWMFReader::ReadEnhWMF()
 			case EMR_ANGLEARC :     	        WinMtfAssertHandler( "AngleArc" );                  break;
 			case EMR_SETCOLORADJUSTMENT :       WinMtfAssertHandler( "SetColorAdjustment" );	    break;
 			case EMR_POLYDRAW16 :		        WinMtfAssertHandler( "PolyDraw16" );                break;
-			case EMR_CREATEDIBPATTERNBRUSHPT :  WinMtfAssertHandler( "CreateDibPatternBrushPt" );   break;
 			case EMR_POLYTEXTOUTA : 		    WinMtfAssertHandler( "PolyTextOutA" );              break;
 			case EMR_POLYTEXTOUTW :			    WinMtfAssertHandler( "PolyTextOutW" );              break;
 			case EMR_CREATECOLORSPACE :         WinMtfAssertHandler( "CreateColorSpace" );	        break;
diff -rup svtools-clean/source/filter.vcl/wmf/winmtf.cxx svtools/source/filter.vcl/wmf/winmtf.cxx
--- svtools-clean/source/filter.vcl/wmf/winmtf.cxx	2007-06-04 15:15:09.000000000 +0200
+++ svtools/source/filter.vcl/wmf/winmtf.cxx	2007-06-04 17:09:48.000000000 +0200
@@ -39,6 +39,7 @@
 
 #include "winmtf.hxx"
 #include <vcl/metaact.hxx>
+#include <vcl/graphictools.hxx>
 #ifndef _SV_METRIC_HXX
 #include <vcl/metric.hxx>
 #endif
@@ -1046,7 +1048,8 @@ void WinMtfOutput::UpdateFillStyle()
 	if (!( maLatestFillStyle == maFillStyle ) )
 	{
 		maLatestFillStyle = maFillStyle;
-		mpGDIMetaFile->AddAction( new MetaFillColorAction( maFillStyle.aFillColor, !maFillStyle.bTransparent ) );
+        if (maFillStyle.aType == FillStyleSolid)
+            mpGDIMetaFile->AddAction( new MetaFillColorAction( maFillStyle.aFillColor, !maFillStyle.bTransparent ) );
 	}
 }
 
@@ -1374,7 +1377,35 @@ void WinMtfOutput::DrawPolygon( Polygon&
 			else
 			{
 				UpdateLineStyle();
-				mpGDIMetaFile->AddAction( new MetaPolygonAction( rPolygon ) );
+
+                if (maLatestFillStyle.aType != FillStylePattern)
+                    mpGDIMetaFile->AddAction( new MetaPolygonAction( rPolygon ) );
+                else {
+                    SvtGraphicFill aFill = SvtGraphicFill( PolyPolygon( rPolygon ),
+                                                           Color(),
+                                                           0.0,
+                                                           SvtGraphicFill::fillNonZero,
+                                                           SvtGraphicFill::fillTexture,
+                                                           SvtGraphicFill::Transform(),
+                                                           true,
+                                                           SvtGraphicFill::hatchSingle,
+                                                           Color(),
+                                                           SvtGraphicFill::gradientLinear,
+                                                           Color(),
+                                                           Color(),
+                                                           0,
+                                                           Graphic (maLatestFillStyle.aBmp) );
+
+                    SvMemoryStream  aMemStm;
+
+                    aMemStm << aFill;
+
+                    mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_BEGIN", 0,
+                                                            static_cast<const BYTE*>(aMemStm.GetData()),
+                                                            aMemStm.Seek( STREAM_SEEK_TO_END ) ) );
+                    mpGDIMetaFile->AddAction( new MetaCommentAction( "XPATHFILL_SEQ_END" ) );
+                }
+
 			}
 		}
 	}
@@ -1717,7 +1747,7 @@ void WinMtfOutput::ResolveBitmapActions(
 			if ( ( nRasterOperation & 0xaa ) != ( ( nRasterOperation & 0x55 ) << 1 ) )
 				nUsed |= 4;		// destination is used
 
-			if ( (nUsed & 1) && (( nUsed & 2 ) == 0) )
+			if ( (nUsed & 1) && (( nUsed & 2 ) == 0) && nWinRop != PATINVERT )
 			{	// patterns aren't well supported yet
 				sal_uInt32 nOldRop = SetRasterOp( ROP_OVERPAINT );	// in this case nRasterOperation is either 0 or 0xff
 				UpdateFillStyle();
diff -rup svtools-clean/source/filter.vcl/wmf/winmtf.hxx svtools/source/filter.vcl/wmf/winmtf.hxx
--- svtools-clean/source/filter.vcl/wmf/winmtf.hxx	2007-06-04 15:15:09.000000000 +0200
+++ svtools/source/filter.vcl/wmf/winmtf.hxx	2007-06-04 17:11:13.000000000 +0200
@@ -390,10 +390,17 @@ struct WinMtfFontStyle
 
 // -----------------------------------------------------------------------------
 
+typedef enum {
+    FillStyleSolid,
+    FillStylePattern
+} WinMtfFillStyleType;
+
 struct WinMtfFillStyle
 {
-	Color	aFillColor;
-	BOOL	bTransparent;
+	Color	            aFillColor;
+	BOOL	            bTransparent;
+    WinMtfFillStyleType aType;
+    Bitmap              aBmp;
 
 	WinMtfFillStyle() :
 		aFillColor	( Color( COL_BLACK ) ),
@@ -403,16 +410,23 @@ struct WinMtfFillStyle
 
 	WinMtfFillStyle( const Color& rColor, BOOL bTrans = FALSE ) :
 		aFillColor	( rColor ),
-		bTransparent( bTrans )
+		bTransparent( bTrans ),
+        aType       ( FillStyleSolid )
+	{
+	};
+
+	WinMtfFillStyle( Bitmap& rBmp ) :
+		aBmp ( rBmp ),
+        aType( FillStylePattern )
 	{
 	};
 
 	BOOL operator==( const WinMtfFillStyle& rStyle )
-		{ return ( ( aFillColor == rStyle.aFillColor ) && ( bTransparent == rStyle.bTransparent ) ); };
+		{ return ( ( aFillColor == rStyle.aFillColor ) && ( bTransparent == rStyle.bTransparent ) && ( aType == rStyle.aType ) ); };
 	BOOL operator==( WinMtfFillStyle* pStyle )
-		{ return ( ( aFillColor == pStyle->aFillColor ) && ( bTransparent == pStyle->bTransparent ) ); };
-	void operator=( const WinMtfFillStyle& rStyle ) { aFillColor = rStyle.aFillColor; bTransparent = rStyle.bTransparent; };
-	void operator=( WinMtfFillStyle* pStyle ) { aFillColor = pStyle->aFillColor; bTransparent = pStyle->bTransparent; };
+		{ return ( ( aFillColor == pStyle->aFillColor ) && ( bTransparent == pStyle->bTransparent ) && ( aType == pStyle->aType ) ); };
+	void operator=( const WinMtfFillStyle& rStyle ) { aFillColor = rStyle.aFillColor; bTransparent = rStyle.bTransparent; aBmp = rStyle.aBmp; aType = rStyle.aType; };
+	void operator=( WinMtfFillStyle* pStyle ) { aFillColor = pStyle->aFillColor; bTransparent = pStyle->bTransparent; aBmp = pStyle->aBmp; aType = pStyle->aType; };
 };
 
 // -----------------------------------------------------------------------------
@@ -504,12 +518,13 @@ typedef ::boost::shared_ptr< SaveStruct 
 
 struct BSaveStruct
 {
-	Bitmap		aBmp;
-	Rectangle	aOutRect;
-	UINT32		nWinRop;
+	Bitmap		    aBmp;
+	Rectangle	    aOutRect;
+	UINT32		    nWinRop;
+    WinMtfFillStyle aStyle;
 
-				BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, UINT32 nRop ) :
-					aBmp( rBmp ), aOutRect( rOutRect ), nWinRop( nRop ){};
+				BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, UINT32 nRop, WinMtfFillStyle& rStyle ) :
+					aBmp( rBmp ), aOutRect( rOutRect ), nWinRop( nRop ), aStyle ( rStyle ){};
 };
 
 // -----------------------------------------------------------------------------
@@ -664,6 +679,7 @@ class WinMtfOutput
 		void				DeleteObject( INT32 nIndex );
 		void				SelectObject( INT32 nIndex );
 		CharSet				GetCharSet(){ return maFont.GetCharSet(); };
+        WinMtfFillStyle&    GetFillStyle () { return maFillStyle; }
 		void				SetFont( const Font& rFont );
 		const Font&			GetFont() const;
 		void				SetTextLayoutMode( const sal_uInt32 nLayoutMode );
diff -rup svtools-clean/source/filter.vcl/wmf/winwmf.cxx svtools/source/filter.vcl/wmf/winwmf.cxx
--- svtools-clean/source/filter.vcl/wmf/winwmf.cxx	2007-06-04 15:15:09.000000000 +0200
+++ svtools/source/filter.vcl/wmf/winwmf.cxx	2007-06-04 15:16:38.000000000 +0200
@@ -570,7 +570,7 @@ void WMFReader::ReadRecordParams( USHORT
                         aBmp.Crop( aCropRect );
                     }
 					Rectangle aDestRect( aPoint, Size( nSxe, nSye ) );
-				    aBmpSaveList.Insert( new BSaveStruct( aBmp, aDestRect, nWinROP ), LIST_APPEND );
+				    aBmpSaveList.Insert( new BSaveStruct( aBmp, aDestRect, nWinROP, pOut->GetFillStyle () ), LIST_APPEND );
 				}
 			}
 		}		
@@ -620,7 +620,7 @@ void WMFReader::ReadRecordParams( USHORT
                         Rectangle aCropRect( Point( nSx, nSy ), Size( nSxe, nSye ) );
                         aBmp.Crop( aCropRect );
                     }
-				    aBmpSaveList.Insert( new BSaveStruct( aBmp, aDestRect, nWinROP ), LIST_APPEND );
+				    aBmpSaveList.Insert( new BSaveStruct( aBmp, aDestRect, nWinROP, pOut->GetFillStyle () ), LIST_APPEND );
                 }
 			}
 		}
