summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-01-11 10:44:13 +0000
committerArmin Le Grand <alg@apache.org>2012-01-11 10:44:13 +0000
commit740f4eb387e63b35ac1784a7a143315df22d1892 (patch)
tree01896624506a04d9f24e210ecaf1dc677e7c93e5 /svtools/source
parent64270dc07ce550a69acdf59fb7dae1e2fc73393e (diff)
#118728# changed indentifying definitions for Svg file detection
Notes
Notes: merged as: 44cfc7cb6533d827fd2d6e586d92c61d7d7f7a70
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/filter/filter.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index 2942ef925f19..f86f55c382c2 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -678,8 +678,10 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio
//--------------------------- SVG ------------------------------------
if( !bTest )
{
- if( ImplSearchEntry( sFirstBytes, (sal_uInt8*)"DOCTYPE", 256, 7 )
- && ImplSearchEntry( sFirstBytes, (sal_uInt8*)"svg", 256, 3 ) )
+ if( ImplSearchEntry( sFirstBytes, (sal_uInt8*)"<?xml", 256, 5 ) // is it xml
+ && ImplSearchEntry( sFirstBytes, (sal_uInt8*)"version", 256, 7 ) // does it have a version (required for xml)
+ && ImplSearchEntry( sFirstBytes, (sal_uInt8*)"www.w3.org", 256, 10 ) // does it have to do with w3 (part of namespace definition)
+ && ImplSearchEntry( sFirstBytes, (sal_uInt8*)"<svg", 256, 4 ) ) // does it have svg nodes
{
rFormatExtension = UniString::CreateFromAscii( "SVG", 3 );
return sal_True;