summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorEike Rathke <erack@apache.org>2011-09-10 21:44:32 +0000
committerEike Rathke <erack@apache.org>2011-09-10 21:44:32 +0000
commit9950d63e0ca1b1a62b5c737fba13ff7ff66f25bf (patch)
tree19aba7c7d6d7856f83ae1c018ee5f6714d4fecfb /sd
parent3eafeff77a921c90c0f0ce44699c6cfe7473a546 (diff)
impress212: #i97241# added relative links
# User sj <sj@openoffice.org>
Diffstat (limited to 'sd')
-rwxr-xr-xsd/source/filter/eppt/eppt.cxx20
-rwxr-xr-xsd/source/filter/eppt/eppt.hxx4
-rw-r--r--sd/source/filter/eppt/epptso.cxx13
-rwxr-xr-xsd/source/filter/eppt/escherex.cxx3
-rwxr-xr-xsd/source/filter/eppt/escherex.hxx2
-rwxr-xr-xsd/source/filter/sdpptwrp.cxx11
6 files changed, 42 insertions, 11 deletions
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 292db06bb472..062919942d7c 100755
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -121,7 +121,7 @@ static PHLayout pPHLayout[] =
//============================ 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 ) :
@@ -205,7 +205,19 @@ PPTWriter::PPTWriter( SvStorageRef& rSvStorage,
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 );
if ( !ImplGetStyleSheets() )
return;
@@ -2452,7 +2464,7 @@ void PPTExStyleSheet::WriteTxCFStyleAtom( SvStream& rSt )
// - 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 )
@@ -2460,7 +2472,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 )
{
bStatus = ( pPPTWriter->IsValid() == sal_True );
diff --git a/sd/source/filter/eppt/eppt.hxx b/sd/source/filter/eppt/eppt.hxx
index 288e9bb03380..321c3fc05196 100755
--- a/sd/source/filter/eppt/eppt.hxx
+++ b/sd/source/filter/eppt/eppt.hxx
@@ -689,7 +689,6 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
std::vector< PPTExStyleSheet* > maStyleSheetList;
PPTExStyleSheet* mpStyleSheet;
- EscherGraphicProvider* mpGraphicProvider;
Fraction maFraction;
MapMode maMapModeSrc;
MapMode maMapModeDest;
@@ -697,6 +696,7 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
::com::sun::star::awt::Size maNotesPageSize;
PageType meLatestPageType;
List maSlideNameList;
+ rtl::OUString maBaseURI;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mXModel;
::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mXStatusIndicator;
@@ -834,7 +834,7 @@ class PPTWriter : public GroupTable, public PropValue, public PPTExBulletProvide
sal_Bool ImplCloseDocument(); // die font-, hyper-, Soundliste wird geschrieben ..
public:
- PPTWriter( SvStorageRef& rSvStorage,
+ PPTWriter( const std::vector< com::sun::star::beans::PropertyValue >&, SvStorageRef& rSvStorage,
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rModel,
::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > & rStatInd,
SvMemoryStream* pVBA, sal_uInt32 nCnvrtFlags );
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index a54bb8f1c6d0..b313d7ba746d 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -642,7 +642,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 b4aa5926e68a..402b54998aab 100755
--- a/sd/source/filter/eppt/escherex.cxx
+++ b/sd/source/filter/eppt/escherex.cxx
@@ -37,9 +37,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 f65de369ab03..b0790e7f669e 100755
--- a/sd/source/filter/eppt/escherex.hxx
+++ b/sd/source/filter/eppt/escherex.hxx
@@ -59,7 +59,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 f68a84ad9f7c..86c7895e5c2f 100755
--- a/sd/source/filter/sdpptwrp.cxx
+++ b/sd/source/filter/sdpptwrp.cxx
@@ -51,7 +51,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 );
@@ -172,7 +172,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();
}
}