[Libreoffice-commits] .: Branch 'libreoffice-3-4' - patches/dev300

Petr Mladek pmladek at kemper.freedesktop.org
Thu Apr 28 07:12:28 PDT 2011


 patches/dev300/apply                             |    4 -
 patches/dev300/normalize-template-paths-fix.diff |   84 -----------------------
 2 files changed, 88 deletions(-)

New commits:
commit b8013ea8c4c31c0f107c00cdfab22aea81d097e0
Author: Petr Mladek <pmladek at suse.cz>
Date:   Thu Apr 28 16:12:04 2011 +0200

    pushed normalize-template-paths-fix.diff into git

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 81ca0ca..3f92355 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 8d83e9b..0000000
--- 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;


More information about the Libreoffice-commits mailing list