From 4a8256a93d4bb2bda592c525613a2fc9cacdb28c Mon Sep 17 00:00:00 2001 From: Sven Jacobi Date: Tue, 20 Oct 2009 11:37:58 +0000 Subject: #i102257# fixed gpf when loading some types of pict graphics --- svx/source/msfilter/msdffimp.cxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'svx') diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx index 0e751e3181e7..087e13e88f3c 100644 --- a/svx/source/msfilter/msdffimp.cxx +++ b/svx/source/msfilter/msdffimp.cxx @@ -4954,16 +4954,16 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r ApplyAttributes( rSt, aSet, aObjData ); pRet->SetMergedItemSet(aSet); } - else if ( aObjData.eShapeType == mso_sptLine ) - { - basegfx::B2DPolygon aPoly; - aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top())); - aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom())); - pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly)); - pRet->SetModel( pSdrModel ); - ApplyAttributes( rSt, aSet, aObjData ); - pRet->SetMergedItemSet(aSet); - } + else if ( aObjData.eShapeType == mso_sptLine ) + { + basegfx::B2DPolygon aPoly; + aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top())); + aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom())); + pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly)); + pRet->SetModel( pSdrModel ); + ApplyAttributes( rSt, aSet, aObjData ); + pRet->SetMergedItemSet(aSet); + } else { if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) ) @@ -7037,6 +7037,8 @@ BOOL SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect aZCodec.Decompress( rBLIPStream, *pOut ); aZCodec.EndCompression(); pOut->Seek( STREAM_SEEK_TO_BEGIN ); + pOut->SetResizeOffset( 0 ); // sj: #i102257# setting ResizeOffset of 0 prevents from seeking + // behind the stream end (allocating too much memory) pGrStream = pOut; } -- cgit