From 5482dcbbc6b4f1e04b7dd31289b9e2f12679c1cf Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 24 Nov 2010 09:35:49 +0100 Subject: dba34b: #i115760# expand vnd.sun.star.expand URLs before calling makeRelocatable/AbsoluteURL --- sfx2/source/doc/doctemplates.cxx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'sfx2/source/doc/doctemplates.cxx') diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 71f3683c0006..0f83f06020cf 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -31,6 +31,7 @@ #include "doctemplates.hxx" #include #include +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +61,6 @@ #include #include #include -#include #include #include @@ -2875,12 +2876,36 @@ void SfxURLRelocator_Impl::initOfficeInstDirs() } } +// ----------------------------------------------------------------------- +void SfxURLRelocator_Impl::implExpandURL( ::rtl::OUString& io_url ) +{ + const INetURLObject aParser( io_url ); + if ( aParser.GetProtocol() != INET_PROT_VND_SUN_STAR_EXPAND ) + return; + + io_url = aParser.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ); + try + { + if ( !mxMacroExpander.is() ) + { + ::comphelper::ComponentContext aContext( mxFactory ); + mxMacroExpander.set( aContext.getSingleton( "com.sun.star.util.theMacroExpander" ), UNO_QUERY_THROW ); + } + io_url = mxMacroExpander->expandMacros( io_url ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + // ----------------------------------------------------------------------- void SfxURLRelocator_Impl::makeRelocatableURL( rtl::OUString & rURL ) { if ( rURL.getLength() > 0 ) { initOfficeInstDirs(); + implExpandURL( rURL ); rURL = mxOfficeInstDirs->makeRelocatableURL( rURL ); } } @@ -2891,6 +2916,7 @@ void SfxURLRelocator_Impl::makeAbsoluteURL( rtl::OUString & rURL ) if ( rURL.getLength() > 0 ) { initOfficeInstDirs(); + implExpandURL( rURL ); rURL = mxOfficeInstDirs->makeAbsoluteURL( rURL ); } } -- cgit From dcd8e4664d9a284c24ceb0360cab0606b22cf86d Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Fri, 7 Jan 2011 17:14:47 +0100 Subject: removetooltypes: #i112600# remove tooltypes --- sfx2/source/doc/doctemplates.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'sfx2/source/doc/doctemplates.cxx') diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 8644e79f611d..b779830b19b4 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -128,7 +128,7 @@ using namespace ::comphelper; class WaitWindow_Impl : public WorkWindow { Rectangle _aRect; - USHORT _nTextStyle; + sal_uInt16 _nTextStyle; String _aText; public: @@ -386,8 +386,8 @@ public: const OUString& rTargetURL, const OUString& rType, const OUString& rHierURL ); - ULONG count() { return maEntries.Count(); } - DocTemplates_EntryData_Impl* getEntry( ULONG nPos ) { return maEntries.GetObject( nPos ); } + sal_uIntPtr count() { return maEntries.Count(); } + DocTemplates_EntryData_Impl* getEntry( sal_uIntPtr nPos ) { return maEntries.GetObject( nPos ); } }; DECLARE_LIST( GroupList_Impl, GroupData_Impl* ) @@ -549,9 +549,9 @@ void SfxDocTplService_Impl::readFolderList() NamePair_Impl* pPair; - USHORT nCount = (USHORT)( Min( aShortNames.Count(), aLongNames.Count() ) ); + sal_uInt16 nCount = (sal_uInt16)( Min( aShortNames.Count(), aLongNames.Count() ) ); - for ( USHORT i=0; imaShortName = aShortNames.GetString( i ); @@ -594,11 +594,11 @@ void SfxDocTplService_Impl::getDirList() // TODO/LATER: let use service, register listener INetURLObject aURL; String aDirs = SvtPathOptions().GetTemplatePath(); - USHORT nCount = aDirs.GetTokenCount( C_DELIM ); + sal_uInt16 nCount = aDirs.GetTokenCount( C_DELIM ); maTemplateDirs = Sequence< OUString >( nCount ); - for ( USHORT i=0; igetTargetURL() ) ); - ULONG nCount = pGroup->count(); - for ( ULONG i=0; icount(); + for ( sal_uIntPtr i=0; igetEntry( i ); if ( ! pData->getInUse() ) @@ -2462,7 +2462,7 @@ void SfxDocTplService_Impl::addHierGroup( GroupList_Impl& rList, { while ( xResultSet->next() ) { - BOOL bUpdateType = sal_False; + sal_Bool bUpdateType = sal_False; DocTemplates_EntryData_Impl *pData; OUString aTitle( xRow->getString( 1 ) ); @@ -2727,8 +2727,8 @@ void SfxDocTplService_Impl::addGroupToHierarchy( GroupData_Impl *pGroup ) setProperty( aGroup, aAdditionalProp, makeAny( pGroup->getTargetURL() ) ); pGroup->setHierarchyURL( aNewGroupURL ); - ULONG nCount = pGroup->count(); - for ( ULONG i=0; icount(); + for ( sal_uIntPtr i=0; igetEntry( i ); addToHierarchy( pGroup, pData ); // add entry to hierarchy -- cgit