diff options
author | Petr Mladek <pmladek@suse.cz> | 2011-04-28 16:12:04 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2011-04-28 16:12:04 +0200 |
commit | b8013ea8c4c31c0f107c00cdfab22aea81d097e0 (patch) | |
tree | f7b49a36c9305733af4af37fb54bfe6d066a733c | |
parent | 7f4b5f7324bdacb2b8a00de4b77a8a447c5c5db8 (diff) |
pushed normalize-template-paths-fix.diff into git
-rw-r--r-- | patches/dev300/apply | 4 | ||||
-rw-r--r-- | patches/dev300/normalize-template-paths-fix.diff | 84 |
2 files changed, 0 insertions, 88 deletions
diff --git a/patches/dev300/apply b/patches/dev300/apply index 81ca0ca87..3f9235559 100644 --- a/patches/dev300/apply +++ b/patches/dev300/apply @@ -1227,10 +1227,6 @@ ubuntu-arm-thumb.diff, doko # FIXME: still needed for GCC-4.5? #ubuntu-arm-thumb.diff, doko -[ Fixes ] -# expand path placeholders early in template dialog -normalize-template-paths-fix.diff, n#512146, thorsten - [ Experimental ] experimental_ooapi.diff, flr diff --git a/patches/dev300/normalize-template-paths-fix.diff b/patches/dev300/normalize-template-paths-fix.diff deleted file mode 100644 index 8d83e9b80..000000000 --- a/patches/dev300/normalize-template-paths-fix.diff +++ /dev/null @@ -1,84 +0,0 @@ ---- comphelper/source/officeinstdir/officeinstallationdirectories.cxx -+++ comphelper/source/officeinstdir/officeinstallationdirectories.cxx -@@ -159,9 +159,9 @@ OfficeInstallationDirectories::makeRelocatableURL( const rtl::OUString& URL ) - if ( nIndex != -1 ) - { - return rtl::OUString( -- URL.replaceAt( nIndex, -- m_pOfficeBrandDir->getLength(), -- m_aOfficeBrandDirMacro ) ); -+ aCanonicalURL.replaceAt( nIndex, -+ m_pOfficeBrandDir->getLength(), -+ m_aOfficeBrandDirMacro ) ); - } - else - { -@@ -169,9 +169,9 @@ OfficeInstallationDirectories::makeRelocatableURL( const rtl::OUString& URL ) - if ( nIndex != -1 ) - { - return rtl::OUString( -- URL.replaceAt( nIndex, -- m_pUserDir->getLength(), -- m_aUserDirMacro ) ); -+ aCanonicalURL.replaceAt( nIndex, -+ m_pUserDir->getLength(), -+ m_aUserDirMacro ) ); - } - } - } ---- sfx2/source/doc/doctemplates.cxx -+++ sfx2/source/doc/doctemplates.cxx -@@ -48,6 +48,7 @@ - #include <com/sun/star/beans/XPropertySetInfo.hpp> - #include <com/sun/star/beans/XPropertyContainer.hpp> - #include <com/sun/star/beans/StringPair.hpp> -+#include <com/sun/star/util/XMacroExpander.hpp> - #include <com/sun/star/container/XContainerQuery.hpp> - #include <com/sun/star/document/XTypeDetection.hpp> - #include <com/sun/star/document/XStandaloneDocumentInfo.hpp> -@@ -599,11 +600,45 @@ void SfxDocTplService_Impl::getDirList() - - maTemplateDirs = Sequence< OUString >( nCount ); - -+ uno::Reference< XComponentContext > xCtx; -+ uno::Reference< util::XMacroExpander > xExpander; -+ uno::Reference< XPropertySet > xPropSet( mxFactory, UNO_QUERY ); -+ const rtl::OUString aPrefix( -+ RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.expand:" ) ); -+ -+ if ( xPropSet.is() ) -+ { -+ xPropSet->getPropertyValue( -+ rtl::OUString( -+ RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ) -+ >>= xCtx; -+ } -+ -+ if ( xCtx.is() ) -+ { -+ xCtx->getValueByName( -+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( -+ "/singletons/com.sun.star.util.theMacroExpander" ) ) ) -+ >>= xExpander; -+ -+ OSL_ENSURE( xExpander.is(), -+ "Unable to obtain macro expander singleton!" ); -+ } -+ - for ( sal_uInt16 i=0; i<nCount; i++ ) - { - aURL.SetSmartProtocol( INET_PROT_FILE ); - aURL.SetURL( aDirs.GetToken( i, C_DELIM ) ); - maTemplateDirs[i] = aURL.GetMainURL( INetURLObject::NO_DECODE ); -+ -+ sal_Int32 nIndex = maTemplateDirs[i].indexOf( aPrefix ); -+ if ( nIndex != -1 && xExpander.is() ) -+ { -+ maTemplateDirs[i] = maTemplateDirs[i].replaceAt(nIndex, -+ aPrefix.getLength(), -+ rtl::OUString()); -+ maTemplateDirs[i] = xExpander->expandMacros( maTemplateDirs[i] ); -+ } - } - - aValue <<= maTemplateDirs; |