ooo-build r12861 - in trunk: . patches/dev300



Author: tml
Date: Wed Jun 11 13:51:19 2008
New Revision: 12861
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12861&view=rev

Log:
2008-06-11  Tor Lillqvist  <tml novell com>
	
	* patches/dev300/gengal-three-layer-install-svx.diff: No setenv()
	in the Microsoft C library, so use putenv() instead
	cross-platform. Look for backslashes too on Windows.



Modified:
   trunk/ChangeLog
   trunk/patches/dev300/gengal-three-layer-install-svx.diff

Modified: trunk/patches/dev300/gengal-three-layer-install-svx.diff
==============================================================================
--- trunk/patches/dev300/gengal-three-layer-install-svx.diff	(original)
+++ trunk/patches/dev300/gengal-three-layer-install-svx.diff	Wed Jun 11 13:51:19 2008
@@ -31,7 +31,7 @@
  
  Gallery* createGallery( const rtl::OUString& aGalleryURL )
  {
-@@ -239,31 +228,30 @@ static OUString Smartify( const OUString &rPath )
+@@ -239,31 +228,40 @@ static OUString Smartify( const OUString &rPath )
  	return aURL.GetMainURL( INetURLObject::NO_DECODE );
  }
  
@@ -59,10 +59,20 @@
  {
 -	Reference<XComponentContext> xComponentContext = ::cppu::defaultBootstrap_InitialComponentContext();
 -	Reference<XMultiServiceFactory> xMSF(xComponentContext->getServiceManager(), UNO_QUERY);
-+    OUString fileName = GetAppFileName();
-+    OUString baseBinDir = fileName.copy( 0, fileName.lastIndexOf( '/' ) );
-+    OUString installPrefix = baseBinDir + OUString::createFromAscii( "/../.." );
-+    setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( installPrefix ), 0 );
++    if( getenv( "OOO_INSTALL_PREFIX" ) == NULL ) {
++		OUString fileName = GetAppFileName();
++		int lastSlash = fileName.lastIndexOf( '/' );
++#ifdef WNT
++		// Don't know which directory separators GetAppFileName() returns on Windows.
++		// Be safe and take into consideration they might be backslashes.
++		if( fileName.lastIndexOf( '\\' ) > lastSlash )
++		    lastSlash = fileName.lastIndexOf( '\\' );
++#endif
++		OUString baseBinDir = fileName.copy( 0, lastSlash );
++		OUString installPrefix = baseBinDir + OUString::createFromAscii( "/../.." );
++		OUString assignment = OUString::createFromAscii( "OOO_INSTALL_PREFIX=" ) + installPrefix;
++		putenv( strdup( OUSTRING_CSTR( assignment )));
++    }
 +    OSL_TRACE( "OOO_INSTALL_PREFIX=%s", getenv( "OOO_INSTALL_PREFIX" ) );
 +
 +	Reference<XComponentContext> xComponentContext



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]