diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-12-15 14:18:06 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-12-15 17:44:36 +0100 |
commit | 36a0abed4ab27abd77b502070d4e17e70e6afe7b (patch) | |
tree | e3cb56bef81036cd8645676dd3c2cd1185518fb8 | |
parent | 45300b43fe44bb01494fecbaa290d846d476cdb0 (diff) |
filter: add BaseURL parameter to SvxMSDffManager::ImportOLE()
... mainly for the (unlikely) case of ODF embedded objects in MSO binary
files, which can be created by toggling the
Tools->Options->Load/Save->Microsoft Office export settings.
Change-Id: I270f1516b70b20ec0b60cfbd17c2c327c3d9efd0
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 18 | ||||
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 2 | ||||
-rw-r--r-- | include/filter/msfilter/msdffimp.hxx | 6 | ||||
-rw-r--r-- | sc/source/filter/excel/xiescher.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8gr.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par4.cxx | 2 |
7 files changed, 21 insertions, 14 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 4afc1cb2d919..f29cf4f85b0b 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -6517,7 +6517,7 @@ SdrObject* SvxMSDffManager::ImportOLE( long nOLEId, if( GetOLEStorageName( nOLEId, sStorageName, xSrcStg, xDstStg )) pRet = CreateSdrOLEFromStorage( sStorageName, xSrcStg, xDstStg, rGrf, rBoundRect, rVisArea, pStData, nError, - nSvxMSDffOLEConvFlags, nAspect ); + nSvxMSDffOLEConvFlags, nAspect, maBaseURL); return pRet; } @@ -6831,7 +6831,7 @@ OUString GetFilterNameFromClassID_Impl( const SvGlobalName& aGlobName ) css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForConvertToSOObj( sal_uInt32 nConvertFlags, SotStorage& rSrcStg, const uno::Reference < embed::XStorage >& rDestStorage, const Graphic& rGrf, - const Rectangle& rVisArea ) + const Rectangle& rVisArea, OUString const& rBaseURL) { uno::Reference < embed::XEmbeddedObject > xObj; SvGlobalName aStgNm = rSrcStg.GetClassName(); @@ -6930,17 +6930,19 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo else aFilterName = GetFilterNameFromClassID_Impl( aStgNm ); - uno::Sequence < beans::PropertyValue > aMedium( aFilterName.isEmpty() ? 2 : 3); + uno::Sequence<beans::PropertyValue> aMedium(aFilterName.isEmpty() ? 3 : 4); aMedium[0].Name = "InputStream"; uno::Reference < io::XInputStream > xStream = new ::utl::OSeekableInputStreamWrapper( *xMemStream ); aMedium[0].Value <<= xStream; aMedium[1].Name = "URL"; aMedium[1].Value <<= OUString( "private:stream" ); + aMedium[2].Name = "DocumentBaseURL"; + aMedium[2].Value <<= OUString(rBaseURL); if ( !aFilterName.isEmpty() ) { - aMedium[2].Name = "FilterName"; - aMedium[2].Value <<= aFilterName; + aMedium[3].Name = "FilterName"; + aMedium[3].Value <<= aFilterName; } OUString aName( aDstStgName ); @@ -7015,7 +7017,8 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( SvStream* pDataStrm, ErrCode& rError, sal_uInt32 nConvertFlags, - sal_Int64 nRecommendedAspect ) + sal_Int64 nRecommendedAspect, + OUString const& rBaseURL) { sal_Int64 nAspect = nRecommendedAspect; SdrOle2Obj* pRet = nullptr; @@ -7069,7 +7072,8 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage( } uno::Reference < embed::XEmbeddedObject > xObj( CheckForConvertToSOObj( - nConvertFlags, *xObjStg, xDestStorage, rGrf, rVisArea )); + nConvertFlags, *xObjStg, xDestStorage, rGrf, + rVisArea, rBaseURL)); if ( xObj.is() ) { svt::EmbeddedObjectRef aObj( xObj, nAspect ); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 8f066e842959..f9d14e830fd7 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1868,7 +1868,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId, { uno::Reference < embed::XStorage > xDestStorage( pOe->pShell->GetStorage() ); uno::Reference < embed::XEmbeddedObject > xObj = - CheckForConvertToSOObj( nSvxMSDffOLEConvFlags, *xObjStor, xDestStorage, rGraf, rVisArea ); + CheckForConvertToSOObj(nSvxMSDffOLEConvFlags, *xObjStor, xDestStorage, rGraf, rVisArea, maBaseURL); if( xObj.is() ) { pOe->pShell->getEmbeddedObjectContainer().InsertEmbeddedObject( xObj, aNm ); diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx index 28b7b27b74ae..28ae9184c443 100644 --- a/include/filter/msfilter/msdffimp.hxx +++ b/include/filter/msfilter/msdffimp.hxx @@ -466,7 +466,8 @@ protected: sal_uInt32 nConvertFlags, SotStorage& rSrcStg, const css::uno::Reference < css::embed::XStorage >& xDestStg, const Graphic& rGrf, - const Rectangle& rVisArea ); + const Rectangle& rVisArea, + OUString const& rBaseURL); // the following methods need to be overridden for Excel imports static bool ProcessClientAnchor( SvStream& rStData, @@ -687,7 +688,8 @@ public: SvStream* pDataStrrm, ErrCode& rError, sal_uInt32 nConvertFlags, - sal_Int64 nAspect ); + sal_Int64 nAspect, + OUString const& rBaseURL); /** Create connections between shapes. This method should be called after a page is imported. diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 9a7264378b44..d5922131e1c1 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -3454,7 +3454,7 @@ SdrObjectPtr XclImpDffConverter::CreateSdrObject( const XclImpPictureObj& rPicOb sal_Int64 nAspects = rPicObj.IsSymbol() ? cssea::MSOLE_ICON : cssea::MSOLE_CONTENT; xSdrObj.reset( CreateSdrOLEFromStorage( aStrgName, xSrcStrg, pDocShell->GetStorage(), aGraphic, - rAnchorRect, aVisArea, nullptr, nError, mnOleImpFlags, nAspects ) ); + rAnchorRect, aVisArea, nullptr, nError, mnOleImpFlags, nAspects, GetRoot().GetMedium().GetBaseURL()) ); } } } diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index 476ab4fcef90..54d1306335b7 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -141,7 +141,7 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, if ( pOLENd ) nAspect = pOLENd->GetAspect(); SdrOle2Obj *pRet = SvxMSDffManager::CreateSdrOLEFromStorage( - rStorageName,xObjStg,m_pDoc->GetDocStorage(),aGraph,aRect,aVisArea,nullptr,nErr,0,nAspect); + rStorageName,xObjStg,m_pDoc->GetDocStorage(),aGraph,aRect,aVisArea,nullptr,nErr,0,nAspect, m_pWriter->GetBaseURL()); if (pRet) { diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 56a819b24973..04203c352cd3 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -591,7 +591,8 @@ SdrObject* SwMSDffManager::ImportOLE( long nOLEId, { ErrCode nError = ERRCODE_NONE; pRet = CreateSdrOLEFromStorage( sStorageName, xSrcStg, xDstStg, - rGrf, rBoundRect, rVisArea, pStData, nError, nSvxMSDffOLEConvFlags, nAspect ); + rGrf, rBoundRect, rVisArea, pStData, nError, + nSvxMSDffOLEConvFlags, nAspect, rReader.GetBaseURL()); } } return pRet; diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index ff437e345eec..56a0b76b4413 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -437,7 +437,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, ErrCode nError = ERRCODE_NONE; pRet = SvxMSDffManager::CreateSdrOLEFromStorage( aSrcStgName, xSrc0, m_pDocShell->GetStorage(), rGraph, aRect, aVisArea, pTmpData, nError, - SwMSDffManager::GetFilterFlags(), nAspect ); + SwMSDffManager::GetFilterFlags(), nAspect, GetBaseURL()); m_pDataStream->Seek( nOldPos ); } } |