summaryrefslogtreecommitdiff
path: root/dtrans/source/win32/dtobj/FmtFilter.cxx
diff options
context:
space:
mode:
authorKai Ahrens <ka@openoffice.org>2001-03-16 11:58:01 +0000
committerKai Ahrens <ka@openoffice.org>2001-03-16 11:58:01 +0000
commita184eda6e2ca418c02c9cfc015e77c2c8d484dc8 (patch)
treed9a98436659545b1e809de95260819fafc38c060 /dtrans/source/win32/dtobj/FmtFilter.cxx
parent24475651ad002732682dbf1a800b98502419f522 (diff)
#81798#: handling for CF_METAFILEPICT is now correct
Diffstat (limited to 'dtrans/source/win32/dtobj/FmtFilter.cxx')
-rw-r--r--dtrans/source/win32/dtobj/FmtFilter.cxx27
1 files changed, 20 insertions, 7 deletions
diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx
index 0c9c875a682e..6c809d80583a 100644
--- a/dtrans/source/win32/dtobj/FmtFilter.cxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: FmtFilter.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: tra $ $Date: 2001-03-05 06:36:22 $
+ * last change: $Author: ka $ $Date: 2001-03-16 12:57:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -169,13 +169,26 @@ Sequence< sal_Int8 > SAL_CALL WinMFPictToOOMFPict( Sequence< sal_Int8 >& aMetaFi
// convert a openoffice metafile picture to a windows metafile picture
//------------------------------------------------------------------------
-HMETAFILE SAL_CALL OOMFPictToWinMFPict( Sequence< sal_Int8 >& aOOMetaFilePict )
+HMETAFILEPICT SAL_CALL OOMFPictToWinMFPict( Sequence< sal_Int8 >& aOOMetaFilePict )
{
- OSL_ASSERT( aOOMetaFilePict.getLength( ) > sizeof( METAFILEHEADER ) );
+ OSL_ASSERT( aOOMetaFilePict.getLength() > 22 );
- return SetMetaFileBitsEx(
- aOOMetaFilePict.getLength( ) - sizeof( METAFILEHEADER ),
- reinterpret_cast< BYTE* >( aOOMetaFilePict.getArray( ) ) + sizeof( METAFILEHEADER ) );
+ HMETAFILEPICT hPict = NULL;
+ HMETAFILE hMtf = SetMetaFileBitsEx( aOOMetaFilePict.getLength() - 22, (sal_uChar*) aOOMetaFilePict.getConstArray() + 22 );
+
+ if( hMtf )
+ {
+ METAFILEPICT* pPict = (METAFILEPICT*) GlobalLock( hPict = GlobalAlloc( GHND, sizeof( METAFILEPICT ) ) );
+
+ pPict->mm = 8;
+ pPict->xExt = 0;
+ pPict->yExt = 0;
+ pPict->hMF = hMtf;
+
+ GlobalUnlock( hPict );
+ }
+
+ return hPict;
}
//------------------------------------------------------------------------