diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-12-10 16:11:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-12-10 16:32:54 +0000 |
commit | 56dd29dbd60005d3dc5d1929e8d7049364418c10 (patch) | |
tree | 05d618061bd7dc0f6bfea5916962535645b9a6f8 | |
parent | b75f3f82f82676784f79c9624bfc8914e23d15d6 (diff) |
propogate exit code out to main
-rw-r--r-- | padmin/source/pamain.cxx | 7 | ||||
-rw-r--r-- | svtools/workben/toolpanel/toolpaneltest.cxx | 5 | ||||
-rw-r--r-- | vcl/aqua/source/app/salinst.cxx | 12 | ||||
-rw-r--r-- | vcl/inc/vcl/salinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/vcl/svapp.hxx | 2 | ||||
-rw-r--r-- | vcl/source/app/svmain.cxx | 19 | ||||
-rw-r--r-- | vcl/source/app/svmainhook.cxx | 8 | ||||
-rw-r--r-- | vcl/source/salmain/salmain.cxx | 2 | ||||
-rw-r--r-- | vcl/workben/outdevgrind.cxx | 7 |
9 files changed, 34 insertions, 30 deletions
diff --git a/padmin/source/pamain.cxx b/padmin/source/pamain.cxx index 7bf9afd2d718..2c389ebe5d93 100644 --- a/padmin/source/pamain.cxx +++ b/padmin/source/pamain.cxx @@ -59,7 +59,7 @@ using namespace comphelper; class MyApp : public Application { public: - void Main(); + int Main(); virtual USHORT Exception( USHORT nError ); static void ReadStringHook( String& ); @@ -94,7 +94,7 @@ USHORT MyApp::Exception( USHORT nError ) return 0; } -void MyApp::Main() +int MyApp::Main() { PADialog* pPADialog; @@ -153,7 +153,7 @@ void MyApp::Main() BOOL bQuitApp; if( !InitAccessBridge( true, bQuitApp ) ) if( bQuitApp ) - return; + return EXIT_FAILURE; } // initialize test-tool library (if available) @@ -174,6 +174,7 @@ void MyApp::Main() */ ::ucbhelper::ContentBroker::deinitialize(); + return EXIT_SUCCESS; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/workben/toolpanel/toolpaneltest.cxx b/svtools/workben/toolpanel/toolpaneltest.cxx index 5f60670dad3b..a3b3f6d4f9c8 100644 --- a/svtools/workben/toolpanel/toolpaneltest.cxx +++ b/svtools/workben/toolpanel/toolpaneltest.cxx @@ -66,7 +66,7 @@ using ::com::sun::star::accessibility::XAccessible; class PanelDemo : public Application { public: - virtual void Main(); + virtual int Main(); private: static Reference< XMultiServiceFactory > createApplicationServiceManager(); @@ -860,7 +860,7 @@ Reference< XMultiServiceFactory > PanelDemo::createApplicationServiceManager() } //----------------------------------------------------------------------------- -void __EXPORT PanelDemo::Main() +int __EXPORT PanelDemo::Main() { // create service factory Reference< XMultiServiceFactory > xSMgr = createApplicationServiceManager(); @@ -875,6 +875,7 @@ void __EXPORT PanelDemo::Main() // run the application PanelDemoMainWindow aWindow; Execute(); + return EXIT_SUCCESS; } PanelDemo aTheApplication; diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx index 2cc777b80cd3..4b6a96090268 100644 --- a/vcl/aqua/source/app/salinst.cxx +++ b/vcl/aqua/source/app/salinst.cxx @@ -75,7 +75,7 @@ using namespace ::com::sun::star; extern BOOL ImplSVMain(); -static BOOL* gpbInit = 0; +static int* gpnInit = 0; static NSMenu* pDockMenu = nil; static bool bNoSVMain = true; static bool bLeftMain = false; @@ -209,9 +209,9 @@ static void initNSApp() [NSApp activateIgnoringOtherApps: YES]; } -BOOL ImplSVMainHook( BOOL * pbInit ) +BOOL ImplSVMainHook( int * pnInit ) { - gpbInit = pbInit; + gpnInit = pnInit; bNoSVMain = false; initNSApp(); @@ -587,9 +587,9 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent ) break; case AppExecuteSVMain: { - BOOL bResult = ImplSVMain(); - if( gpbInit ) - *gpbInit = bResult; + int nResult = ImplSVMain(); + if( gpnInit ) + *gpnInit = nResult; [NSApp stop: NSApp]; bLeftMain = true; if( pDockMenu ) diff --git a/vcl/inc/vcl/salinst.hxx b/vcl/inc/vcl/salinst.hxx index 30187dde2108..cb2742e57c62 100644 --- a/vcl/inc/vcl/salinst.hxx +++ b/vcl/inc/vcl/salinst.hxx @@ -210,7 +210,7 @@ void DeInitSalMain(); // ---------- // Callbacks (indepen in \sv\source\app\svmain.cxx) -VCL_DLLPUBLIC BOOL SVMain(); +VCL_DLLPUBLIC int SVMain(); #endif // _SV_SALINST_HXX diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index e608b61d0b7f..1dc6ab011f24 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -243,7 +243,7 @@ public: Application(); virtual ~Application(); - virtual void Main() = 0; + virtual int Main() = 0; virtual BOOL QueryExit(); diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index d08994c9d6de..78792cf43cda 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -156,7 +156,7 @@ oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo } // ======================================================================= -BOOL ImplSVMain() +int ImplSVMain() { // The 'real' SVMain() RTL_LOGFILE_CONTEXT( aLog, "vcl (ss112471) ::SVMain" ); @@ -167,6 +167,7 @@ BOOL ImplSVMain() Reference<XMultiServiceFactory> xMS; + int nReturn = EXIT_FAILURE; BOOL bInit = InitVCL( xMS ); @@ -174,7 +175,7 @@ BOOL ImplSVMain() { // Application-Main rufen pSVData->maAppData.mbInAppMain = TRUE; - pSVData->mpApp->Main(); + nReturn = pSVData->mpApp->Main(); pSVData->maAppData.mbInAppMain = FALSE; } @@ -203,17 +204,17 @@ BOOL ImplSVMain() } DeInitVCL(); - return bInit; + return nReturn; } -BOOL SVMain() +int SVMain() { // #i47888# allow for alternative initialization as required for e.g. MacOSX - extern BOOL ImplSVMainHook( BOOL* ); + extern BOOL ImplSVMainHook( int* ); - BOOL bInit; - if( ImplSVMainHook( &bInit ) ) - return bInit; + int nRet; + if( ImplSVMainHook( &nRet ) ) + return nRet; else return ImplSVMain(); } @@ -226,7 +227,7 @@ oslSignalHandler pExceptionHandler = NULL; class Application_Impl : public Application { public: - void Main(){}; + int Main() { return EXIT_SUCCESS; }; }; class DesktopEnvironmentContext: public cppu::WeakImplHelper1< com::sun::star::uno::XCurrentContext > diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx index 7291a141a16f..725f90f05dc1 100644 --- a/vcl/source/app/svmainhook.cxx +++ b/vcl/source/app/svmainhook.cxx @@ -32,7 +32,7 @@ #ifndef MACOSX -BOOL ImplSVMainHook( BOOL * ) +BOOL ImplSVMainHook( int * ) { return FALSE; // indicate that ImplSVMainHook is not implemented } @@ -57,7 +57,7 @@ static void SourceContextCallBack( void *pInfo ) struct ThreadContext { - BOOL* pRet; + int* pRet; CFRunLoopRef* pRunLoopRef; }; @@ -76,7 +76,7 @@ static void RunSVMain(void *pData) _exit( 0 ); } -BOOL ImplSVMainHook( BOOL *pbInit ) +BOOL ImplSVMainHook( int *pnInit ) { // Mac OS X requires that any Cocoa code have a CFRunLoop started in the // primordial thread. Since all of the AWT classes in Java 1.4 and higher @@ -87,7 +87,7 @@ BOOL ImplSVMainHook( BOOL *pbInit ) CFRunLoopRef runLoopRef = CFRunLoopGetCurrent(); ThreadContext tcx; - tcx.pRet = pbInit; // the return value + tcx.pRet = pnInit; // the return value tcx.pRunLoopRef = &runLoopRef; oslThread hThreadID = osl_createThread(RunSVMain, &tcx); diff --git a/vcl/source/salmain/salmain.cxx b/vcl/source/salmain/salmain.cxx index 66dec1e9afc1..e5135b9aa241 100644 --- a/vcl/source/salmain/salmain.cxx +++ b/vcl/source/salmain/salmain.cxx @@ -37,7 +37,7 @@ SAL_IMPLEMENT_MAIN() { tools::extendApplicationEnvironment(); - return SVMain() ? EXIT_SUCCESS : EXIT_FAILURE; + return SVMain(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx index 1951684b2747..fb1709b98765 100644 --- a/vcl/workben/outdevgrind.cxx +++ b/vcl/workben/outdevgrind.cxx @@ -74,7 +74,7 @@ namespace class GrindApp : public Application { public: - virtual void Main(); + virtual int Main(); virtual USHORT Exception( USHORT nError ); }; @@ -915,7 +915,7 @@ USHORT GrindApp::Exception( USHORT nError ) return 0; } -void GrindApp::Main() +int GrindApp::Main() { bool bHelp = false; @@ -931,7 +931,7 @@ void GrindApp::Main() if( bHelp ) { printf( "outdevgrind - Profile OutputDevice\n" ); - return; + return EXIT_SUCCESS; } //------------------------------------------------- @@ -968,6 +968,7 @@ void GrindApp::Main() // clean up UCB ::ucbhelper::ContentBroker::deinitialize(); + return EXIT_SUCCESS; } } // namespace |