summaryrefslogtreecommitdiff
path: root/toolkit/workben
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 16:05:12 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 16:05:12 +0000
commitfd2cf3dc7cd9c73070fa4d70c8ca99c9fc1ce135 (patch)
tree9569a564e06fba817528ea414129b4074d83cb61 /toolkit/workben
parentff09f8d6ef2c613037f039dbcafcad6b76243a48 (diff)
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'toolkit/workben')
-rw-r--r--toolkit/workben/makefile.mk15
-rw-r--r--toolkit/workben/unodialog.cxx69
2 files changed, 55 insertions, 29 deletions
diff --git a/toolkit/workben/makefile.mk b/toolkit/workben/makefile.mk
index ca974dd14b3a..8a843152ace8 100644
--- a/toolkit/workben/makefile.mk
+++ b/toolkit/workben/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.4 $
+# $Revision: 1.5 $
#
-# last change: $Author: jbu $ $Date: 2002-01-15 14:04:13 $
+# last change: $Author: hr $ $Date: 2003-03-27 17:05:05 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -98,10 +98,6 @@ APP2DEF= $(MISC)$/unodialog.def
# --- Targets ------------------------------------------------------
-ALL : \
- ALLTAR \
- $(BIN)$/applicat.rdb
-
.INCLUDE : target.mk
@@ -123,10 +119,3 @@ $(MISC)$/unodialog.def: makefile.mk
echo STACKSIZE 32768 >>$@
.ENDIF
-
-$(BIN)$/applicat.rdb : makefile.mk $(SOLARBINDIR)$/applicat.rdb
- rm -f $@
- $(GNUCOPY) $(SOLARBINDIR)$/applicat.rdb $@
- +cd $(BIN) && \
- regcomp -register -r applicat.rdb \
- -c $(DLLPRE)tk$(UPD)$(DLLPOSTFIX)$(DLLPOST) \ No newline at end of file
diff --git a/toolkit/workben/unodialog.cxx b/toolkit/workben/unodialog.cxx
index 9583d59b5b5c..59821f603700 100644
--- a/toolkit/workben/unodialog.cxx
+++ b/toolkit/workben/unodialog.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unodialog.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: jbu $ $Date: 2002-01-15 14:04:13 $
+ * last change: $Author: hr $ $Date: 2003-03-27 17:05:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -58,7 +58,6 @@
*
*
************************************************************************/
-#include <stdio.h>
#define NOOLDSV
#ifndef _SVWIN_H
@@ -118,27 +117,65 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::registry;
using namespace ::com::sun::star::lang;
-// -----------------------------------------------------------------------
-void Main( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
-SAL_IMPLEMENT_MAIN()
+
+::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > createApplicationServiceManager()
{
try
{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- xMSF = cppu::createRegistryServiceFactory(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
+ ::rtl::OUString localRegistry = ::comphelper::getPathToUserRegistry();
+ ::rtl::OUString systemRegistry = ::comphelper::getPathToSystemRegistry();
- //SVInit( xMSF );
- ::Main( xMSF );
- //SVDeinit();
+ Reference< XSimpleRegistry > xLocalRegistry( ::cppu::createSimpleRegistry() );
+ Reference< XSimpleRegistry > xSystemRegistry( ::cppu::createSimpleRegistry() );
+ if ( xLocalRegistry.is() && (localRegistry.getLength() > 0) )
+ {
+ try
+ {
+ xLocalRegistry->open( localRegistry, sal_False, sal_True);
+ }
+ catch ( InvalidRegistryException& )
+ {
+ }
+
+ if ( !xLocalRegistry->isValid() )
+ xLocalRegistry->open(localRegistry, sal_True, sal_True);
+ }
+
+ if ( xSystemRegistry.is() && (systemRegistry.getLength() > 0) )
+ xSystemRegistry->open( systemRegistry, sal_True, sal_False);
+
+ if ( (xLocalRegistry.is() && xLocalRegistry->isValid()) &&
+ (xSystemRegistry.is() && xSystemRegistry->isValid()) )
+ {
+ Reference < XSimpleRegistry > xReg( ::cppu::createNestedRegistry() );
+ Sequence< Any > seqAnys(2);
+ seqAnys[0] <<= xLocalRegistry ;
+ seqAnys[1] <<= xSystemRegistry ;
+ Reference< XInitialization > xInit( xReg, UNO_QUERY );
+ xInit->initialize( seqAnys );
+
+ Reference< XComponentContext > xContext( ::cppu::bootstrap_InitialComponentContext( xReg ) );
+ return Reference< XMultiServiceFactory >( xContext->getServiceManager(), UNO_QUERY );
+ }
}
- catch ( Exception & e )
+ catch( ::com::sun::star::uno::Exception& )
{
- fprintf( stderr, "Error during bootstrapping servicemanager: %s\n" ,
- OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
- return 1;
}
+
+ return ::cppu::createServiceFactory();
+}
+
+
+// -----------------------------------------------------------------------
+void Main( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
+
+SAL_IMPLEMENT_MAIN()
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = createApplicationServiceManager();
+ //SVInit( xMSF );
+ ::Main( xMSF );
+ //SVDeinit();
return NULL;
}