Index: sw/source/filter/ww8/ww8par.cxx
===================================================================
RCS file: /cvs/sw/sw/source/filter/ww8/ww8par.cxx,v
retrieving revision 1.180
retrieving revision 1.180.26.1
diff -u -p -r1.180 -r1.180.26.1
--- sw/source/filter/ww8/ww8par.cxx	18 Jul 2007 14:46:00 -0000	1.180
+++ sw/source/filter/ww8/ww8par.cxx	25 Oct 2007 14:21:00 -0000	1.180.26.1
@@ -878,6 +878,8 @@ SdrObject* SwMSDffManager::ProcessObj(Sv
 							: (MSO_LineStyle)USHRT_MAX;
 		pTextImpRec->eLineStyle = pImpRec->eLineStyle;
 
+        pImpRec->nFlags = rObjData.nSpFlags;
+
 		if( pImpRec->nShapeId )
 		{
 			// Import-Record-Liste ergaenzen
@@ -3357,10 +3359,16 @@ void wwSectionManager::SetSegmentToPageD
         SdrObject* pObject = 0;
         if (mrReader.pMSDffManager->GetShape(0x401, pObject, aData))
         {
-            SfxItemSet aSet(rFmt.GetAttrSet());
-            mrReader.MatchSdrItemsIntoFlySet(pObject, aSet, mso_lineSimple,
-                mso_sptRectangle, aRect);
-            rFmt.SetAttr(aSet.Get(RES_BACKGROUND));
+            SvxMSDffImportRec * pRec = aData.GetRecord(0);
+
+            // Only handle shape if it is a background shape
+            if ((pRec->nFlags & 0x400) != 0)
+            {
+                SfxItemSet aSet(rFmt.GetAttrSet());
+                mrReader.MatchSdrItemsIntoFlySet(pObject, aSet, mso_lineSimple,
+                                                 mso_sptRectangle, aRect);
+                rFmt.SetAttr(aSet.Get(RES_BACKGROUND));
+            }
         }
     }
     wwULSpaceData aULData;
Index: svx/inc/svx/msdffimp.hxx
===================================================================
RCS file: /cvs/graphics/svx/inc/svx/msdffimp.hxx,v
retrieving revision 1.2
retrieving revision 1.2.194.1
diff -u -p -r1.2 -r1.2.194.1
--- svx/inc/svx/msdffimp.hxx	11 Apr 2007 16:00:36 -0000	1.2
+++ svx/inc/svx/msdffimp.hxx	25 Oct 2007 14:24:04 -0000	1.2.194.1
@@ -215,6 +215,7 @@ struct SVX_DLLPUBLIC SvxMSDffImportRec
 	UINT32		nYAlign;
 	UINT32		nYRelTo;
 	UINT32		nLayoutInTableCell;
+    UINT32      nFlags;
 	long		nTextRotationAngle;
 	long		nDxTextLeft;	// Abstand der Textbox vom umgebenden Shape
 	long		nDyTextTop;
