summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2009-01-20 12:50:17 +0000
committerVladimir Glazounov <vg@openoffice.org>2009-01-20 12:50:17 +0000
commit39674f5673cc62260f4c0d29a0d597182ca6909f (patch)
treefdd5920804d36cd56f67005769a00c5762dd44cf
parenta5e605523eba8bcb84e3d7f1dca0e371bb194d8a (diff)
CWS-TOOLING: integrate CWS fixgengal_DEV300
-rw-r--r--svx/prj/d.lst1
-rw-r--r--svx/source/gengal/gengal.cxx73
-rw-r--r--svx/source/gengal/gengal.sh10
-rw-r--r--svx/source/gengal/makefile.mk8
4 files changed, 53 insertions, 39 deletions
diff --git a/svx/prj/d.lst b/svx/prj/d.lst
index 431e76d116..e55f2a5858 100644
--- a/svx/prj/d.lst
+++ b/svx/prj/d.lst
@@ -12,6 +12,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\global\accelerator\es
..\%__SRC%\lib\lib*.* %_DEST%\lib%_EXT%\lib*.*
..\%__SRC%\lib\isvx.lib %_DEST%\lib%_EXT%\isvx.lib
..\%__SRC%\bin\gengal* %_DEST%\bin%_EXT%\gengal*
+..\%__SRC%\bin\gengalrc %_DEST%\bin%_EXT%\gengal.ini
..\%__SRC%\bin\cui*.dll %_DEST%\bin%_EXT%\cui*.dll
..\%__SRC%\bin\svx*.dll %_DEST%\bin%_EXT%\svx*.dll
..\%__SRC%\bin\textconv*.dll %_DEST%\bin%_EXT%\textconv*.dll
diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx
index 959665083c..a12dc65597 100644
--- a/svx/source/gengal/gengal.cxx
+++ b/svx/source/gengal/gengal.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: gengal.cxx,v $
- * $Revision: 1.10 $
+ * $Revision: 1.10.288.1 $
*
* This file is part of OpenOffice.org.
*
@@ -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,40 @@ 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);
+#define OUSTRING_CSTR( str ) \
+ rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ).getStr()
- return xMS;
- }
- catch( ::com::sun::star::uno::Exception& )
- {
+void GalApp::Init()
+{
+ 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" ) );
- return Reference< XMultiServiceFactory >();
-}
-
-void GalApp::Main()
-{
- Reference<XComponentContext> xComponentContext = ::cppu::defaultBootstrap_InitialComponentContext();
- Reference<XMultiServiceFactory> xMSF(xComponentContext->getServiceManager(), UNO_QUERY);
+ 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 +275,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/svx/source/gengal/gengal.sh b/svx/source/gengal/gengal.sh
index 26a1f401a8..e619ba559a 100644
--- a/svx/source/gengal/gengal.sh
+++ b/svx/source/gengal/gengal.sh
@@ -9,7 +9,7 @@
#
# $RCSfile: gengal.sh,v $
#
-# $Revision: 1.5 $
+# $Revision: 1.5.288.2 $
#
# This file is part of OpenOffice.org.
#
@@ -98,5 +98,13 @@ unset XENVIRONMENT
PATH="$sd_prog":$PATH
export PATH
+OOO_INSTALL_PREFIX=${OOO_INSTALL_PREFIX-$sd_prog/../..}
+if ! test -e $OOO_INSTALL_PREFIX/basis-link; then
+ # Hack for vanilla OOo binaries' split install layout
+ OOO_INSTALL_PREFIX=$OOO_INSTALL_PREFIX/../openoffice.org3
+fi
+
+export OOO_INSTALL_PREFIX
+
# execute binary
exec "$sd_prog/$sd_binary" "$@"
diff --git a/svx/source/gengal/makefile.mk b/svx/source/gengal/makefile.mk
index 6bf11838af..0a86d1debf 100644
--- a/svx/source/gengal/makefile.mk
+++ b/svx/source/gengal/makefile.mk
@@ -8,7 +8,7 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.10 $
+# $Revision: 1.10.144.1 $
#
# This file is part of OpenOffice.org.
#
@@ -83,8 +83,12 @@ APP1STDLIBS=$(TOOLSLIB) \
.INCLUDE : target.mk
ALLTAR : \
- $(SCRIPTFILES)
+ $(SCRIPTFILES)\
+ $(BIN)/gengalrc
$(SCRIPTFILES) : $$(@:f:+".sh")
@tr -d "\015" < $(@:f:+".sh") > $@
+$(BIN)/%: %.in
+ cp $< $@
+