summaryrefslogtreecommitdiff
path: root/src/lib/SDWDocument.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/SDWDocument.cpp')
-rw-r--r--src/lib/SDWDocument.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/SDWDocument.cpp b/src/lib/SDWDocument.cpp
index 757d5da..695ce8f 100644
--- a/src/lib/SDWDocument.cpp
+++ b/src/lib/SDWDocument.cpp
@@ -49,7 +49,7 @@ Analyzes the content of an input stream to see if it can be parsed
\return A confidence value which represents the likelyhood that the content from
the input stream can be parsed
*/
-libsdw::SDWConfidence libsdw::SDWDocument::isFileFormatSupported(WPXInputStream *input)
+libsdw::SDWConfidence libsdw::SDWDocument::isFileFormatSupported(WPXInputStream *input, const char *password)
{
SDW_DEBUG_MSG(("SDWDocument::isFileFormatSupported()\n"));
if (!input->isOLEStream())
@@ -58,6 +58,13 @@ libsdw::SDWConfidence libsdw::SDWDocument::isFileFormatSupported(WPXInputStream
if (!starWriterDocument)
return SDW_CONFIDENCE_NONE;
+ SDWHeader header(starWriterDocument, password);
+ if (!header.isValid())
+ {
+ delete starWriterDocument;
+ return SDW_CONFIDENCE_NONE;
+ }
+
delete starWriterDocument;
return SDW_CONFIDENCE_NONE;
}