Kaydet (Commit) 2c66056b authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX import: detect document signature

Change-Id: Ic84b1f1446d6ab1a1529de4e0a435afbf62915a7
üst 938a070f
...@@ -75,7 +75,7 @@ class OOXMLStream ...@@ -75,7 +75,7 @@ class OOXMLStream
{ {
public: public:
enum StreamType_t { UNKNOWN, DOCUMENT, STYLES, WEBSETTINGS, FONTTABLE, NUMBERING, enum StreamType_t { UNKNOWN, DOCUMENT, STYLES, WEBSETTINGS, FONTTABLE, NUMBERING,
FOOTNOTES, ENDNOTES, COMMENTS, THEME, CUSTOMXML, CUSTOMXMLPROPS, ACTIVEX, ACTIVEXBIN, GLOSSARY, CHARTS, EMBEDDINGS, SETTINGS, VBAPROJECT, FOOTER, HEADER }; FOOTNOTES, ENDNOTES, COMMENTS, THEME, CUSTOMXML, CUSTOMXMLPROPS, ACTIVEX, ACTIVEXBIN, GLOSSARY, CHARTS, EMBEDDINGS, SETTINGS, VBAPROJECT, FOOTER, HEADER, SIGNATURE };
typedef boost::shared_ptr<OOXMLStream> Pointer_t; typedef boost::shared_ptr<OOXMLStream> Pointer_t;
virtual ~OOXMLStream() {} virtual ~OOXMLStream() {}
......
...@@ -175,6 +175,14 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes ...@@ -175,6 +175,14 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
oox::GraphicHelper gHelper( m_xContext, xFrame, xVbaPrjStrg ); oox::GraphicHelper gHelper( m_xContext, xFrame, xVbaPrjStrg );
aVbaProject.importVbaProject( *xVbaPrjStrg, gHelper ); aVbaProject.importVbaProject( *xVbaPrjStrg, gHelper );
} }
// Document signature.
writerfilter::ooxml::OOXMLStream::Pointer_t pSignatureStream;
pSignatureStream = writerfilter::ooxml::OOXMLDocumentFactory::createStream(m_xContext, xInputStream, bRepairStorage, writerfilter::ooxml::OOXMLStream::SIGNATURE);
if (pSignatureStream->getDocumentStream().is())
{
// TODO found, handle it.
}
} }
pStream.reset(); pStream.reset();
......
...@@ -157,6 +157,7 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess> ...@@ -157,6 +157,7 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
static OUString sFooterType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"); static OUString sFooterType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer");
static OUString sHeaderType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"); static OUString sHeaderType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/header");
static OUString sOleObjectType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"); static OUString sOleObjectType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject");
static OUString sSignatureType("http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin");
// OOXML strict // OOXML strict
static OUString sDocumentTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument"); static OUString sDocumentTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument");
static OUString sStylesTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/styles"); static OUString sStylesTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/styles");
...@@ -264,6 +265,9 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess> ...@@ -264,6 +265,9 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
sStreamType = sHeaderType; sStreamType = sHeaderType;
sStreamTypeStrict = sHeaderTypeStrict; sStreamTypeStrict = sHeaderTypeStrict;
break; break;
case SIGNATURE:
sStreamType = sSignatureType;
break;
default: default:
break; break;
} }
......
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