[Libreoffice-commits] core.git: writerfilter/inc writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Fri May 23 02:53:45 PDT 2014


 writerfilter/inc/ooxml/OOXMLDocument.hxx      |    2 +-
 writerfilter/source/filter/ImportFilter.cxx   |    8 ++++++++
 writerfilter/source/ooxml/OOXMLStreamImpl.cxx |    4 ++++
 3 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 2c66056bec75105566c5dcbb9726dd77b83be768
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri May 23 11:40:59 2014 +0200

    DOCX import: detect document signature
    
    Change-Id: Ic84b1f1446d6ab1a1529de4e0a435afbf62915a7

diff --git a/writerfilter/inc/ooxml/OOXMLDocument.hxx b/writerfilter/inc/ooxml/OOXMLDocument.hxx
index da25adf..18c21da 100644
--- a/writerfilter/inc/ooxml/OOXMLDocument.hxx
+++ b/writerfilter/inc/ooxml/OOXMLDocument.hxx
@@ -75,7 +75,7 @@ class OOXMLStream
 {
 public:
     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;
 
     virtual ~OOXMLStream() {}
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index 277f2da..2380d1f 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -175,6 +175,14 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
             oox::GraphicHelper gHelper( m_xContext, xFrame, xVbaPrjStrg );
             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();
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index c000e78..759762a 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -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 sHeaderType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/header");
     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
     static OUString sDocumentTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument");
     static OUString sStylesTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/styles");
@@ -264,6 +265,9 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
             sStreamType = sHeaderType;
             sStreamTypeStrict = sHeaderTypeStrict;
           break;
+        case SIGNATURE:
+            sStreamType = sSignatureType;
+            break;
         default:
             break;
     }


More information about the Libreoffice-commits mailing list