From 78149c3847533639542ea55d97c168e0fbcd9822 Mon Sep 17 00:00:00 2001 From: Vasily Melenchuk Date: Mon, 23 Sep 2019 20:48:41 +0300 Subject: irm: refactoring of decrypt methods to allow usage of decryt methods outside of LO we should avoid direct usage of OleStorage in CryptoEngine: it is not accessible outside of core. Change-Id: Id60b338445a5950aa40b84d788c94b8fa025e717 --- oox/source/crypto/DocumentEncryption.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'oox/source/crypto/DocumentEncryption.cxx') diff --git a/oox/source/crypto/DocumentEncryption.cxx b/oox/source/crypto/DocumentEncryption.cxx index 6975572193d5..8aac457c67d2 100644 --- a/oox/source/crypto/DocumentEncryption.cxx +++ b/oox/source/crypto/DocumentEncryption.cxx @@ -27,10 +27,12 @@ namespace core { using namespace css::io; using namespace css::uno; -DocumentEncryption::DocumentEncryption(Reference const & xDocumentStream, +DocumentEncryption::DocumentEncryption(const css::uno::Reference< css::uno::XComponentContext >& rxContext, + Reference const & xDocumentStream, oox::ole::OleStorage& rOleStorage, Sequence& rMediaEncData) - : mxDocumentStream(xDocumentStream) + : mxContext(rxContext) + , mxDocumentStream(xDocumentStream) , mrOleStorage(rOleStorage) , mMediaEncData(rMediaEncData) { @@ -43,11 +45,11 @@ DocumentEncryption::DocumentEncryption(Reference const & xDocumentStrea rMediaEncData[i].Value >>= sCryptoType; if (sCryptoType == "IRM") { - mEngine.reset(new IRMEngine); + mEngine.reset(new IRMEngine(mxContext)); } else if (sCryptoType == "Standard" || sCryptoType == "Agile") { - mEngine.reset(new Standard2007Engine); + mEngine.reset(new Standard2007Engine(mxContext)); } else { -- cgit v1.2.3