LibreOffice Module oox (master) 1
|
#include <filterdetect.hxx>
Public Member Functions | |
FilterDetect (const css::uno::Reference< css::uno::XComponentContext > &rxContext) | |
virtual | ~FilterDetect () override |
css::uno::Reference< css::io::XInputStream > | extractUnencryptedPackage (utl::MediaDescriptor &rMediaDesc) const |
Tries to extract an unencrypted ZIP package from the passed media descriptor. More... | |
virtual OUString SAL_CALL | getImplementationName () override |
virtual sal_Bool SAL_CALL | supportsService (const OUString &rServiceName) override |
virtual css::uno::Sequence< OUString > SAL_CALL | getSupportedServiceNames () override |
virtual OUString SAL_CALL | detect (css::uno::Sequence< css::beans::PropertyValue > &rMediaDescSeq) override |
Detects MS Office 2007 file types and supports package decryption. More... | |
Private Attributes | |
css::uno::Reference< css::uno::XComponentContext > | mxContext |
Definition at line 103 of file filterdetect.hxx.
|
explicit |
css::uno::RuntimeException |
References getImplementationName(), getSupportedServiceNames(), and supportsService().
|
overridevirtual |
Definition at line 265 of file filterdetect.cxx.
|
overridevirtual |
Detects MS Office 2007 file types and supports package decryption.
The following file types are detected:
If the package is encrypted, the detection tries to decrypt it into a temporary file. The user may be asked for a password. The XStream interface of the temporary file will be stored in the 'ComponentData' property of the passed media descriptor.
Reference< XInputStream > FilterDetect::extractUnencryptedPackage | ( | utl::MediaDescriptor & | rMediaDesc | ) | const |
Tries to extract an unencrypted ZIP package from the passed media descriptor.
First, this function checks if the input stream provided by the media descriptor property 'InputStream' contains a ZIP package. If yes, this stream is returned.
Second, this function checks if the 'ComponentData' property exists and contains a sequence of com.sun.star.beans.NamedValue. If yes, a named value is searched with the name 'DecryptedPackage' and a value of type com.sun.star.io.XStream. If the input stream provided by this XStream contains a ZIP package, this input stream is returned.
Third, this function checks if the input stream of the media descriptor contains an OLE package. If yes, it checks the existence of the streams 'EncryptionInfo' and 'EncryptedPackage' and tries to decrypt the package into a temporary file. This may include requesting a password from the media descriptor property 'Password' or from the user, using the interaction handler provided by the descriptor. On success, and if the decrypted package is a ZIP package, the XStream of the temporary file is stored in the property 'ComponentData' of the media descriptor and its input stream is returned.
Definition at line 317 of file filterdetect.cxx.
References Any, oox::crypto::DocumentDecryption::decrypt(), Exception, utl::MediaDescriptor::getComponentDataEntry(), oox::StorageBase::isStorage(), comphelper::MS, mxContext, oox::crypto::DocumentDecryption::readEncryptionInfo(), utl::MediaDescriptor::requestAndVerifyDocPassword(), and utl::MediaDescriptor::setComponentDataEntry().
|
overridevirtual |
Definition at line 398 of file filterdetect.cxx.
|
overridevirtual |
Definition at line 408 of file filterdetect.cxx.
|
overridevirtual |
Definition at line 403 of file filterdetect.cxx.
References cppu::supportsService().
|
private |
Definition at line 164 of file filterdetect.hxx.