summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-08-13 23:25:24 +0200
committerTomaž Vajngerl <quikee@gmail.com>2013-08-14 00:01:51 +0200
commit3423db6f81dfcd3993178a70bde7c69a0c02c302 (patch)
treee4194e7f9cec4e2cffd1bcb0169cb262d0aab2f5 /include
parent73c02c20b19702dbe662fe0d80601049f015d8ac (diff)
fdo#59524 Encryption for MS Office 2007 Spreadsheet documents
This enables saving of MS 2007 spreadsheet documents with a password. The encryption used is the same as used in Office 2007 (however different than in Office 2010 and 2013 which use "agile" encryption). Change-Id: I3539e811d95b6f9178246ab269d13bb385a48bd2
Diffstat (limited to 'include')
-rw-r--r--include/oox/core/DocumentCrypt.hxx53
-rw-r--r--include/oox/core/filterbase.hxx5
-rw-r--r--include/oox/core/xmlfilterbase.hxx7
3 files changed, 64 insertions, 1 deletions
diff --git a/include/oox/core/DocumentCrypt.hxx b/include/oox/core/DocumentCrypt.hxx
new file mode 100644
index 000000000000..30102365f59d
--- /dev/null
+++ b/include/oox/core/DocumentCrypt.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef DOCUMENTCRYPTO_HXX
+#define DOCUMENTCRYPTO_HXX
+
+#include "oox/dllapi.h"
+
+#include "oox/ole/olestorage.hxx"
+#include <com/sun/star/io/XStream.hpp>
+
+namespace oox {
+namespace core {
+
+class OOX_DLLPUBLIC AesEncoder
+{
+private:
+ com::sun::star::uno::Reference< com::sun::star::io::XStream > mxDocumentStream;
+ oox::ole::OleStorage& mrOleStorage;
+ OUString maPassword;
+
+public:
+ AesEncoder(
+ com::sun::star::uno::Reference< com::sun::star::io::XStream > xDocumentStream,
+ oox::ole::OleStorage& rOleStorage,
+ OUString aPassword);
+
+ bool encode();
+};
+
+
+} // namespace core
+} // namespace oox
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/oox/core/filterbase.hxx b/include/oox/core/filterbase.hxx
index cfd9354499f7..da8600659071 100644
--- a/include/oox/core/filterbase.hxx
+++ b/include/oox/core/filterbase.hxx
@@ -257,6 +257,11 @@ protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
implGetOutputStream( ::comphelper::MediaDescriptor& rMediaDesc ) const;
+ virtual bool implFinalizeExport( ::comphelper::MediaDescriptor& rMediaDescriptor );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
+ getMainDocumentStream( ) const;
+
private:
void setMediaDescriptor(
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rMediaDescSeq );
diff --git a/include/oox/core/xmlfilterbase.hxx b/include/oox/core/xmlfilterbase.hxx
index 5bddea46e594..6d61eb1d7e36 100644
--- a/include/oox/core/xmlfilterbase.hxx
+++ b/include/oox/core/xmlfilterbase.hxx
@@ -233,7 +233,12 @@ public:
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
- implGetInputStream( ::comphelper::MediaDescriptor& rMediaDesc ) const;
+ implGetInputStream( ::comphelper::MediaDescriptor& rMediaDesc ) const;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
+ implGetOutputStream( ::comphelper::MediaDescriptor& rMediaDesc ) const;
+
+ virtual bool implFinalizeExport( ::comphelper::MediaDescriptor& rMediaDescriptor );
private:
virtual StorageRef implCreateStorage(