summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2012-11-05 14:34:27 +0100
committerPetr Mladek <pmladek@suse.cz>2012-11-05 14:34:27 +0100
commitef15a5a4acd3174752484c6aeb570d4d6444b645 (patch)
tree3d1d5b58f85737aa46241aea4c4dabea520cecc2 /desktop
parenta1b0ce05e851e9724c046888a01869eddf9e9db2 (diff)
parentc309ce0227a14330094191c1ef15fa00899defcb (diff)
Merge remote-tracking branch 'origin/libreoffice-3-6-3' into suse-3.6
Conflicts: desktop/source/app/sofficemain.cxx instsetoo_native/util/openoffice.lst solenv/inc/minor.mk Change-Id: I3e9510067c7173f6c71368e70ba6dfe168c5318e
Diffstat (limited to 'desktop')
-rw-r--r--desktop/inc/app.hxx25
-rwxr-xr-xdesktop/scripts/soffice.sh16
-rw-r--r--desktop/source/app/app.cxx174
-rw-r--r--desktop/source/app/appinit.cxx9
-rw-r--r--desktop/source/app/cmdlineargs.cxx18
-rw-r--r--desktop/source/app/cmdlineargs.hxx6
-rw-r--r--desktop/source/app/cmdlinehelp.cxx7
-rw-r--r--desktop/source/app/cmdlinehelp.hxx2
-rw-r--r--desktop/source/app/desktop.hrc1
-rw-r--r--desktop/source/app/desktop.src5
-rw-r--r--desktop/source/app/officeipcthread.cxx329
-rwxr-xr-xdesktop/source/app/sofficemain.cxx40
-rw-r--r--desktop/source/splash/splash.cxx47
-rw-r--r--desktop/unx/source/args.c47
-rw-r--r--desktop/unx/source/args.h1
-rw-r--r--desktop/unx/source/start.c26
16 files changed, 390 insertions, 363 deletions
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index c830b02506fd..ecfd0143baf8 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -107,15 +107,16 @@ class Desktop : public Application
static ResMgr* GetDesktopResManager();
static CommandLineArgs& GetCommandLineArgs();
- void HandleBootstrapErrors( BootstrapError );
- void SetBootstrapError( BootstrapError nError )
+ void HandleBootstrapErrors(
+ BootstrapError nError, rtl::OUString const & aMessage );
+ void SetBootstrapError(
+ BootstrapError nError, rtl::OUString const & aMessage )
{
if ( m_aBootstrapError == BE_OK )
+ {
m_aBootstrapError = nError;
- }
- BootstrapError GetBootstrapError() const
- {
- return m_aBootstrapError;
+ m_aBootstrapErrorMessage = aMessage;
+ }
}
void SetBootstrapStatus( BootstrapStatus nStatus )
@@ -139,13 +140,11 @@ class Desktop : public Application
void SetSplashScreenText( const ::rtl::OUString& rText );
void SetSplashScreenProgress( sal_Int32 );
- static void ensureProcessServiceFactory();
-
- private:
// Bootstrap methods
- static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > CreateApplicationServiceManager();
- // returns a non-null reference or throws an exception
+ static void InitApplicationServiceManager();
+ // throws an exception upon failure
+ private:
void RegisterServices();
void DeregisterServices();
@@ -163,9 +162,6 @@ class Desktop : public Application
void HandleBootstrapPathErrors( ::utl::Bootstrap::Status, const ::rtl::OUString& aMsg );
void StartSetup( const ::rtl::OUString& aParameters );
- // Get a resource message string securely e.g. if resource cannot be retrieved return aFaultBackMsg
- ::rtl::OUString GetMsgString( sal_uInt16 nId, const ::rtl::OUString& aFaultBackMsg );
-
// Create a error message depending on bootstrap failure code and an optional file url
::rtl::OUString CreateErrorMsgString( utl::Bootstrap::FailureCode nFailureCode,
const ::rtl::OUString& aFileURL );
@@ -207,6 +203,7 @@ class Desktop : public Application
bool m_bServicesRegistered;
sal_uInt16 m_nAppEvents;
BootstrapError m_aBootstrapError;
+ rtl::OUString m_aBootstrapErrorMessage;
BootstrapStatus m_aBootstrapStatus;
std::auto_ptr< Lockfile > m_pLockfile;
diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
index 97a2be913f13..f35bebb158f1 100755
--- a/desktop/scripts/soffice.sh
+++ b/desktop/scripts/soffice.sh
@@ -158,21 +158,5 @@ if [ -n "$VALGRINDCHECK" -a -z "$VALGRIND" ] ; then
exec &>valgrind.log
fi
-# do not pass the request for command line help to oosplash
-for arg in $@ ; do
- case "$arg" in
- -h | --h | --he | --hel | --help)
- "$sd_prog/soffice.bin" --help
- exit 0
- ;;
- -V | --v | --ve | --ver | --vers | --versi | --versio | --version)
- "$sd_prog/soffice.bin" --version
- exit 0
- ;;
- *)
- ;;
- esac
-done
-
# oosplash does the rest: forcing pages in, javaldx etc. are
exec $VALGRINDCHECK $STRACECHECK "$sd_prog/oosplash" "$@"
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 5fb653b5484d..001eac7bee07 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -373,28 +373,34 @@ ResMgr* Desktop::GetDesktopResManager()
return Desktop::pResMgr;
}
+namespace {
+
// ----------------------------------------------------------------------------
// Get a message string securely. There is a fallback string if the resource
// is not available.
-OUString Desktop::GetMsgString( sal_uInt16 nId, const OUString& aFaultBackMsg )
+OUString GetMsgString(
+ sal_uInt16 nId, const OUString& aFaultBackMsg,
+ bool bAlwaysUseFaultBackMsg = false )
{
- ResMgr* resMgr = GetDesktopResManager();
- if ( !resMgr )
- return aFaultBackMsg;
- else
- return OUString( String( ResId( nId, *resMgr )));
+ if ( !bAlwaysUseFaultBackMsg )
+ {
+ ResMgr* resMgr = Desktop::GetDesktopResManager();
+ if ( resMgr )
+ return OUString( String( ResId( nId, *resMgr )));
+ }
+ return aFaultBackMsg;
}
-OUString MakeStartupErrorMessage(OUString const & aErrorMessage)
+OUString MakeStartupErrorMessage(
+ OUString const & aErrorMessage, bool bAlwaysUseFaultBackMsg = false )
{
OUStringBuffer aDiagnosticMessage( 100 );
- ResMgr* pResMgr = Desktop::GetDesktopResManager();
- if ( pResMgr )
- aDiagnosticMessage.append( OUString(String(ResId(STR_BOOTSTRAP_ERR_CANNOT_START, *pResMgr))) );
- else
- aDiagnosticMessage.appendAscii( "The program cannot be started." );
+ aDiagnosticMessage.append(
+ GetMsgString(
+ STR_BOOTSTRAP_ERR_CANNOT_START, "The program cannot be started.",
+ bAlwaysUseFaultBackMsg ) );
aDiagnosticMessage.appendAscii( "\n" );
@@ -463,9 +469,8 @@ static bool ShouldSuppressUI(const CommandLineArgs& rCmdLine)
rCmdLine.IsQuickstart();
}
-namespace
-{
- struct theCommandLineArgs : public rtl::Static< CommandLineArgs, theCommandLineArgs > {};
+struct theCommandLineArgs : public rtl::Static< CommandLineArgs, theCommandLineArgs > {};
+
}
CommandLineArgs& Desktop::GetCommandLineArgs()
@@ -583,29 +588,30 @@ void Desktop::Init()
// We need to have service factory before going further, but see fdo#37195.
// Doing this will mmap common.rdb, making it not overwritable on windows,
// so this can't happen before the synchronization above. Lets rework this
- // so that the above is called *from* ensureProcessServiceFactory or
+ // so that the above is called *from* CreateApplicationServiceManager or
// something to enforce this gotcha
- ensureProcessServiceFactory();
-
- if( !::comphelper::getProcessServiceFactory().is())
+ try
+ {
+ InitApplicationServiceManager();
+ }
+ catch (css::uno::Exception & e)
{
- OSL_FAIL("Service factory should have been crated in soffice_main().");
- SetBootstrapError( BE_UNO_SERVICEMANAGER );
+ SetBootstrapError( BE_UNO_SERVICEMANAGER, e.Message );
}
- if ( GetBootstrapError() == BE_OK )
+ if ( m_aBootstrapError == BE_OK )
{
// prepare language
if ( !LanguageSelection::prepareLanguage() )
{
if ( LanguageSelection::getStatus() == LanguageSelection::LS_STATUS_CANNOT_DETERMINE_LANGUAGE )
- SetBootstrapError( BE_LANGUAGE_MISSING );
+ SetBootstrapError( BE_LANGUAGE_MISSING, OUString() );
else
- SetBootstrapError( BE_OFFICECONFIG_BROKEN );
+ SetBootstrapError( BE_OFFICECONFIG_BROKEN, OUString() );
}
}
- if ( GetBootstrapError() == BE_OK )
+ if ( m_aBootstrapError == BE_OK )
{
const CommandLineArgs& rCmdLineArgs = GetCommandLineArgs();
// start ipc thread only for non-remote offices
@@ -613,14 +619,15 @@ void Desktop::Init()
OfficeIPCThread::Status aStatus = OfficeIPCThread::EnableOfficeIPCThread();
if ( aStatus == OfficeIPCThread::IPC_STATUS_BOOTSTRAP_ERROR )
{
- SetBootstrapError( BE_PATHINFO_MISSING );
+ SetBootstrapError( BE_PATHINFO_MISSING, OUString() );
}
else if ( aStatus == OfficeIPCThread::IPC_STATUS_2ND_OFFICE )
{
// 2nd office startup should terminate after sending cmdlineargs through pipe
SetBootstrapStatus(BS_TERMINATE);
}
- else if ( rCmdLineArgs.IsHelp() )
+ else if ( !rCmdLineArgs.GetUnknown().isEmpty()
+ || rCmdLineArgs.IsHelp() || rCmdLineArgs.IsVersion() )
{
// disable IPC thread in an instance that is just showing a help message
OfficeIPCThread::DisableOfficeIPCThread();
@@ -636,29 +643,6 @@ void Desktop::InitFinished()
CloseSplashScreen();
}
-// GetCommandLineArgs() requires this code to work, otherwise it will abort, and
-// on Unix command line args needs to be checked before Desktop::Init()
-void Desktop::ensureProcessServiceFactory()
-{
- if (!comphelper::getProcessServiceFactory().is())
- {
- try
- {
- comphelper::setProcessServiceFactory(
- CreateApplicationServiceManager());
- }
- catch (const css::uno::Exception& e)
- {
- // Application::ShowNativeErrorBox would only work after InitVCL, so
- // all we can realistically do here is hope the user can see stderr:
- std::cerr << "UNO Exception: " << e.Message << std::endl;
- // Let exceptions escape and tear down the process, it is completely
- // broken anyway:
- throw;
- }
- }
-}
-
void Desktop::DeInit()
{
RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::DeInit" );
@@ -873,7 +857,8 @@ void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStat
return MakeStartupErrorMessage( aMsg );
}
-void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError )
+void Desktop::HandleBootstrapErrors(
+ BootstrapError aBootstrapError, OUString const & aErrorMessage )
{
if ( aBootstrapError == BE_PATHINFO_MISSING )
{
@@ -954,16 +939,18 @@ void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError )
// PropertyValue is available). To give the user a hint even if
// generating and displaying a message box below crashes, print a
// hard-coded message on stderr first:
- fputs(
- aBootstrapError == BE_UNO_SERVICEMANAGER
- ? ("The application cannot be started. " "\n"
- "The component manager is not available." "\n")
- // STR_BOOTSTRAP_ERR_CANNOT_START, STR_BOOTSTRAP_ERR_NO_SERVICE
- : ("The application cannot be started. " "\n"
- "The configuration service is not available." "\n"),
- // STR_BOOTSTRAP_ERR_CANNOT_START,
- // STR_BOOTSTRAP_ERR_NO_CFG_SERVICE
- stderr);
+ std::cerr
+ << "The application cannot be started.\n"
+ // STR_BOOTSTRAP_ERR_CANNOT_START
+ << (aBootstrapError == BE_UNO_SERVICEMANAGER
+ ? "The component manager is not available.\n"
+ // STR_BOOTSTRAP_ERR_NO_SERVICE
+ : "The configuration service is not available.\n");
+ // STR_BOOTSTRAP_ERR_NO_CFG_SERVICE
+ if ( !aErrorMessage.isEmpty() )
+ {
+ std::cerr << "(\"" << aErrorMessage << "\")\n";
+ }
// First sentence. We cannot bootstrap office further!
OUString aMessage;
@@ -972,24 +959,32 @@ void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError )
OUString aErrorMsg;
if ( aBootstrapError == BE_UNO_SERVICEMANAGER )
- aErrorMsg = GetMsgString( STR_BOOTSTRAP_ERR_NO_SERVICE,
- OUString( "The service manager is not available." ) );
+ aErrorMsg = "The service manager is not available.";
else
aErrorMsg = GetMsgString( STR_BOOTSTRAP_ERR_NO_CFG_SERVICE,
OUString( "The configuration service is not available." ) );
aDiagnosticMessage.append( aErrorMsg );
aDiagnosticMessage.appendAscii( "\n" );
+ if ( !aErrorMessage.isEmpty() )
+ {
+ aDiagnosticMessage.appendAscii( "(\"" );
+ aDiagnosticMessage.append( aErrorMessage );
+ aDiagnosticMessage.appendAscii( "\")\n" );
+ }
// Due to the fact the we haven't a backup applicat.rdb file anymore it is not possible to
// repair the installation with the setup executable besides the office executable. Now
// we have to ask the user to start the setup on CD/installation directory manually!!
OUString aStartSetupManually( GetMsgString(
STR_ASK_START_SETUP_MANUALLY,
- OUString( "Start setup application to repair the installation from CD, or the folder containing the installation packages." ) ));
+ OUString( "Start setup application to repair the installation from CD, or the folder containing the installation packages." ),
+ aBootstrapError == BE_UNO_SERVICEMANAGER ) );
aDiagnosticMessage.append( aStartSetupManually );
- aMessage = MakeStartupErrorMessage( aDiagnosticMessage.makeStringAndClear() );
+ aMessage = MakeStartupErrorMessage(
+ aDiagnosticMessage.makeStringAndClear(),
+ aBootstrapError == BE_UNO_SERVICEMANAGER );
FatalError( aMessage);
}
@@ -1386,10 +1381,9 @@ int Desktop::Main()
com::sun::star::uno::ContextLayer layer(
com::sun::star::uno::getCurrentContext() );
- BootstrapError eError = GetBootstrapError();
- if ( eError != BE_OK )
+ if ( m_aBootstrapError != BE_OK )
{
- HandleBootstrapErrors( eError );
+ HandleBootstrapErrors( m_aBootstrapError, m_aBootstrapErrorMessage );
return EXIT_FAILURE;
}
@@ -1403,6 +1397,22 @@ int Desktop::Main()
new DesktopContext( com::sun::star::uno::getCurrentContext() ) );
CommandLineArgs& rCmdLineArgs = GetCommandLineArgs();
+ OUString aUnknown( rCmdLineArgs.GetUnknown() );
+ if ( !aUnknown.isEmpty() )
+ {
+ displayCmdlineHelp( aUnknown );
+ return EXIT_FAILURE;
+ }
+ if ( rCmdLineArgs.IsHelp() )
+ {
+ displayCmdlineHelp( OUString() );
+ return EXIT_SUCCESS;
+ }
+ if ( rCmdLineArgs.IsVersion() )
+ {
+ displayVersion();
+ return EXIT_SUCCESS;
+ }
// setup configuration error handling
ConfigurationErrorHandler aConfigErrHandler;
@@ -1423,11 +1433,12 @@ int Desktop::Main()
{
OSL_FAIL("userinstall failed");
if ( inst_fin == UserInstall::E_NoDiskSpace )
- HandleBootstrapErrors( BE_USERINSTALL_NOTENOUGHDISKSPACE );
+ HandleBootstrapErrors(
+ BE_USERINSTALL_NOTENOUGHDISKSPACE, OUString() );
else if ( inst_fin == UserInstall::E_NoWriteAccess )
- HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS );
+ HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS, OUString() );
else
- HandleBootstrapErrors( BE_USERINSTALL_FAILED );
+ HandleBootstrapErrors( BE_USERINSTALL_FAILED, OUString() );
return EXIT_FAILURE;
}
// refresh path information
@@ -1445,14 +1456,6 @@ int Desktop::Main()
SetSplashScreenProgress(25);
-#ifndef UNX
- if ( rCmdLineArgs.IsHelp() )
- {
- displayCmdlineHelp();
- return EXIT_SUCCESS;
- }
-#endif
-
// check user installation directory for lockfile so we can be sure
// there is no other instance using our data files from a remote host
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main -> Lockfile" );
@@ -1805,9 +1808,10 @@ bool Desktop::InitializeConfiguration()
comphelper::getProcessComponentContext() );
return true;
}
- catch( const ::com::sun::star::lang::ServiceNotRegisteredException& )
+ catch( ::com::sun::star::lang::ServiceNotRegisteredException & e )
{
- this->HandleBootstrapErrors( Desktop::BE_UNO_SERVICE_CONFIG_MISSING );
+ this->HandleBootstrapErrors(
+ Desktop::BE_UNO_SERVICE_CONFIG_MISSING, e.Message );
}
catch( const ::com::sun::star::configuration::MissingBootstrapFileException& e )
{
@@ -2714,10 +2718,10 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent )
}
break;
case ApplicationEvent::TYPE_HELP:
-#ifndef UNX
- // in non unix version allow showing of cmdline help window
- displayCmdlineHelp();
-#endif
+ displayCmdlineHelp(rAppEvent.GetData());
+ break;
+ case ApplicationEvent::TYPE_VERSION:
+ displayVersion();
break;
case ApplicationEvent::TYPE_OPEN:
{
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 4b33cb29fa6d..7a32d13c19f2 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -163,20 +163,21 @@ static bool configureUcb()
return ret;
}
-Reference< XMultiServiceFactory > Desktop::CreateApplicationServiceManager()
+void Desktop::InitApplicationServiceManager()
{
RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::createApplicationServiceManager" );
-
+ Reference<XMultiServiceFactory> sm;
#ifdef ANDROID
rtl::OUString aUnoRc( OUString( "file:///assets/program/unorc" ) );
- return Reference<XMultiServiceFactory>(
+ sm.set(
cppu::defaultBootstrap_InitialComponentContext( aUnoRc )->getServiceManager(),
UNO_QUERY_THROW);
#else
- return Reference<XMultiServiceFactory>(
+ sm.set(
cppu::defaultBootstrap_InitialComponentContext()->getServiceManager(),
UNO_QUERY_THROW);
#endif
+ comphelper::setProcessServiceFactory(sm);
}
void Desktop::DestroyApplicationServiceManager( Reference< XMultiServiceFactory >& xSMgr )
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 473dfd69d309..51bdad0ba857 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -287,26 +287,25 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
{
bConversionOutEvent = true;
}
-#if defined UNX
else
// because it's impossible to filter these options that
// are handled in the soffice shell script with the
// primitive tools that /bin/sh offers, ignore them here
- if (!oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("backtrace")) &&
+ if (
+#if defined UNX
+ !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("backtrace")) &&
!oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("strace")) &&
!oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("valgrind")) &&
// for X Session Management, handled in
// vcl/unx/generic/app/sm.cxx:
!oArg.match("session=") &&
+#endif
//ignore additional legacy options that don't do anything anymore
- !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("nocrashreport")))
+ !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("nocrashreport")) &&
+ m_unknown.isEmpty())
{
- fprintf(stderr, "Unknown option %s\n",
- rtl::OUStringToOString(aArg, osl_getThreadTextEncoding()).getStr());
- fprintf(stderr, "Run 'soffice --help' to see a full list of available command line options.\n");
- m_unknown = true;
+ m_unknown = aArg;
}
-#endif
}
else
{
@@ -623,7 +622,6 @@ void CommandLineArgs::InitParamValues()
m_helpbase = false;
m_psn = false;
m_version = false;
- m_unknown = false;
m_splashpipe = false;
m_bEmpty = true;
m_bDocumentArgs = false;
@@ -761,7 +759,7 @@ bool CommandLineArgs::IsVersion() const
return m_version;
}
-bool CommandLineArgs::HasUnknown() const
+OUString CommandLineArgs::GetUnknown() const
{
return m_unknown;
}
diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx
index c6286d2ba895..995176346463 100644
--- a/desktop/source/app/cmdlineargs.hxx
+++ b/desktop/source/app/cmdlineargs.hxx
@@ -93,9 +93,10 @@ class CommandLineArgs: private boost::noncopyable
bool IsWeb() const;
bool IsVersion() const;
bool HasModuleParam() const;
- bool HasUnknown() const;
bool WantsToLoadDocument() const;
+ rtl::OUString GetUnknown() const;
+
// Access to string parameters
bool HasSplashPipe() const;
std::vector< rtl::OUString > const & GetAccept() const;
@@ -153,9 +154,10 @@ class CommandLineArgs: private boost::noncopyable
bool m_helpbase;
bool m_psn;
bool m_version;
- bool m_unknown;
bool m_splashpipe;
+ rtl::OUString m_unknown;
+
bool m_bEmpty; // No Args at all
bool m_bDocumentArgs; // A document creation/open/load arg is used
std::vector< rtl::OUString > m_accept;
diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx
index d09b5012f0ba..79741de80969 100644
--- a/desktop/source/app/cmdlinehelp.cxx
+++ b/desktop/source/app/cmdlinehelp.cxx
@@ -136,7 +136,7 @@ namespace desktop
rtl::OUString ReplaceStringHookProc(const rtl::OUString& rStr);
- void displayCmdlineHelp()
+ void displayCmdlineHelp(rtl::OUString const & unknown)
{
// if you put variables in other chunks don't forget to call the replace routines
// for those chunks...
@@ -147,6 +147,11 @@ namespace desktop
String aHelpMessage_bottom(aCmdLineHelp_bottom, RTL_TEXTENCODING_ASCII_US);
aHelpMessage_version = ReplaceStringHookProc(aHelpMessage_version);
aHelpMessage_head.SearchAndReplaceAscii( "%CMDNAME", String( "soffice", RTL_TEXTENCODING_ASCII_US) );
+ if (!unknown.isEmpty())
+ {
+ aHelpMessage_head = "Unknown option: " + unknown + "\n\n"
+ + aHelpMessage_head;
+ }
#ifdef UNX
// on unix use console for output
fprintf(stdout, "%s%s",
diff --git a/desktop/source/app/cmdlinehelp.hxx b/desktop/source/app/cmdlinehelp.hxx
index 5c92512ea1e9..fbf520af7521 100644
--- a/desktop/source/app/cmdlinehelp.hxx
+++ b/desktop/source/app/cmdlinehelp.hxx
@@ -5,7 +5,7 @@
namespace desktop
{
- void displayCmdlineHelp( void );
+ void displayCmdlineHelp( rtl::OUString const & unknown );
void displayVersion();
#ifndef UNX
class CmdlineHelpDialog : public ModalDialog
diff --git a/desktop/source/app/desktop.hrc b/desktop/source/app/desktop.hrc
index 9c68d7b9fd2d..83aa711aaaca 100644
--- a/desktop/source/app/desktop.hrc
+++ b/desktop/source/app/desktop.hrc
@@ -67,7 +67,6 @@
#define STR_BOOTSTRAP_ERR_NO_SUPPORT (RID_DESKTOP_STRING_START+107)
#define STR_BOOTSTRAP_ERR_LANGUAGE_MISSING (RID_DESKTOP_STRING_START+108)
-#define STR_BOOTSTRAP_ERR_NO_SERVICE (RID_DESKTOP_STRING_START+120)
#define STR_BOOTSTRAP_ERR_NO_CFG_SERVICE (RID_DESKTOP_STRING_START+121)
#define STR_BOOTSTRAP_ERR_CFG_DATAACCESS (RID_DESKTOP_STRING_START+122)
#define STR_BOOTSTRAP_ERR_NO_PATHSET_SERVICE (RID_DESKTOP_STRING_START+123)
diff --git a/desktop/source/app/desktop.src b/desktop/source/app/desktop.src
index 0b6bc3f3c803..913f88ba92ed 100644
--- a/desktop/source/app/desktop.src
+++ b/desktop/source/app/desktop.src
@@ -88,11 +88,6 @@ String STR_BOOTSTRAP_ERR_LANGUAGE_MISSING
Text [ en-US ] = "The user interface language cannot be determined.";
};
-String STR_BOOTSTRAP_ERR_NO_SERVICE
-{
- Text [ en-US ] = "The component manager is not available.";
-};
-
String STR_BOOTSTRAP_ERR_NO_CFG_SERVICE
{
Text [ en-US ] = "The configuration service is not available.";
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index e99eb1d20eac..b9ede23532d9 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -700,192 +700,193 @@ void OfficeIPCThread::execute()
continue;
}
-#ifdef UNX
- if (aCmdLineArgs->HasUnknown() || aCmdLineArgs->IsVersion() || aCmdLineArgs->IsHelp())
- continue;
-#endif
-
- const CommandLineArgs &rCurrentCmdLineArgs = Desktop::GetCommandLineArgs();
+ sal_Bool bDocRequestSent = sal_False;
- if ( aCmdLineArgs->IsQuickstart() )
+ OUString aUnknown( aCmdLineArgs->GetUnknown() );
+ if ( !aUnknown.isEmpty() || aCmdLineArgs->IsHelp() )
{
- // we have to use application event, because we have to start quickstart service in main thread!!
ApplicationEvent* pAppEvent =
- new ApplicationEvent(ApplicationEvent::TYPE_QUICKSTART);
+ new ApplicationEvent(ApplicationEvent::TYPE_HELP, aUnknown);
ImplPostForeignAppEvent( pAppEvent );
}
-
- // handle request for acceptor
- std::vector< rtl::OUString > const & accept = aCmdLineArgs->
- GetAccept();
- for (std::vector< rtl::OUString >::const_iterator i(accept.begin());
- i != accept.end(); ++i)
+ else if ( aCmdLineArgs->IsVersion() )
{
- ApplicationEvent* pAppEvent = new ApplicationEvent(
- ApplicationEvent::TYPE_ACCEPT, *i);
- ImplPostForeignAppEvent( pAppEvent );
- }
- // handle acceptor removal
- std::vector< rtl::OUString > const & unaccept = aCmdLineArgs->
- GetUnaccept();
- for (std::vector< rtl::OUString >::const_iterator i(
- unaccept.begin());
- i != unaccept.end(); ++i)
- {
- ApplicationEvent* pAppEvent = new ApplicationEvent(
- ApplicationEvent::TYPE_UNACCEPT, *i);
- ImplPostForeignAppEvent( pAppEvent );
- }
-
-#ifndef UNX
- // only in non-unix version, we need to handle a -help request
- // in a running instance in order to display the command line help
- if ( aCmdLineArgs->IsHelp() ) {
ApplicationEvent* pAppEvent =
- new ApplicationEvent(ApplicationEvent::TYPE_HELP);
+ new ApplicationEvent(ApplicationEvent::TYPE_VERSION);
ImplPostForeignAppEvent( pAppEvent );
}
-#endif
-
- sal_Bool bDocRequestSent = sal_False;
- ProcessDocumentsRequest* pRequest = new ProcessDocumentsRequest(
- aCmdLineArgs->getCwdUrl());
- cProcessed.reset();
- pRequest->pcProcessed = &cProcessed;
-
- // Print requests are not dependent on the --invisible cmdline argument as they are
- // loaded with the "hidden" flag! So they are always checked.
- pRequest->aPrintList = aCmdLineArgs->GetPrintList();
- bDocRequestSent |= !pRequest->aPrintList.empty();
- pRequest->aPrintToList = aCmdLineArgs->GetPrintToList();
- pRequest->aPrinterName = aCmdLineArgs->GetPrinterName();
- bDocRequestSent |= !( pRequest->aPrintToList.empty() || pRequest->aPrinterName.isEmpty() );
-
- if ( !rCurrentCmdLineArgs.IsInvisible() )
+ else
{
- // Read cmdline args that can open/create documents. As they would open a window
- // they are only allowed if the "--invisible" is currently not used!
- pRequest->aOpenList = aCmdLineArgs->GetOpenList();
- bDocRequestSent |= !pRequest->aOpenList.empty();
- pRequest->aViewList = aCmdLineArgs->GetViewList();
- bDocRequestSent |= !pRequest->aViewList.empty();
- pRequest->aStartList = aCmdLineArgs->GetStartList();
- bDocRequestSent |= !pRequest->aStartList.empty();
- pRequest->aForceOpenList = aCmdLineArgs->GetForceOpenList();
- bDocRequestSent |= !pRequest->aForceOpenList.empty();
- pRequest->aForceNewList = aCmdLineArgs->GetForceNewList();
- bDocRequestSent |= !pRequest->aForceNewList.empty();
-
- // Special command line args to create an empty document for a given module
-
- // #i18338# (lo)
- // we only do this if no document was specified on the command line,
- // since this would be inconsistent with the the behaviour of
- // the first process, see OpenClients() (call to OpenDefault()) in app.cxx
- if ( aCmdLineArgs->HasModuleParam() && (!bDocRequestSent) )
+ const CommandLineArgs &rCurrentCmdLineArgs = Desktop::GetCommandLineArgs();
+
+ if ( aCmdLineArgs->IsQuickstart() )
{
- SvtModuleOptions aOpt;
- SvtModuleOptions::EFactory eFactory = SvtModuleOptions::E_WRITER;
- if ( aCmdLineArgs->IsWriter() )
- eFactory = SvtModuleOptions::E_WRITER;
- else if ( aCmdLineArgs->IsCalc() )
- eFactory = SvtModuleOptions::E_CALC;
- else if ( aCmdLineArgs->IsDraw() )
- eFactory = SvtModuleOptions::E_DRAW;
- else if ( aCmdLineArgs->IsImpress() )
- eFactory = SvtModuleOptions::E_IMPRESS;
- else if ( aCmdLineArgs->IsBase() )
- eFactory = SvtModuleOptions::E_DATABASE;
- else if ( aCmdLineArgs->IsMath() )
- eFactory = SvtModuleOptions::E_MATH;
- else if ( aCmdLineArgs->IsGlobal() )
- eFactory = SvtModuleOptions::E_WRITERGLOBAL;
- else if ( aCmdLineArgs->IsWeb() )
- eFactory = SvtModuleOptions::E_WRITERWEB;
-
- if ( !pRequest->aOpenList.empty() )
- pRequest->aModule = aOpt.GetFactoryName( eFactory );
- else
- pRequest->aOpenList.push_back( aOpt.GetFactoryEmptyDocumentURL( eFactory ) );
- bDocRequestSent = sal_True;
+ // we have to use application event, because we have to start quickstart service in main thread!!
+ ApplicationEvent* pAppEvent =
+ new ApplicationEvent(ApplicationEvent::TYPE_QUICKSTART);
+ ImplPostForeignAppEvent( pAppEvent );
}
- }
- if ( !aCmdLineArgs->IsQuickstart() ) {
- sal_Bool bShowHelp = sal_False;
- rtl::OUStringBuffer aHelpURLBuffer;
- if (aCmdLineArgs->IsHelpWriter()) {
- bShowHelp = sal_True;
- aHelpURLBuffer.appendAscii("vnd.sun.star.help://swriter/start");
- } else if (aCmdLineArgs->IsHelpCalc()) {
- bShowHelp = sal_True;
- aHelpURLBuffer.appendAscii("vnd.sun.star.help://scalc/start");
- } else if (aCmdLineArgs->IsHelpDraw()) {
- bShowHelp = sal_True;
- aHelpURLBuffer.appendAscii("vnd.sun.star.help://sdraw/start");
- } else if (aCmdLineArgs->IsHelpImpress()) {
- bShowHelp = sal_True;
- aHelpURLBuffer.appendAscii("vnd.sun.star.help://simpress/start");
- } else if (aCmdLineArgs->IsHelpBase()) {
- bShowHelp = sal_True;
- aHelpURLBuffer.appendAscii("vnd.sun.star.help://sdatabase/start");
- } else if (aCmdLineArgs->IsHelpBasic()) {
- bShowHelp = sal_True;
- aHelpURLBuffer.appendAscii("vnd.sun.star.help://sbasic/start");
- } else if (aCmdLineArgs->IsHelpMath()) {
- bShowHelp = sal_True;
- aHelpURLBuffer.appendAscii("vnd.sun.star.help://smath/start");
+ // handle request for acceptor
+ std::vector< rtl::OUString > const & accept = aCmdLineArgs->
+ GetAccept();
+ for (std::vector< rtl::OUString >::const_iterator i(accept.begin());
+ i != accept.end(); ++i)
+ {
+ ApplicationEvent* pAppEvent = new ApplicationEvent(
+ ApplicationEvent::TYPE_ACCEPT, *i);
+ ImplPostForeignAppEvent( pAppEvent );
}
- if (bShowHelp) {
- aHelpURLBuffer.appendAscii("?Language=");
- aHelpURLBuffer.append(utl::ConfigManager::getLocale());
-#if defined UNX
- aHelpURLBuffer.appendAscii("&System=UNX");
-#elif defined WNT
- aHelpURLBuffer.appendAscii("&System=WIN");
-#endif
+ // handle acceptor removal
+ std::vector< rtl::OUString > const & unaccept = aCmdLineArgs->
+ GetUnaccept();
+ for (std::vector< rtl::OUString >::const_iterator i(
+ unaccept.begin());
+ i != unaccept.end(); ++i)
+ {
ApplicationEvent* pAppEvent = new ApplicationEvent(
- ApplicationEvent::TYPE_OPENHELPURL,
- aHelpURLBuffer.makeStringAndClear());
+ ApplicationEvent::TYPE_UNACCEPT, *i);
ImplPostForeignAppEvent( pAppEvent );
}
- }
- if ( bDocRequestSent )
- {
- // Send requests to dispatch watcher if we have at least one. The receiver
- // is responsible to delete the request after processing it.
- if ( aCmdLineArgs->HasModuleParam() )
+ ProcessDocumentsRequest* pRequest = new ProcessDocumentsRequest(
+ aCmdLineArgs->getCwdUrl());
+ cProcessed.reset();
+ pRequest->pcProcessed = &cProcessed;
+
+ // Print requests are not dependent on the --invisible cmdline argument as they are
+ // loaded with the "hidden" flag! So they are always checked.
+ pRequest->aPrintList = aCmdLineArgs->GetPrintList();
+ bDocRequestSent |= !pRequest->aPrintList.empty();
+ pRequest->aPrintToList = aCmdLineArgs->GetPrintToList();
+ pRequest->aPrinterName = aCmdLineArgs->GetPrinterName();
+ bDocRequestSent |= !( pRequest->aPrintToList.empty() || pRequest->aPrinterName.isEmpty() );
+
+ if ( !rCurrentCmdLineArgs.IsInvisible() )
{
- SvtModuleOptions aOpt;
-
- // Support command line parameters to start a module (as preselection)
- if ( aCmdLineArgs->IsWriter() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) )
- pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::E_WRITER );
- else if ( aCmdLineArgs->IsCalc() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) )
- pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::E_CALC );
- else if ( aCmdLineArgs->IsImpress() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) )
- pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::E_IMPRESS );
- else if ( aCmdLineArgs->IsDraw() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) )
- pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::E_DRAW );
+ // Read cmdline args that can open/create documents. As they would open a window
+ // they are only allowed if the "--invisible" is currently not used!
+ pRequest->aOpenList = aCmdLineArgs->GetOpenList();
+ bDocRequestSent |= !pRequest->aOpenList.empty();
+ pRequest->aViewList = aCmdLineArgs->GetViewList();
+ bDocRequestSent |= !pRequest->aViewList.empty();
+ pRequest->aStartList = aCmdLineArgs->GetStartList();
+ bDocRequestSent |= !pRequest->aStartList.empty();
+ pRequest->aForceOpenList = aCmdLineArgs->GetForceOpenList();
+ bDocRequestSent |= !pRequest->aForceOpenList.empty();
+ pRequest->aForceNewList = aCmdLineArgs->GetForceNewList();
+ bDocRequestSent |= !pRequest->aForceNewList.empty();
+
+ // Special command line args to create an empty document for a given module
+
+ // #i18338# (lo)
+ // we only do this if no document was specified on the command line,
+ // since this would be inconsistent with the the behaviour of
+ // the first process, see OpenClients() (call to OpenDefault()) in app.cxx
+ if ( aCmdLineArgs->HasModuleParam() && (!bDocRequestSent) )
+ {
+ SvtModuleOptions aOpt;
+ SvtModuleOptions::EFactory eFactory = SvtModuleOptions::E_WRITER;
+ if ( aCmdLineArgs->IsWriter() )
+ eFactory = SvtModuleOptions::E_WRITER;
+ else if ( aCmdLineArgs->IsCalc() )
+ eFactory = SvtModuleOptions::E_CALC;
+ else if ( aCmdLineArgs->IsDraw() )
+ eFactory = SvtModuleOptions::E_DRAW;
+ else if ( aCmdLineArgs->IsImpress() )
+ eFactory = SvtModuleOptions::E_IMPRESS;
+ else if ( aCmdLineArgs->IsBase() )
+ eFactory = SvtModuleOptions::E_DATABASE;
+ else if ( aCmdLineArgs->IsMath() )
+ eFactory = SvtModuleOptions::E_MATH;
+ else if ( aCmdLineArgs->IsGlobal() )
+ eFactory = SvtModuleOptions::E_WRITERGLOBAL;
+ else if ( aCmdLineArgs->IsWeb() )
+ eFactory = SvtModuleOptions::E_WRITERWEB;
+
+ if ( !pRequest->aOpenList.empty() )
+ pRequest->aModule = aOpt.GetFactoryName( eFactory );
+ else
+ pRequest->aOpenList.push_back( aOpt.GetFactoryEmptyDocumentURL( eFactory ) );
+ bDocRequestSent = sal_True;
+ }
}
+ if ( !aCmdLineArgs->IsQuickstart() ) {
+ sal_Bool bShowHelp = sal_False;
+ rtl::OUStringBuffer aHelpURLBuffer;
+ if (aCmdLineArgs->IsHelpWriter()) {
+ bShowHelp = sal_True;
+ aHelpURLBuffer.appendAscii("vnd.sun.star.help://swriter/start");
+ } else if (aCmdLineArgs->IsHelpCalc()) {
+ bShowHelp = sal_True;
+ aHelpURLBuffer.appendAscii("vnd.sun.star.help://scalc/start");
+ } else if (aCmdLineArgs->IsHelpDraw()) {
+ bShowHelp = sal_True;
+ aHelpURLBuffer.appendAscii("vnd.sun.star.help://sdraw/start");
+ } else if (aCmdLineArgs->IsHelpImpress()) {
+ bShowHelp = sal_True;
+ aHelpURLBuffer.appendAscii("vnd.sun.star.help://simpress/start");
+ } else if (aCmdLineArgs->IsHelpBase()) {
+ bShowHelp = sal_True;
+ aHelpURLBuffer.appendAscii("vnd.sun.star.help://sdatabase/start");
+ } else if (aCmdLineArgs->IsHelpBasic()) {
+ bShowHelp = sal_True;
+ aHelpURLBuffer.appendAscii("vnd.sun.star.help://sbasic/start");
+ } else if (aCmdLineArgs->IsHelpMath()) {
+ bShowHelp = sal_True;
+ aHelpURLBuffer.appendAscii("vnd.sun.star.help://smath/start");
+ }
+ if (bShowHelp) {
+ aHelpURLBuffer.appendAscii("?Language=");
+ aHelpURLBuffer.append(utl::ConfigManager::getLocale());
+#if defined UNX
+ aHelpURLBuffer.appendAscii("&System=UNX");
+#elif defined WNT
+ aHelpURLBuffer.appendAscii("&System=WIN");
+#endif
+ ApplicationEvent* pAppEvent = new ApplicationEvent(
+ ApplicationEvent::TYPE_OPENHELPURL,
+ aHelpURLBuffer.makeStringAndClear());
+ ImplPostForeignAppEvent( pAppEvent );
+ }
+ }
- ImplPostProcessDocumentsEvent( pRequest );
- }
- else
- {
- // delete not used request again
- delete pRequest;
- pRequest = NULL;
- }
- if (aArguments.equalsL(sc_aShowSequence, sc_nShSeqLength) ||
- aCmdLineArgs->IsEmpty())
- {
- // no document was sent, just bring Office to front
- ApplicationEvent* pAppEvent =
- new ApplicationEvent(ApplicationEvent::TYPE_APPEAR);
- ImplPostForeignAppEvent( pAppEvent );
+ if ( bDocRequestSent )
+ {
+ // Send requests to dispatch watcher if we have at least one. The receiver
+ // is responsible to delete the request after processing it.
+ if ( aCmdLineArgs->HasModuleParam() )
+ {
+ SvtModuleOptions aOpt;
+
+ // Support command line parameters to start a module (as preselection)
+ if ( aCmdLineArgs->IsWriter() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) )
+ pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::E_WRITER );
+ else if ( aCmdLineArgs->IsCalc() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) )
+ pRequest->aModule = aOpt.GetFactoryName( SvtModuleOptions::E_CALC );
+ else if ( aCmdLineArgs->IsImpress() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) )
+ pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::E_IMPRESS );
+ else if ( aCmdLineArgs->IsDraw() && aOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) )
+ pRequest->aModule= aOpt.GetFactoryName( SvtModuleOptions::E_DRAW );
+ }
+
+ ImplPostProcessDocumentsEvent( pRequest );
+ }
+ else
+ {
+ // delete not used request again
+ delete pRequest;
+ pRequest = NULL;
+ }
+ if (aArguments.equalsL(sc_aShowSequence, sc_nShSeqLength) ||
+ aCmdLineArgs->IsEmpty())
+ {
+ // no document was sent, just bring Office to front
+ ApplicationEvent* pAppEvent =
+ new ApplicationEvent(ApplicationEvent::TYPE_APPEAR);
+ ImplPostForeignAppEvent( pAppEvent );
+ }
}
// we don't need the mutex any longer...
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index a9501eda85ee..37b9c924d067 100755
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -38,21 +38,14 @@
#include <rtl/bootstrap.hxx>
#include <tools/extendapplicationenvironment.hxx>
-#if defined WNT
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
int SVMain();
// -=-= main() -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
extern "C" int DESKTOP_DLLPUBLIC soffice_main()
{
-#if defined ANDROID || defined WNT
+#if defined ANDROID
try {
-#endif
-#if defined(ANDROID)
rtl::Bootstrap::setIniFilename(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///assets/program/lofficerc")));
#endif
@@ -67,38 +60,31 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
// handle --version and --help already here, otherwise they would be handled
// after VCL initialization that might fail if $DISPLAY is not set
const desktop::CommandLineArgs& rCmdLineArgs = aDesktop.GetCommandLineArgs();
+ rtl::OUString aUnknown( rCmdLineArgs.GetUnknown() );
+ if ( !aUnknown.isEmpty() )
+ {
+ desktop::Desktop::InitApplicationServiceManager();
+ desktop::displayCmdlineHelp( aUnknown );
+ return EXIT_FAILURE;
+ }
if ( rCmdLineArgs.IsHelp() )
{
- desktop::Desktop::ensureProcessServiceFactory();
- desktop::displayCmdlineHelp();
+ desktop::Desktop::InitApplicationServiceManager();
+ desktop::displayCmdlineHelp( rtl::OUString() );
return EXIT_SUCCESS;
}
- else if ( rCmdLineArgs.IsVersion() )
+ if ( rCmdLineArgs.IsVersion() )
{
- desktop::Desktop::ensureProcessServiceFactory();
+ desktop::Desktop::InitApplicationServiceManager();
desktop::displayVersion();
return EXIT_SUCCESS;
}
- else if ( rCmdLineArgs.HasUnknown() )
- {
- return EXIT_FAILURE;
- }
#endif
return SVMain();
-#if defined ANDROID || defined WNT
- } catch (const ::com::sun::star::uno::Exception &e) {
#if defined ANDROID
+ } catch (const ::com::sun::star::uno::Exception &e) {
fprintf (stderr, "Not handled UNO exception at main: '%s'\n",
rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
-#elif defined WNT
- MessageBoxW(
- 0,
- reinterpret_cast< LPCWSTR >(
- rtl::OUString("Unhandled exception:\n" + e.Message).getStr()),
- reinterpret_cast< LPCWSTR >(rtl::OUString("Fatal Error").getStr()),
- (MB_OK | MB_ICONERROR | MB_DEFBUTTON1 | MB_TASKMODAL
- | MB_SETFOREGROUND | MB_TOPMOST));
-#endif
throw; // to get exception type printed
}
#endif
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index 0ef211a3cbeb..48510b19172c 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -88,6 +88,7 @@ private:
BitmapEx _aIntroBmp;
Color _cProgressFrameColor;
Color _cProgressBarColor;
+ Color _cProgressTextColor;
bool _bNativeProgress;
OUString _sAppName;
OUString _sProgressText;
@@ -103,7 +104,7 @@ private:
sal_Bool _bFullScreenSplash;
sal_Bool _bProgressEnd;
long _height, _width, _tlx, _tly, _barwidth;
- long _barheight, _barspace;
+ long _barheight, _barspace, _textBaseline;
double _fXPos, _fYPos;
double _fWidth, _fHeight;
const long _xoffset, _yoffset;
@@ -132,6 +133,7 @@ SplashScreen::SplashScreen()
, _vdev(*((IntroWindow*)this))
, _cProgressFrameColor(sal::static_int_cast< ColorData >(NOT_LOADED))
, _cProgressBarColor(sal::static_int_cast< ColorData >(NOT_LOADED))
+ , _cProgressTextColor(sal::static_int_cast< ColorData >(NOT_LOADED))
, _bNativeProgress(true)
, _iMax(100)
, _iProgress(0)
@@ -146,6 +148,7 @@ SplashScreen::SplashScreen()
, _barwidth(NOT_LOADED)
, _barheight(NOT_LOADED)
, _barspace(2)
+ , _textBaseline(NOT_LOADED)
, _fXPos(-1.0)
, _fYPos(-1.0)
, _fWidth(-1.0)
@@ -154,6 +157,7 @@ SplashScreen::SplashScreen()
, _yoffset(18)
{
loadConfig();
+ _vdev.EnableRTL(IsRTLEnabled());
}
SplashScreen::~SplashScreen()
@@ -299,6 +303,9 @@ SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::sta
}
}
+ if ( NOT_LOADED == _textBaseline )
+ _textBaseline = _height;
+
if ( sal::static_int_cast< ColorData >(NOT_LOADED) ==
_cProgressFrameColor.GetColor() )
_cProgressFrameColor = Color( COL_LIGHTGRAY );
@@ -313,6 +320,10 @@ SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::sta
_cProgressBarColor = Color( COL_BLUE );
}
+ if ( sal::static_int_cast< ColorData >(NOT_LOADED) ==
+ _cProgressTextColor.GetColor() )
+ _cProgressTextColor = Color( COL_BLACK );
+
Application::AddEventListener(
LINK( this, SplashScreen, AppEventListenerHdl ) );
@@ -365,6 +376,10 @@ void SplashScreen::loadConfig()
OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressFrameColor" ) ) );
OUString sProgressBarColor = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressBarColor" ) ) );
+ OUString sProgressTextColor = implReadBootstrapKey(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressTextColor" ) ) );
+ OUString sProgressTextBaseline = implReadBootstrapKey(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressTextBaseline" ) ) );
OUString sSize = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressSize" ) ) );
OUString sPosition = implReadBootstrapKey(
@@ -420,6 +435,29 @@ void SplashScreen::loadConfig()
}
}
+ if ( !sProgressTextColor.isEmpty() )
+ {
+ sal_uInt8 nRed = 0;
+ sal_Int32 idx = 0;
+ sal_Int32 temp = sProgressTextColor.getToken( 0, ',', idx ).toInt32();
+ if ( idx != -1 )
+ {
+ nRed = static_cast< sal_uInt8 >( temp );
+ temp = sProgressTextColor.getToken( 0, ',', idx ).toInt32();
+ }
+ if ( idx != -1 )
+ {
+ sal_uInt8 nGreen = static_cast< sal_uInt8 >( temp );
+ sal_uInt8 nBlue = static_cast< sal_uInt8 >( sProgressTextColor.getToken( 0, ',', idx ).toInt32() );
+ _cProgressTextColor = Color( nRed, nGreen, nBlue );
+ }
+ }
+
+ if ( !sProgressTextBaseline.isEmpty() )
+ {
+ _textBaseline = sProgressTextBaseline.toInt32();
+ }
+
if( !sNativeProgress.isEmpty() )
{
_bNativeProgress = sNativeProgress.toBoolean();
@@ -610,7 +648,12 @@ void SplashScreen::Paint( const Rectangle&)
_vdev.SetFillColor( _cProgressBarColor );
_vdev.SetLineColor();
_vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace));
- _vdev.DrawText( Rectangle(_tlx, _tly+_barheight+5, _tlx+_barwidth, _tly+_barheight+5+20), _sProgressText, TEXT_DRAW_CENTER );
+ Font aFont;
+ aFont.SetSize(Size(0, 12));
+ aFont.SetAlign(ALIGN_BASELINE);
+ _vdev.SetFont(aFont);
+ _vdev.SetTextColor(_cProgressTextColor);
+ _vdev.DrawText(Point(_tlx, _textBaseline), _sProgressText);
}
DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev.GetOutputSizePixel(), _vdev );
}
diff --git a/desktop/unx/source/args.c b/desktop/unx/source/args.c
index 0952911b5763..e08d119397de 100644
--- a/desktop/unx/source/args.c
+++ b/desktop/unx/source/args.c
@@ -48,30 +48,34 @@ static struct {
unsigned int bInhibitSplash : 1;
unsigned int bInhibitPagein : 1;
unsigned int bInhibitJavaLdx : 1;
+ unsigned int bInhibitPipe : 1;
const char *pPageinType;
} pArgDescr[] = {
/* have a trailing argument */
- { "pt", 1, 0, 0, 0, NULL },
- { "display", 1, 0, 0, 0, NULL },
+ { "pt", 1, 0, 0, 0, 0, NULL },
+ { "display", 1, 0, 0, 0, 0, NULL },
/* no splash */
- { "nologo", 0, 1, 0, 0, NULL },
- { "headless", 0, 1, 0, 0, NULL },
- { "invisible", 0, 1, 0, 0, NULL },
- { "quickstart", 0, 1, 0, 0, NULL },
- { "minimized", 0, 1, 0, 0, NULL },
+ { "nologo", 0, 1, 0, 0, 0, NULL },
+ { "headless", 0, 1, 0, 0, 0, NULL },
+ { "invisible", 0, 1, 0, 0, 0, NULL },
+ { "quickstart", 0, 1, 0, 0, 0, NULL },
+ { "minimized", 0, 1, 0, 0, 0, NULL },
/* pagein bits */
- { "writer", 0, 0, 0, 0, "pagein-writer" },
- { "calc", 0, 0, 0, 0, "pagein-calc" },
- { "draw", 0, 0, 0, 0, "pagein-draw" },
- { "impress", 0, 0, 0, 0, "pagein-impress" },
-
- /* nothing much */
- { "version", 0, 1, 1, 1, NULL },
- { "help", 0, 1, 1, 1, NULL },
- { "h", 0, 1, 1, 1, NULL },
- { "?", 0, 1, 1, 1, NULL },
+ { "writer", 0, 0, 0, 0, 0, "pagein-writer" },
+ { "calc", 0, 0, 0, 0, 0, "pagein-calc" },
+ { "draw", 0, 0, 0, 0, 0, "pagein-draw" },
+ { "impress", 0, 0, 0, 0, 0, "pagein-impress" },
+
+ /* Do not send --help/--version over the pipe, as their output shall go to
+ the calling process's stdout (ideally, this would also happen in the
+ presence of unknown options); also prevent splash/pagein/javaldx overhead
+ (as these options will be processed early in soffice_main): */
+ { "version", 0, 1, 1, 1, 1, NULL },
+ { "help", 0, 1, 1, 1, 1, NULL },
+ { "h", 0, 1, 1, 1, 1, NULL },
+ { "?", 0, 1, 1, 1, 1, NULL },
};
Args *args_parse (void)
@@ -126,14 +130,17 @@ Args *args_parse (void)
}
for ( j = 0; j < SAL_N_ELEMENTS (pArgDescr); ++j ) {
- if (!rtl_ustr_indexOfAscii_WithLength
- (arg, length, pArgDescr[j].name, strlen (pArgDescr[j].name))) {
-
+ if (rtl_ustr_ascii_compare_WithLength(
+ arg, length, pArgDescr[j].name)
+ == 0)
+ {
args->bInhibitSplash |= pArgDescr[j].bInhibitSplash;
args->bInhibitPagein |= pArgDescr[j].bInhibitPagein;
args->bInhibitJavaLdx |= pArgDescr[j].bInhibitJavaLdx;
+ args->bInhibitPipe |= pArgDescr[j].bInhibitPipe;
if (pArgDescr[j].pPageinType)
args->pPageinType = pArgDescr[j].pPageinType;
+ break;
}
}
}
diff --git a/desktop/unx/source/args.h b/desktop/unx/source/args.h
index 4a0cb55ffcde..9176badbda2a 100644
--- a/desktop/unx/source/args.h
+++ b/desktop/unx/source/args.h
@@ -38,6 +38,7 @@ typedef struct {
sal_Bool bInhibitSplash; // should we show a splash screen
sal_Bool bInhibitPagein; // should we run pagein ?
sal_Bool bInhibitJavaLdx; // should we run javaldx ?
+ sal_Bool bInhibitPipe; // for --help and --version
sal_uInt32 nArgsEnv; // number of -env: style args
sal_uInt32 nArgsTotal; // number of -env: as well as -writer style args
diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 8fe4774ef504..c6a8c2b826ed 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -831,21 +831,24 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
if ( pUsePlugin && !strcmp(pUsePlugin, "svp") )
args->bInhibitSplash = sal_True;
- pPipePath = get_pipe_path( args->pAppPath );
-
- if ( ( fd = connect_pipe( pPipePath ) ) >= 0 )
+ if ( !args->bInhibitPipe )
{
- rtl_uString *pCwdPath = NULL;
- osl_getProcessWorkingDir( &pCwdPath );
+ pPipePath = get_pipe_path( args->pAppPath );
+
+ if ( ( fd = connect_pipe( pPipePath ) ) >= 0 )
+ {
+ rtl_uString *pCwdPath = NULL;
+ osl_getProcessWorkingDir( &pCwdPath );
- bSentArgs = send_args( fd, pCwdPath );
+ bSentArgs = send_args( fd, pCwdPath );
- close( fd );
- }
+ close( fd );
+ }
#if OSL_DEBUG_LEVEL > 1
- else
- ustr_debug( "Failed to connect to pipe", pPipePath );
+ else
+ ustr_debug( "Failed to connect to pipe", pPipePath );
#endif
+ }
if ( !bSentArgs )
{
@@ -935,7 +938,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
}
/* cleanup */
- rtl_uString_release( pPipePath );
+ if ( pPipePath )
+ rtl_uString_release( pPipePath );
args_free (args);
return status;