incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1167624 - in /incubator/ooo/trunk/main: filter/inc/filter/msfilter/ filter/source/msfilter/ sd/source/filter/ sd/source/filter/eppt/
Date Sat, 10 Sep 2011 22:44:33 GMT
Author: erack
Date: Sat Sep 10 22:44:32 2011
New Revision: 1167624

URL: http://svn.apache.org/viewvc?rev=1167624&view=rev
Log:
impress212: #i97241# added relative links

# User sj <sj@openoffice.org>

Modified:
    incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx
    incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx
    incubator/ooo/trunk/main/sd/source/filter/eppt/eppt.cxx
    incubator/ooo/trunk/main/sd/source/filter/eppt/eppt.hxx
    incubator/ooo/trunk/main/sd/source/filter/eppt/epptso.cxx
    incubator/ooo/trunk/main/sd/source/filter/eppt/escherex.cxx
    incubator/ooo/trunk/main/sd/source/filter/eppt/escherex.hxx
    incubator/ooo/trunk/main/sd/source/filter/sdpptwrp.cxx

Modified: incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx?rev=1167624&r1=1167623&r2=1167624&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx (original)
+++ incubator/ooo/trunk/main/filter/inc/filter/msfilter/escherex.hxx Sat Sep 10 22:44:32 2011
@@ -42,6 +42,7 @@
 #include <com/sun/star/awt/Rectangle.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/PropertyState.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/drawing/BitmapMode.hpp>
 #include <com/sun/star/drawing/Hatch.hpp>
 #include <svx/msdffdef.hxx>
@@ -1082,6 +1083,8 @@ class MSFILTER_DLLPUBLIC EscherGraphicPr
 		sal_uInt32				mnBlibBufSize;
 		sal_uInt32				mnBlibEntrys;
 
+		rtl::OUString			maBaseURI;
+
 	protected :
 
 		sal_uInt32					ImplInsertBlib( EscherBlibEntry* p_EscherBlibEntry );
@@ -1100,6 +1103,9 @@ class MSFILTER_DLLPUBLIC EscherGraphicPr
 
 		sal_Bool	GetPrefSize( const sal_uInt32 nBlibId, Size& rSize, MapMode& rMapMode
);
 
+		void		SetBaseURI( const rtl::OUString& rBaseURI ) { maBaseURI = rBaseURI; };
+		const rtl::OUString& GetBaseURI(){ return maBaseURI; };
+
 		EscherGraphicProvider( sal_uInt32 nFlags = _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
 		~EscherGraphicProvider();
 
@@ -1439,12 +1445,12 @@ class MSFILTER_DLLPUBLIC EscherEx : publ
     protected:
         typedef ::std::auto_ptr< ImplEscherExSdr > ImplEscherExSdrPtr;
 
-        EscherExGlobalRef       mxGlobal;
-        ImplEscherExSdrPtr      mpImplEscherExSdr;
-		SvStream*				mpOutStrm;
+        EscherExGlobalRef			mxGlobal;
+        ImplEscherExSdrPtr			mpImplEscherExSdr;
+		SvStream*					mpOutStrm;
 		sal_uInt32					mnStrmStartOfs;
-		std::vector< sal_uInt32 > mOffsets;
-		std::vector< sal_uInt16 > mRecTypes;
+		std::vector< sal_uInt32 >	mOffsets;
+		std::vector< sal_uInt16 >	mRecTypes;
 
 		sal_uInt32					mnCurrentDg;
 		sal_uInt32					mnCountOfs;

Modified: incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx?rev=1167624&r1=1167623&r2=1167624&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/msfilter/escherex.cxx Sat Sep 10 22:44:32 2011
@@ -1418,6 +1418,21 @@ sal_Bool EscherPropertyContainer::Create
                         delete pIn;
                     }
                 }
+				if ( !aUniqueId.Len() )
+				{
+					if ( pGraphicProvider )
+					{
+						const rtl::OUString& rBaseURI( pGraphicProvider->GetBaseURI() );
+						INetURLObject aBaseURI( rBaseURI );
+						if( aBaseURI.GetProtocol() == aTmp.GetProtocol() )
+						{
+							rtl::OUString aRelUrl( INetURLObject::GetRelURL( rBaseURI, aGraphicUrl, 
+								INetURLObject::WAS_ENCODED, INetURLObject::DECODE_TO_IURI, RTL_TEXTENCODING_UTF8,
INetURLObject::FSYS_DETECT ) );
+							if ( aRelUrl.getLength() )
+								aGraphicUrl = aRelUrl;
+						}
+					}
+				}
             }
         }
 

Modified: incubator/ooo/trunk/main/sd/source/filter/eppt/eppt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/filter/eppt/eppt.cxx?rev=1167624&r1=1167623&r2=1167624&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/filter/eppt/eppt.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/filter/eppt/eppt.cxx Sat Sep 10 22:44:32 2011
@@ -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& rSvS
     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
 // - 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
     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 );

Modified: incubator/ooo/trunk/main/sd/source/filter/eppt/eppt.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/filter/eppt/eppt.hxx?rev=1167624&r1=1167623&r2=1167624&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/filter/eppt/eppt.hxx (original)
+++ incubator/ooo/trunk/main/sd/source/filter/eppt/eppt.hxx Sat Sep 10 22:44:32 2011
@@ -689,7 +689,6 @@ class PPTWriter : public GroupTable, pub
 		std::vector< PPTExStyleSheet* >	maStyleSheetList;
 		PPTExStyleSheet*				mpStyleSheet;
 
-		EscherGraphicProvider*			mpGraphicProvider;
 		Fraction						maFraction;
 		MapMode							maMapModeSrc;
 		MapMode							maMapModeDest;
@@ -697,6 +696,7 @@ class PPTWriter : public GroupTable, pub
 		::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, pub
 		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 );

Modified: incubator/ooo/trunk/main/sd/source/filter/eppt/epptso.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/filter/eppt/epptso.cxx?rev=1167624&r1=1167623&r2=1167624&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/filter/eppt/epptso.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/filter/eppt/epptso.cxx Sat Sep 10 22:44:32 2011
@@ -642,7 +642,18 @@ sal_uInt32 PPTWriter::ImplInsertBookmark
 	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

Modified: incubator/ooo/trunk/main/sd/source/filter/eppt/escherex.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/filter/eppt/escherex.cxx?rev=1167624&r1=1167623&r2=1167624&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/filter/eppt/escherex.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/filter/eppt/escherex.cxx Sat Sep 10 22:44:32 2011
@@ -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;
 }
 

Modified: incubator/ooo/trunk/main/sd/source/filter/eppt/escherex.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/filter/eppt/escherex.hxx?rev=1167624&r1=1167623&r2=1167624&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/filter/eppt/escherex.hxx (original)
+++ incubator/ooo/trunk/main/sd/source/filter/eppt/escherex.hxx Sat Sep 10 22:44:32 2011
@@ -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 );

Modified: incubator/ooo/trunk/main/sd/source/filter/sdpptwrp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/filter/sdpptwrp.cxx?rev=1167624&r1=1167623&r2=1167624&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/filter/sdpptwrp.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/filter/sdpptwrp.cxx Sat Sep 10 22:44:32 2011
@@ -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();
 			}
 		}



Mime
View raw message