diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-09-28 10:28:25 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2005-09-28 10:28:25 +0000 |
commit | c63b2073f596181e166d6687e11f7ada5e8e2df0 (patch) | |
tree | ae383e3d1f95e7e9fc23c4b2633761bb656c7db3 /svtools | |
parent | d4cd0913cd5af7b46c1ecc026d73fed3bf4bdcb9 (diff) |
INTEGRATION: CWS sj23 (1.11.34); FILE MERGED
2005/08/31 12:03:16 sj 1.11.34.2: #i53914# fixed crash when saving eps action
2005/08/30 17:22:41 sj 1.11.34.1: #i53914# fixed crash when saving eps action
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/filter.vcl/wmf/emfwr.cxx | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx index 604eb6be4c22..a46d8c64995f 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.cxx +++ b/svtools/source/filter.vcl/wmf/emfwr.cxx @@ -4,9 +4,9 @@ * * $RCSfile: emfwr.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: rt $ $Date: 2005-09-08 15:45:02 $ + * last change: $Author: hr $ $Date: 2005-09-28 11:28:25 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1045,19 +1045,30 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case( META_EPS_ACTION ): { const MetaEPSAction* pA = (const MetaEPSAction*) pAction; - const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() ); - sal_Bool bFound = sal_False; + const GDIMetaFile aSubstitute( pA->GetSubstitute() ); - for( ULONG i = 0, nCount = aGDIMetaFile.GetActionCount(); ( i < nCount ) && !bFound; i++ ) + for( ULONG i = 0, nCount = aSubstitute.GetActionCount(); i < nCount; i++ ) { - const MetaAction* pSubstAct = aGDIMetaFile.GetAction( i ); - + const MetaAction* pSubstAct = aSubstitute.GetAction( i ); if( pSubstAct->GetType() == META_BMPSCALE_ACTION ) { - bFound = sal_True; - const MetaBmpScaleAction* pBmpScaleAction = (const MetaBmpScaleAction*) pAction; - ImplWriteBmpRecord( pBmpScaleAction->GetBitmap(), pBmpScaleAction->GetPoint(), - pBmpScaleAction->GetSize(), WIN_SRCCOPY ); + maVDev.Push( PUSH_ALL ); + ImplBeginRecord( WIN_EMR_SAVEDC ); + ImplEndRecord(); + + MapMode aMapMode( aSubstitute.GetPrefMapMode() ); + Size aOutSize( maVDev.LogicToLogic( pA->GetSize(), maVDev.GetMapMode(), aMapMode ) ); + aMapMode.SetScaleX( Fraction( aOutSize.Width(), aSubstitute.GetPrefSize().Width() ) ); + aMapMode.SetScaleY( Fraction( aOutSize.Height(), aSubstitute.GetPrefSize().Height() ) ); + aMapMode.SetOrigin( maVDev.LogicToLogic( pA->GetPoint(), maVDev.GetMapMode(), aMapMode ) ); + maVDev.SetMapMode( aMapMode ); + ImplWrite( aSubstitute ); + + maVDev.Pop(); + ImplBeginRecord( WIN_EMR_RESTOREDC ); + (*mpStm) << (INT32) -1; + ImplEndRecord(); + break; } } } |