[Libreoffice-commits] core.git: configure.ac include/vcl svx/source vcl/source

Michael Meeks michael.meeks at suse.com
Tue Jun 4 12:52:05 PDT 2013


 configure.ac                 |    2 +-
 include/vcl/svapp.hxx        |    6 +++++-
 svx/source/gengal/gengal.cxx |    5 ++++-
 vcl/source/app/svapp.cxx     |   13 +++++++++++++
 vcl/source/app/svmain.cxx    |    2 +-
 5 files changed, 24 insertions(+), 4 deletions(-)

New commits:
commit df5a73a9e3d44dd8a0af8c61552cdc14ca83bf2d
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Tue Jun 4 18:29:42 2013 +0100

    vcl: add a console-only mode to avoid problems on Mac for gengal.
    
    Change-Id: Ie5332330e6f398c3cd7e58df9b12fac121f5426f

diff --git a/configure.ac b/configure.ac
index 251ee50..1676298 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2244,7 +2244,7 @@ if test -n "${with_galleries}"; then
         AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
     fi
 else
-   if test $_os != iOS -a $_os != Android -a $_os != Darwin; then
+   if test $_os != iOS -a $_os != Android; then
         WITH_GALLERY_BUILD=YES
         AC_MSG_RESULT([internal src images for desktop])
    else
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index c182a0b..c67a189 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -308,8 +308,12 @@ public:
 
     static void                 EnableHeadlessMode( bool dialogsAreFatal );
     static sal_Bool             IsHeadlessModeEnabled();
+    /// check command line arguments for --headless
     static bool                 IsHeadlessModeRequested();
-        ///< check command line arguments for --headless
+    /// used to disable Mac specific app init that requires an app bundle
+    static void                 EnableConsoleOnly();
+    /// used to see if Mac specific app init has been disabled
+    static bool                 IsConsoleOnly();
 
     static void                 ShowNativeErrorBox(const String& sTitle  ,
                                                    const String& sMessage);
diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx
index 6b0ffac..0f68d83 100644
--- a/svx/source/gengal/gengal.cxx
+++ b/svx/source/gengal/gengal.cxx
@@ -44,7 +44,9 @@ class GalApp : public Application
     bool mbInBuildTree;
     bool mbRelativeURLs;
 public:
-    GalApp() : mbInBuildTree( false ), mbRelativeURLs( false ) {}
+    GalApp() : mbInBuildTree( false ), mbRelativeURLs( false )
+    {
+    }
     virtual int Main();
 
 protected:
@@ -254,6 +256,7 @@ void GalApp::DeInit()
 
 void vclmain::createApplication()
 {
+    Application::EnableConsoleOnly();
     static GalApp aGalApp;
 }
 
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index ac2d4c8..8fdbfaa 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1769,6 +1769,19 @@ bool Application::IsHeadlessModeRequested()
     return false;
 }
 
+static bool bConsoleOnly = false;
+
+bool Application::IsConsoleOnly()
+{
+    return bConsoleOnly;
+}
+
+void Application::EnableConsoleOnly()
+{
+    bConsoleOnly = true;
+}
+
+
 // -----------------------------------------------------------------------
 
 void Application::ShowNativeErrorBox(const String& sTitle  ,
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index e6ac094..21a351b 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -192,7 +192,7 @@ int SVMain()
     extern sal_Bool ImplSVMainHook( int* );
 
     int nRet;
-    if( ImplSVMainHook( &nRet ) )
+    if( !Application::IsConsoleOnly() && ImplSVMainHook( &nRet ) )
         return nRet;
     else
         return ImplSVMain();


More information about the Libreoffice-commits mailing list