20 #include <config_gpgme.h>
22 #include <com/sun/star/embed/ElementModes.hpp>
23 #include <com/sun/star/embed/XEncryptionProtectedStorage.hpp>
24 #include <com/sun/star/embed/XStorage.hpp>
25 #include <com/sun/star/embed/XTransactedObject.hpp>
26 #include <com/sun/star/embed/StorageFactory.hpp>
27 #include <com/sun/star/embed/FileSystemStorageFactory.hpp>
28 #include <com/sun/star/io/IOException.hpp>
29 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
30 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
31 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/beans/PropertyValue.hpp>
34 #include <com/sun/star/beans/NamedValue.hpp>
35 #include <com/sun/star/beans/IllegalTypeException.hpp>
36 #include <com/sun/star/xml/crypto/NSSInitializer.hpp>
37 #include <com/sun/star/xml/crypto/XDigestContext.hpp>
38 #include <com/sun/star/xml/crypto/DigestID.hpp>
39 #include <com/sun/star/security/DocumentDigitalSignatures.hpp>
40 #include <com/sun/star/security/XCertificate.hpp>
44 #include <rtl/digest.h>
45 #include <rtl/random.h>
46 #include <osl/diagnose.h>
59 #if HAVE_FEATURE_GPGME
61 # include <encryptionresult.h>
72 const uno::Reference< uno::XComponentContext >& rxContext )
76 return embed::StorageFactory::create( xContext );
81 const uno::Reference< uno::XComponentContext >& rxContext )
83 return embed::FileSystemStorageFactory::create(rxContext);
88 const uno::Reference< uno::XComponentContext >& rxContext )
91 uno::UNO_QUERY_THROW );
98 sal_Int32 nStorageMode,
99 const uno::Reference< uno::XComponentContext >& rxContext )
101 uno::Sequence< uno::Any > aArgs( 2 );
103 aArgs[1] <<= nStorageMode;
105 uno::Reference< embed::XStorage > xTempStorage(
GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
106 uno::UNO_QUERY_THROW );
112 const OUString& aURL,
113 sal_Int32 nStorageMode,
114 const uno::Reference< uno::XComponentContext >& rxContext )
116 uno::Sequence< uno::Any > aArgs( 2 );
118 aArgs[1] <<= nStorageMode;
120 uno::Reference< lang::XSingleServiceFactory > xFact;
124 uno::Reference< css::ucb::XCommandEnvironment > (),
131 }
catch (uno::Exception &)
138 if (anyEx.hasValue())
139 throw css::lang::WrappedTargetRuntimeException(
"",
nullptr, anyEx );
141 throw uno::RuntimeException();
144 uno::Reference< embed::XStorage > xTempStorage(
145 xFact->createInstanceWithArguments( aArgs ), uno::UNO_QUERY_THROW );
151 const uno::Reference < io::XInputStream >& xStream,
152 const uno::Reference< uno::XComponentContext >& rxContext )
154 uno::Sequence< uno::Any > aArgs( 2 );
155 aArgs[0] <<= xStream;
156 aArgs[1] <<= embed::ElementModes::READ;
158 uno::Reference< embed::XStorage > xTempStorage(
GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
159 uno::UNO_QUERY_THROW );
165 const uno::Reference < io::XStream >& xStream,
166 sal_Int32 nStorageMode,
167 const uno::Reference< uno::XComponentContext >& rxContext )
169 uno::Sequence< uno::Any > aArgs( 2 );
170 aArgs[0] <<= xStream;
171 aArgs[1] <<= nStorageMode;
173 uno::Reference< embed::XStorage > xTempStorage(
GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
174 uno::UNO_QUERY_THROW );
180 const uno::Reference< io::XInputStream >& xInput,
181 const uno::Reference< io::XOutputStream >& xOutput )
186 uno::Sequence < sal_Int8 > aSequence ( nConstBufferSize );
190 nRead = xInput->readBytes ( aSequence, nConstBufferSize );
191 if ( nRead < nConstBufferSize )
193 uno::Sequence < sal_Int8 > aTempBuf ( aSequence.getConstArray(), nRead );
194 xOutput->writeBytes ( aTempBuf );
197 xOutput->writeBytes ( aSequence );
199 while ( nRead == nConstBufferSize );
204 const OUString& aURL,
205 const uno::Reference< uno::XComponentContext >& context )
207 uno::Reference< io::XInputStream > xInputStream = ucb::SimpleFileAccess::create(context)->openFileRead( aURL );
208 if ( !xInputStream.is() )
209 throw uno::RuntimeException();
216 const uno::Reference< embed::XStorage >& xStorage,
217 const uno::Sequence< beans::NamedValue >& aEncryptionData )
219 uno::Reference< embed::XEncryptionProtectedStorage > xEncrSet( xStorage, uno::UNO_QUERY );
220 if ( !xEncrSet.is() )
221 throw io::IOException(
"no XEncryptionProtectedStorage");
223 if ( aEncryptionData.getLength() == 2 &&
224 aEncryptionData[0].Name ==
"GpgInfos" &&
225 aEncryptionData[1].Name ==
"EncryptionKey" )
227 xEncrSet->setGpgProperties(
228 aEncryptionData[0].
Value.get< uno::Sequence< uno::Sequence< beans::NamedValue > > >() );
229 xEncrSet->setEncryptionData(
230 aEncryptionData[1].
Value.get< uno::Sequence< beans::NamedValue > >() );
233 xEncrSet->setEncryptionData( aEncryptionData );
238 const uno::Reference< embed::XStorage >& xStorage )
240 uno::Reference< beans::XPropertySet > xStorProps( xStorage, uno::UNO_QUERY_THROW );
243 xStorProps->getPropertyValue(
"MediaType") >>= aMediaType;
245 sal_Int32 nResult = 0;
287 OUString aMsg = __func__
288 + OUStringLiteral(
u":")
289 + OUString::number(__LINE__)
290 +
": unknown media type '"
293 throw beans::IllegalTypeException(aMsg);
301 const OUString& aFormat,
302 const OUString& aURL,
303 sal_Int32 nStorageMode,
304 const uno::Reference< uno::XComponentContext >& rxContext )
306 uno::Sequence< beans::PropertyValue > aProps( 1 );
307 aProps[0].Name =
"StorageFormat";
308 aProps[0].Value <<= aFormat;
310 uno::Sequence< uno::Any > aArgs( 3 );
312 aArgs[1] <<= nStorageMode;
315 uno::Reference< embed::XStorage > xTempStorage(
GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
316 uno::UNO_QUERY_THROW );
322 const OUString& aFormat,
323 const uno::Reference < io::XInputStream >& xStream,
324 const uno::Reference< uno::XComponentContext >& rxContext,
325 bool bRepairStorage )
327 uno::Sequence< beans::PropertyValue > aProps( 1 );
329 aProps[nPos].Name =
"StorageFormat";
330 aProps[nPos].Value <<= aFormat;
332 if ( bRepairStorage )
334 aProps.realloc(nPos+1);
335 aProps[nPos].Name =
"RepairPackage";
336 aProps[nPos].Value <<= bRepairStorage;
340 uno::Sequence< uno::Any > aArgs( 3 );
341 aArgs[0] <<= xStream;
342 aArgs[1] <<= embed::ElementModes::READ;
345 uno::Reference< embed::XStorage > xTempStorage(
GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
346 uno::UNO_QUERY_THROW );
352 const OUString& aFormat,
353 const uno::Reference < io::XStream >& xStream,
354 sal_Int32 nStorageMode,
355 const uno::Reference< uno::XComponentContext >& rxContext,
356 bool bRepairStorage )
358 uno::Sequence< beans::PropertyValue > aProps( 1 );
360 aProps[nPos].Name =
"StorageFormat";
361 aProps[nPos].Value <<= aFormat;
363 if ( bRepairStorage )
365 aProps.realloc(nPos+1);
366 aProps[nPos].Name =
"RepairPackage";
367 aProps[nPos].Value <<= bRepairStorage;
371 uno::Sequence< uno::Any > aArgs( 3 );
372 aArgs[0] <<= xStream;
373 aArgs[1] <<= nStorageMode;
376 uno::Reference< embed::XStorage > xTempStorage(
GetStorageFactory( rxContext )->createInstanceWithArguments( aArgs ),
377 uno::UNO_QUERY_THROW );
385 uno::Sequence< beans::NamedValue > aEncryptionData;
386 if ( !aPassword.empty() )
388 sal_Int32 nSha1Ind = 0;
394 uno::Reference< css::xml::crypto::XNSSInitializer > xDigestContextSupplier = css::xml::crypto::NSSInitializer::create(xContext);
395 uno::Reference< css::xml::crypto::XDigestContext > xDigestContext( xDigestContextSupplier->getDigestContext( css::xml::crypto::DigestID::SHA256, uno::Sequence< beans::NamedValue >() ), uno::UNO_SET_THROW );
398 xDigestContext->updateDigest( uno::Sequence< sal_Int8 >( reinterpret_cast< const sal_Int8* >( aUTF8Password.getStr() ), aUTF8Password.getLength() ) );
399 uno::Sequence< sal_Int8 > aDigest = xDigestContext->finalizeDigestAndDispose();
401 aEncryptionData.realloc( ++nSha1Ind );
403 aEncryptionData[0].Value <<= aDigest;
405 catch ( uno::Exception& )
407 OSL_ENSURE(
false,
"Can not create SHA256 digest!" );
413 aEncryptionData.realloc( nSha1Ind + 3 );
418 rtl_TextEncoding
const pEncoding[2] = { RTL_TEXTENCODING_UTF8, RTL_TEXTENCODING_MS_1252 };
420 for ( sal_Int32 nInd = 0; nInd < 2; nInd++ )
424 sal_uInt8 pBuffer[RTL_DIGEST_LENGTH_SHA1];
425 rtlDigestError nError = rtl_digest_SHA1( aByteStrPass.getStr(),
426 aByteStrPass.getLength(),
428 RTL_DIGEST_LENGTH_SHA1 );
430 if ( nError != rtl_Digest_E_None )
432 aEncryptionData.realloc( nSha1Ind );
437 aEncryptionData[nSha1Ind+nInd].Value <<= uno::Sequence< sal_Int8 >(
reinterpret_cast<sal_Int8*
>(pBuffer), RTL_DIGEST_LENGTH_SHA1 );
444 reinterpret_cast<unsigned char const*>(aByteStrPass.getStr()), aByteStrPass.getLength(),
445 ::comphelper::HashType::SHA1));
446 aEncryptionData[nSha1Ind + 2].Value <<= uno::Sequence<sal_Int8>(
447 reinterpret_cast<sal_Int8 const*
>(sha1.data()), sha1.size());
450 return aEncryptionData;
455 #if HAVE_FEATURE_GPGME
462 uno::Sequence < sal_Int8 > aVector(32);
463 rtl_random_getBytes( aRandomPool, aVector.getArray(), aVector.getLength() );
465 rtl_random_destroyPool(aRandomPool);
467 uno::Sequence< beans::NamedValue > aContainer(2);
468 std::vector< uno::Sequence< beans::NamedValue > > aGpgEncryptions;
469 uno::Sequence< beans::NamedValue > aGpgEncryptionEntry(3);
470 uno::Sequence< beans::NamedValue > aEncryptionData(1);
472 uno::Reference< security::XDocumentDigitalSignatures > xSigner(
474 security::DocumentDigitalSignatures::createDefault(
478 const uno::Sequence< uno::Reference< security::XCertificate > > xSignCertificates=
479 xSigner->chooseEncryptionCertificate();
481 if (!xSignCertificates.hasElements())
482 return uno::Sequence< beans::NamedValue >();
487 std::unique_ptr<GpgME::Context>
ctx;
488 GpgME::Error
err = GpgME::checkEngine(GpgME::OpenPGP);
490 throw uno::RuntimeException(
"The GpgME library failed to initialize for the OpenPGP protocol.");
492 ctx.reset( GpgME::Context::createForProtocol(GpgME::OpenPGP) );
494 throw uno::RuntimeException(
"The GpgME library failed to initialize for the OpenPGP protocol.");
495 ctx->setArmor(
false);
497 for (
const auto & cert : xSignCertificates)
499 uno::Sequence < sal_Int8 > aKeyID;
501 aKeyID = cert->getSHA1Thumbprint();
503 std::vector<GpgME::Key> keys;
506 reinterpret_cast<const char*>(aKeyID.getConstArray()),
511 reinterpret_cast<const char*>(aVector.getConstArray()),
512 size_t(aVector.getLength()),
false);
515 GpgME::EncryptionResult crypt_res = ctx->encrypt(
517 cipher, GpgME::Context::NoCompress);
519 off_t
result = cipher.seek(0,SEEK_SET);
522 int len=0, curr=0;
char buf;
523 while( (curr=cipher.read(&buf, 1)) )
526 if(crypt_res.error() || !len)
527 throw lang::IllegalArgumentException(
528 "Not a suitable key, or failed to encrypt.",
529 css::uno::Reference<css::uno::XInterface>(), -1);
531 uno::Sequence < sal_Int8 > aCipherValue(len);
532 result = cipher.seek(0,SEEK_SET);
534 if( cipher.read(aCipherValue.getArray(), len) != len )
535 throw uno::RuntimeException(
"The GpgME library failed to read the encrypted value.");
537 SAL_INFO(
"comphelper.crypto",
"Generated gpg crypto of length: " << len);
539 aGpgEncryptionEntry[0].Name =
"KeyId";
540 aGpgEncryptionEntry[0].Value <<= aKeyID;
541 aGpgEncryptionEntry[1].Name =
"KeyPacket";
542 aGpgEncryptionEntry[1].Value <<= aKeyID;
543 aGpgEncryptionEntry[2].Name =
"CipherValue";
544 aGpgEncryptionEntry[2].Value <<= aCipherValue;
546 aGpgEncryptions.push_back(aGpgEncryptionEntry);
550 aEncryptionData[0].Value <<= aVector;
552 aContainer[0].Name =
"GpgInfos";
554 aContainer[1].Name =
"EncryptionKey";
555 aContainer[1].Value <<= aEncryptionData;
559 return uno::Sequence< beans::NamedValue >();
570 const sal_Unicode *pChar, sal_Int32 nLength,
bool bSlashAllowed )
572 for ( sal_Int32
i = 0;
i < nLength;
i++ )
585 if ( !bSlashAllowed )
589 if ( pChar[i] < 32 || (pChar[i] >= 0xD800 && pChar[i] <= 0xDFFF) )
599 bool bResult =
false;
600 const sal_Int32 nPathLen = aPath.getLength();
601 const sal_Int32 nSegLen = aSegment.getLength();
603 if ( !aSegment.isEmpty() && nPathLen >= nSegLen )
605 OUString aEndSegment =
"/" + aSegment;
606 OUString aInternalSegment = aEndSegment +
"/";
608 if ( aPath.indexOf( aInternalSegment ) >= 0 )
611 if ( !bResult && aPath.startsWith( aSegment ) )
613 if ( nPathLen == nSegLen || aPath[nSegLen] ==
'/' )
617 if ( !bResult && nPathLen > nSegLen && aPath.subView( nPathLen - nSegLen - 1, nSegLen + 1 ) == aEndSegment )
625 :
public std::vector< uno::Reference< embed::XStorage > > {};
627 : m_xBadness( new
Impl ) { }
633 [](Impl::reference rxItem) {
634 uno::Reference<embed::XTransactedObject>
const xTransaction(rxItem, uno::UNO_QUERY);
635 if (xTransaction.is())
637 xTransaction->commit();
643 const OUString& rPath )
645 for (sal_Int32
i = 0;
i >= 0;)
646 rElems.push_back( rPath.getToken( 0,
'/',
i ) );
650 const uno::Reference< embed::XStorage > &xParentStorage,
651 std::vector<OUString> &rElems, sal_uInt32 nOpenMode,
654 uno::Reference< embed::XStorage > xStorage( xParentStorage );
656 for(
size_t i = 0;
i < rElems.size() && xStorage.is();
i++ )
658 xStorage = xStorage->openStorageElement( rElems[
i], nOpenMode );
665 const uno::Reference< embed::XStorage > &xStorage,
666 const OUString& rPath, sal_uInt32 nOpenMode,
669 std::vector<OUString> aElems;
675 const uno::Reference< embed::XStorage > &xParentStorage,
676 const OUString& rPath, sal_uInt32 nOpenMode,
679 std::vector<OUString> aElems;
681 OUString
aName( aElems.back() );
683 sal_uInt32 nStorageMode = nOpenMode & ~
embed::ElementModes::TRUNCATE;
684 uno::Reference< embed::XStorage > xStorage(
686 uno::UNO_SET_THROW );
687 return xStorage->openStreamElement(
aName, nOpenMode );
691 uno::Reference< embed::XStorage >
const& xParentStorage,
692 const OUString& rURL, sal_uInt32
const nOpenMode,
696 if (rURL.startsWithIgnoreAsciiCase(
"vnd.sun.star.Package:", &path))
705 OUString aODFVersion;
708 uno::Reference<beans::XPropertySet> xPropSet(xStorage, uno::UNO_QUERY_THROW);
709 xPropSet->getPropertyValue(
"Version") >>= aODFVersion;
711 catch (uno::Exception&)
#define PACKAGE_ENCRYPTIONDATA_SHA1CORRECT
#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII
#define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII
static css::uno::Reference< css::embed::XStorage > GetStorageOfFormatFromInputStream(const OUString &aFormat, const css::uno::Reference< css::io::XInputStream > &xStream, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >(), bool bRepairStorage=false)
static void splitPath(std::vector< OUString > &rElems, const OUString &rPath)
static css::uno::Reference< css::embed::XStorage > GetStorageFromInputStream(const css::uno::Reference< css::io::XInputStream > &xStream, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
static void CopyInputToOutput(const css::uno::Reference< css::io::XInputStream > &xInput, const css::uno::Reference< css::io::XOutputStream > &xOutput)
#define MIMETYPE_VND_SUN_XML_CHART_ASCII
exports com.sun.star. embed
#define MIMETYPE_VND_SUN_XML_MATH_ASCII
static css::uno::Reference< css::lang::XSingleServiceFactory > GetFileSystemStorageFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
#define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII
static css::uno::Reference< css::lang::XSingleServiceFactory > GetStorageFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
static css::uno::Sequence< css::beans::NamedValue > CreateGpgPackageEncryptionData()
Any SAL_CALL getCaughtException()
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
static css::uno::Reference< css::embed::XStorage > GetStorageFromStream(const css::uno::Reference< css::io::XStream > &xStream, sal_Int32 nStorageMode=css::embed::ElementModes::READWRITE, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
#define MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII
#define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII
static css::uno::Sequence< css::beans::NamedValue > CreatePackageEncryptionData(std::u16string_view aPassword)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
static css::uno::Reference< css::embed::XStorage > GetStorageOfFormatFromStream(const OUString &aFormat, const css::uno::Reference< css::io::XStream > &xStream, sal_Int32 nStorageMode=css::embed::ElementModes::READWRITE, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >(), bool bRepairStorage=false)
static void SetCommonStorageEncryptionData(const css::uno::Reference< css::embed::XStorage > &xStorage, const css::uno::Sequence< css::beans::NamedValue > &aEncryptionData)
static css::uno::Reference< css::embed::XStorage > GetTemporaryStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
#define MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII
static bool IsValidZipEntryFileName(const OUString &aName, bool bSlashAllowed)
static sal_Int32 GetXStorageFormat(const css::uno::Reference< css::embed::XStorage > &xStorage)
const sal_Int32 nConstBufferSize
#define MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII
static css::uno::Reference< css::io::XInputStream > GetInputStreamFromURL(const OUString &aURL, const css::uno::Reference< css::uno::XComponentContext > &context)
std::unique_ptr< Impl > m_xBadness
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
#define MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII
static css::uno::Reference< css::embed::XStorage > GetStorageFromURL(const OUString &aURL, sal_Int32 nStorageMode, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
this one will only return Storage
static uno::Reference< embed::XStorage > LookupStorageAtPath(const uno::Reference< embed::XStorage > &xParentStorage, std::vector< OUString > &rElems, sal_uInt32 nOpenMode, LifecycleProxy const &rNastiness)
#define MIMETYPE_VND_SUN_XML_DRAW_ASCII
#define MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE_ASCII
static css::uno::Reference< css::io::XStream > GetStreamAtPackageURL(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &rURL, sal_uInt32 const nOpenMode, LifecycleProxy const &rNastiness)
#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII
#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII
static css::uno::Reference< css::embed::XStorage > GetStorageOfFormatFromURL(const OUString &aFormat, const OUString &aURL, sal_Int32 nStorageMode, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
#define MIMETYPE_VND_SUN_XML_IMPRESS_ASCII
#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII
#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII
static css::uno::Reference< css::embed::XStorage > GetStorageFromURL2(const OUString &aURL, sal_Int32 nStorageMode, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
this one will return either Storage or FileSystemStorage
#define MIMETYPE_VND_SUN_XML_WRITER_GLOBAL_ASCII
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
Copy from a container into a Sequence.
#define PACKAGE_ENCRYPTIONDATA_SHA256UTF8
#define MIMETYPE_VND_SUN_XML_CALC_ASCII
#define SAL_INFO(area, stream)
Reference< XComponentContext > getProcessComponentContext()
This function gets the process service factory's default component context.
#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII
static std::vector< unsigned char > calculateHash(const unsigned char *pInput, size_t length, HashType eType)
static OUString GetODFVersionFromStorage(const css::uno::Reference< css::embed::XStorage > &xStorage)
#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII
static css::uno::Reference< css::embed::XStorage > GetStorageAtPath(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &aPath, sal_uInt32 nOpenMode, LifecycleProxy const &rNastiness)
#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII
#define MIMETYPE_VND_SUN_XML_WRITER_WEB_ASCII
#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT_CHART_ASCII
static css::uno::Reference< css::io::XStream > GetStreamAtPath(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &aPath, sal_uInt32 nOpenMode, LifecycleProxy const &rNastiness)
#define MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII
#define PACKAGE_ENCRYPTIONDATA_SHA1UTF8
#define MIMETYPE_VND_SUN_XML_WRITER_ASCII
#define PACKAGE_ENCRYPTIONDATA_SHA1MS1252
static bool PathHasSegment(const OUString &aPath, const OUString &aSegment)