[Libreoffice-commits] .: padmin/source svtools/workben vcl/aqua vcl/inc vcl/source vcl/workben

Caolán McNamara caolan at kemper.freedesktop.org
Fri Dec 10 08:34:51 PST 2010


 padmin/source/pamain.cxx                    |    7 ++++---
 svtools/workben/toolpanel/toolpaneltest.cxx |    5 +++--
 vcl/aqua/source/app/salinst.cxx             |   12 ++++++------
 vcl/inc/vcl/salinst.hxx                     |    2 +-
 vcl/inc/vcl/svapp.hxx                       |    2 +-
 vcl/source/app/svmain.cxx                   |   19 ++++++++++---------
 vcl/source/app/svmainhook.cxx               |    8 ++++----
 vcl/source/salmain/salmain.cxx              |    2 +-
 vcl/workben/outdevgrind.cxx                 |    7 ++++---
 9 files changed, 34 insertions(+), 30 deletions(-)

New commits:
commit 593dbec1edb54874078fe02096100db82e3281a9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 10 16:11:52 2010 +0000

    propogate exit code out to main

diff --git a/padmin/source/pamain.cxx b/padmin/source/pamain.cxx
index 4b2c949..2e50c98 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 692175c..645bea7 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 c6f573d..8a6c806 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 a69980c..9fac6d4 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 860f41d..4b0a20a 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 d08994c..78792cf 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 8b6e5fe..a4336dc 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 138aa79..26c3779 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 a744800..5d781ee 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


More information about the Libreoffice-commits mailing list