diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-05-30 17:32:45 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-05-30 22:22:20 +0200 |
commit | 0258bcdedd710d78de99c9cefc9d8c3e2ca85fdf (patch) | |
tree | d8c4a9cae97a57831bb90a25bf3d836f40478481 /filter | |
parent | 46ac3e24f65ee69154afa6ba93997635629f79c0 (diff) |
sw HTML filter: handle embedded ODF content in xhtml/reqif mode
Embedded native data (what we don't parse just carry on) and real OLE2
embedding already worked, this adds the case where the actual content is
ODF, just inside OLE2.
The DOC import/export had support for handleing ODF content inside OLE2,
so reuse that code: add new functions to SvxMSDffManager for import
purposes and reuse SvxMSExportOLEObjects for export purposes.
Change-Id: I0acf65d4bf29af896b8f1dd625e8672050aae350
Reviewed-on: https://gerrit.libreoffice.org/55088
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index f37fa69dffd7..17b8273b908f 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -6936,7 +6936,7 @@ const char* GetInternalServerName_Impl( const SvGlobalName& aGlobName ) return nullptr; } -OUString GetFilterNameFromClassID_Impl( const SvGlobalName& aGlobName ) +OUString SvxMSDffManager::GetFilterNameFromClassID( const SvGlobalName& aGlobName ) { if ( aGlobName == SvGlobalName( SO3_SW_OLE_EMBED_CLASSID_60 ) ) return OUString( "StarOffice XML (Writer)" ); @@ -6977,6 +6977,13 @@ OUString GetFilterNameFromClassID_Impl( const SvGlobalName& aGlobName ) return OUString(); } +void SvxMSDffManager::ExtractOwnStream(SotStorage& rSrcStg, SvMemoryStream& rMemStream) +{ + tools::SvRef<SotStorageStream> xStr + = rSrcStg.OpenSotStream("package_stream", StreamMode::STD_READ); + xStr->ReadStream(rMemStream); +} + css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForConvertToSOObj( sal_uInt32 nConvertFlags, SotStorage& rSrcStg, const uno::Reference < embed::XStorage >& rDestStorage, const Graphic& rGrf, @@ -7041,8 +7048,7 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo if ( pName ) { // TODO/LATER: perhaps we need to retrieve VisArea and Metafile from the storage also - tools::SvRef<SotStorageStream> xStr = rSrcStg.OpenSotStream( "package_stream", StreamMode::STD_READ ); - xStr->ReadStream( *xMemStream ); + SvxMSDffManager::ExtractOwnStream(rSrcStg, *xMemStream); } else { @@ -7077,7 +7083,7 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo if ( pFilter ) aFilterName = pFilter->GetName(); else - aFilterName = GetFilterNameFromClassID_Impl( aStgNm ); + aFilterName = SvxMSDffManager::GetFilterNameFromClassID( aStgNm ); uno::Sequence<beans::PropertyValue> aMedium(aFilterName.isEmpty() ? 3 : 4); aMedium[0].Name = "InputStream"; |