Kaydet (Commit) 05ef2934 authored tarafından Sven Jacobi's avatar Sven Jacobi

#95793# improved eps detection

üst 10adb58b
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: filter.cxx,v $ * $RCSfile: filter.cxx,v $
* *
* $Revision: 1.40 $ * $Revision: 1.41 $
* *
* last change: $Author: sj $ $Date: 2002-04-17 12:09:52 $ * last change: $Author: sj $ $Date: 2002-04-18 17:09:20 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -289,7 +289,7 @@ BOOL ImpFilterCallback( void* pCallerData, USHORT nPercent ) ...@@ -289,7 +289,7 @@ BOOL ImpFilterCallback( void* pCallerData, USHORT nPercent )
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize ) BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize )
{ {
while ( nComp-- >= nSize ) while ( nComp-- >= nSize )
{ {
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: filter2.cxx,v $ * $RCSfile: filter2.cxx,v $
* *
* $Revision: 1.7 $ * $Revision: 1.8 $
* *
* last change: $Author: ka $ $Date: 2001-12-05 12:28:44 $ * last change: $Author: sj $ $Date: 2002-04-18 17:09:20 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -73,6 +73,9 @@ ...@@ -73,6 +73,9 @@
#define DATA_SIZE 640 #define DATA_SIZE 640
BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG );
/************************************************************************* /*************************************************************************
|* |*
|* |*
...@@ -1144,11 +1147,18 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL bExtendedInfo ) ...@@ -1144,11 +1147,18 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL bExtendedInfo )
// es wird die EPS mit Vorschaubild Variante und die Extensionbereinstimmung // es wird die EPS mit Vorschaubild Variante und die Extensionbereinstimmung
// geprft // geprft
UINT32 nFirstLong; sal_uInt32 nFirstLong;
sal_uInt8 nFirstBytes[20];
rStm.Seek( nStmPos ); rStm.Seek( nStmPos );
rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
rStm >> nFirstLong; rStm >> nFirstLong;
if ( ( nFirstLong == 0xC5D0D3C6 ) || ( aPathExt.CompareToAscii( "eps", 3 ) == COMPARE_EQUAL ) ) rStm.SeekRel( -4 );
rStm.Read( &nFirstBytes, 20 );
if ( ( nFirstLong == 0xC5D0D3C6 ) || ( aPathExt.CompareToAscii( "eps", 3 ) == COMPARE_EQUAL ) ||
( ImplSearchEntry( nFirstBytes, (sal_uInt8*)"%!PS-Adobe", 10, 10 )
&& ImplSearchEntry( &nFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) )
{ {
nFormat = GFF_EPS; nFormat = GFF_EPS;
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment