diff options
author | erack <er@openoffice.org> | 2011-09-10 22:44:32 +0000 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2011-11-23 23:34:56 +0100 |
commit | 6ad3c553a9bd3b8fb91c45204f0c833f52c52431 (patch) | |
tree | 8415a06dd1501fb32c7d4c24b6112dec63f25fd0 /sd/source | |
parent | 619ea0c6d3b8fb4390bf5e82f1b44608c3cd878d (diff) |
impress212: #i97241# added relative links
* found as LGPLv3-only fix at svn rev 1167624 (http://svn.apache.org/viewvc?view=revision&revision=1167624)
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/filter/eppt/eppt.cxx | 20 | ||||
-rw-r--r-- | sd/source/filter/eppt/eppt.hxx | 2 | ||||
-rw-r--r-- | sd/source/filter/eppt/epptso.cxx | 13 | ||||
-rw-r--r-- | sd/source/filter/eppt/escherex.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/eppt/escherex.hxx | 2 | ||||
-rw-r--r-- | sd/source/filter/sdpptwrp.cxx | 11 |
6 files changed, 41 insertions, 10 deletions
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 832e7b0b7c1c..26fcd2c3f015 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -74,7 +74,7 @@ using ::com::sun::star::beans::XPropertySet; //============================ PPTWriter ================================== -PPTWriter::PPTWriter( SvStorageRef& rSvStorage, +PPTWriter::PPTWriter( const std::vector< com::sun::star::beans::PropertyValue >& rMediaData, SvStorageRef& rSvStorage, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rXModel, ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rXStatInd, SvMemoryStream* pVBA, sal_uInt32 nCnvrtFlags ) : @@ -126,7 +126,19 @@ void PPTWriter::exportPPTPre() if ( !mpPicStrm ) mpPicStrm = mrStg->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ) ); - mpPptEscherEx = new PptEscherEx( *mpStrm ); + const String sBaseURI( RTL_CONSTASCII_USTRINGPARAM( "BaseURI" ) ); + std::vector< com::sun::star::beans::PropertyValue >::const_iterator aIter( rMediaData.begin() ); + while( aIter != rMediaData.end() ) + { + if ( (*aIter).Name.equals( sBaseURI ) ) + { + rtl::OUString sBaseURI; + (*aIter).Value >>= maBaseURI; + break; + } + aIter++; + } + mpPptEscherEx = new PptEscherEx( *mpStrm, maBaseURI ); } void PPTWriter::exportPPTPost( ) @@ -1478,7 +1490,7 @@ sal_Bool PPTWriter::ImplWriteAtomEnding() // - exported function - // --------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI ExportPPT( SvStorageRef& rSvStorage, +extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI ExportPPT( const std::vector< com::sun::star::beans::PropertyValue >& rMediaData, SvStorageRef& rSvStorage, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rXModel, ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rXStatInd, SvMemoryStream* pVBA, sal_uInt32 nCnvrtFlags ) @@ -1486,7 +1498,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool __LOADONCALLAPI ExportPPT( SvStorageRef PPTWriter* pPPTWriter; sal_Bool bStatus = sal_False; - pPPTWriter = new PPTWriter( rSvStorage, rXModel, rXStatInd, pVBA, nCnvrtFlags ); + pPPTWriter = new PPTWriter( rMediaData, rSvStorage, rXModel, rXStatInd, pVBA, nCnvrtFlags ); if ( pPPTWriter ) { pPPTWriter->exportPPT(); diff --git a/sd/source/filter/eppt/eppt.hxx b/sd/source/filter/eppt/eppt.hxx index 5695aa595e45..6096276ea48e 100644 --- a/sd/source/filter/eppt/eppt.hxx +++ b/sd/source/filter/eppt/eppt.hxx @@ -177,8 +177,8 @@ class PPTWriter : public PPTWriterBase, public PPTExBulletProvider sal_uInt32 mnStatMaxValue; sal_uInt32 mnLatestStatValue; - EscherGraphicProvider* mpGraphicProvider; std::vector<rtl::OUString> maSlideNameList; + rtl::OUString maBaseURI; ::com::sun::star::uno::Reference< ::com::sun::star::text::XSimpleText > mXText; // TextRef des globalen Text ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > mXCursor; diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 10932acc9fa5..45d2abe65944 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -405,7 +405,18 @@ sal_uInt32 PPTWriter::ImplInsertBookmarkURL( const String& rBookmarkURL, const s const String& rStringVer0, const String& rStringVer1, const String& rStringVer2, const String& rStringVer3 ) { sal_uInt32 nHyperId = ++mnExEmbed; - maHyperlink.Insert( new EPPTHyperlink( rBookmarkURL, nType ), LIST_APPEND ); + + rtl::OUString sBookmarkURL( rBookmarkURL ); + INetURLObject aBaseURI( maBaseURI ); + INetURLObject aBookmarkURI( rBookmarkURL ); + if( aBaseURI.GetProtocol() == aBookmarkURI.GetProtocol() ) + { + rtl::OUString aRelUrl( INetURLObject::GetRelURL( maBaseURI, rBookmarkURL, + INetURLObject::WAS_ENCODED, INetURLObject::DECODE_TO_IURI, RTL_TEXTENCODING_UTF8, INetURLObject::FSYS_DETECT ) ); + if ( aRelUrl.getLength() ) + sBookmarkURL = aRelUrl; + } + maHyperlink.Insert( new EPPTHyperlink( sBookmarkURL, nType ), LIST_APPEND ); *mpExEmbed << (sal_uInt16)0xf << (sal_uInt16)EPP_ExHyperlink diff --git a/sd/source/filter/eppt/escherex.cxx b/sd/source/filter/eppt/escherex.cxx index 7714ca4d761b..70e1b065fc9c 100644 --- a/sd/source/filter/eppt/escherex.cxx +++ b/sd/source/filter/eppt/escherex.cxx @@ -36,9 +36,10 @@ // --------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------- -PptEscherEx::PptEscherEx( SvStream& rOutStrm ) : +PptEscherEx::PptEscherEx( SvStream& rOutStrm, const rtl::OUString& rBaseURI ) : EscherEx( EscherExGlobalRef( new EscherExGlobal ), rOutStrm ) { + mxGlobal->SetBaseURI( rBaseURI ); mnCurrentDg = 0; } diff --git a/sd/source/filter/eppt/escherex.hxx b/sd/source/filter/eppt/escherex.hxx index 4b77a1a755c1..1d053afb88c7 100644 --- a/sd/source/filter/eppt/escherex.hxx +++ b/sd/source/filter/eppt/escherex.hxx @@ -60,7 +60,7 @@ class PptEscherEx : public EscherEx public: - PptEscherEx( SvStream& rOut ); + PptEscherEx( SvStream& rOut, const rtl::OUString& ); ~PptEscherEx(); void OpenContainer( sal_uInt16 n_EscherContainer, int nRecInstance = 0 ); diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx index 62ddab21eea7..8a6056740342 100644 --- a/sd/source/filter/sdpptwrp.cxx +++ b/sd/source/filter/sdpptwrp.cxx @@ -52,7 +52,7 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::task; using namespace ::com::sun::star::frame; -typedef sal_Bool ( __LOADONCALLAPI *ExportPPT )( SvStorageRef&, +typedef sal_Bool ( __LOADONCALLAPI *ExportPPT )( const std::vector< com::sun::star::beans::PropertyValue >&, SvStorageRef&, Reference< XModel > &, Reference< XStatusIndicator > &, SvMemoryStream*, sal_uInt32 nCnvrtFlags ); @@ -166,7 +166,14 @@ sal_Bool SdPPTFilter::Export() if( mbShowProgress ) CreateStatusIndicator(); - bRet = PPTExport( xStorRef, mxModel, mxStatusIndicator, pBas, nCnvrtFlags ); + rtl::OUString sBaseURI( RTL_CONSTASCII_USTRINGPARAM("BaseURI") ); + std::vector< PropertyValue > aProperties; + PropertyValue aProperty; + aProperty.Name = sBaseURI; + aProperty.Value = makeAny( mrMedium.GetBaseURL( true ) ); + aProperties.push_back( aProperty ); + + bRet = PPTExport( aProperties, xStorRef, mxModel, mxStatusIndicator, pBas, nCnvrtFlags ); xStorRef->Commit(); } } |