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



Author: jannieuw
Date: Mon Jun  2 14:53:45 2008
New Revision: 12754
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12754&view=rev

Log:
2008-06-02  Jan Nieuwenhuizen  <janneke gnu org>

	* patches/dev300/gengal-three-layer-install-svx.diff: Remove need
	for setting OOO_INSTALL_PREFIX, may fix gengal in Windows.  Some
	cleanups.


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	Mon Jun  2 14:53:45 2008
@@ -1,3 +1,98 @@
+diff --git a/source/gengal/gengal.cxx b/source/gengal/gengal.cxx
+index 70c270a..67e4112 100644
+--- svx/source/gengal/gengal.cxx
++++ svx/source/gengal/gengal.cxx
+@@ -84,23 +84,12 @@ class GalApp : public Application
+ {
+ public:
+ 	virtual void Main();
+-};
+-
+-Reference< XMultiServiceFactory > createApplicationServiceManager()
+-{
+-    Reference< XMultiServiceFactory > xMS;
+-	try
+-	{
+-		Reference< XComponentContext > xComponentContext = ::cppu::defaultBootstrap_InitialComponentContext();
+-        if ( xComponentContext.is() )
+-		    xMS = xMS.query( xComponentContext->getServiceManager() );
+-	}
+-	catch( ::com::sun::star::uno::Exception& )
+-	{
+-	}
+ 
+-	return xMS;
+-}
++protected:
++    Reference<XMultiServiceFactory> xMSF;
++    void Init();
++    void InitUCB();
++};
+ 
+ Gallery* createGallery( const rtl::OUString& aGalleryURL )
+ {
+@@ -239,31 +228,30 @@ static OUString Smartify( const OUString &rPath )
+ 	return aURL.GetMainURL( INetURLObject::NO_DECODE );
+ }
+ 
+-// Cut/paste [ evilness ] from Desktop::CreateApplicationServiceManager()
+-Reference< XMultiServiceFactory > CreateApplicationServiceManager()
+-{
+-	try
+-	{
+-		Reference<XComponentContext> xComponentContext = ::cppu::defaultBootstrap_InitialComponentContext();
+-		Reference<XMultiServiceFactory> xMS(xComponentContext->getServiceManager(), UNO_QUERY);
+-
+-		return xMS;
+-	}
+-	catch( ::com::sun::star::uno::Exception& )
+-	{
+-	}
+-
+-	return Reference< XMultiServiceFactory >();
+-}
++#define OUSTRING_CSTR( str ) \
++    rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ).getStr()
+ 
+-void GalApp::Main()
++void GalApp::Init()
+ {
+-	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 );
++    OSL_TRACE( "OOO_INSTALL_PREFIX=%s", getenv( "OOO_INSTALL_PREFIX" ) );
++
++	Reference<XComponentContext> xComponentContext
++        = ::cppu::defaultBootstrap_InitialComponentContext();
++	xMSF = Reference<XMultiServiceFactory>
++        ( xComponentContext->getServiceManager(), UNO_QUERY );
+ 	if( !xMSF.is() )
+ 		fprintf( stderr, "Failed to bootstrap\n" );
+ 	::comphelper::setProcessServiceFactory( xMSF );
+-	
++
++    InitUCB();
++}
++
++void GalApp::InitUCB()
++{
+ 	OUString aEmpty;
+ 	Sequence< Any > aArgs(6);
+ 	aArgs[0]
+@@ -277,7 +265,10 @@ void GalApp::Main()
+ 
+ 	if (! ::ucbhelper::ContentBroker::initialize( xMSF, aArgs ) )
+ 		fprintf( stderr, "Failed to init content broker\n" );
++}
+ 
++void GalApp::Main()
++{
+ 	bool bHelp = false;
+ 	rtl::OUString aPath, aDestDir;
+ 	rtl::OUString aName = rtl::OUString::createFromAscii( "Default name" );
 diff --git a/source/gengal/gengal.sh b/source/gengal/gengal.sh
 index e7b3a81..9e614ee 100644
 --- svx/source/gengal/gengal.sh



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