summaryrefslogtreecommitdiff
path: root/desktop/source/app
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/app')
-rwxr-xr-x[-rw-r--r--]desktop/source/app/app.cxx481
-rwxr-xr-x[-rw-r--r--]desktop/source/app/appfirststart.cxx212
-rwxr-xr-x[-rw-r--r--]desktop/source/app/appinit.cxx62
-rwxr-xr-x[-rw-r--r--]desktop/source/app/appinit.hxx3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/appsys.cxx9
-rwxr-xr-x[-rw-r--r--]desktop/source/app/appsys.hxx3
-rwxr-xr-xdesktop/source/app/check_ext_deps.cxx19
-rwxr-xr-x[-rw-r--r--]desktop/source/app/checkinstall.cxx6
-rwxr-xr-x[-rw-r--r--]desktop/source/app/checkinstall.hxx3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/cmdlineargs.cxx389
-rwxr-xr-x[-rw-r--r--]desktop/source/app/cmdlineargs.hxx117
-rwxr-xr-x[-rw-r--r--]desktop/source/app/cmdlinehelp.cxx111
-rwxr-xr-x[-rw-r--r--]desktop/source/app/cmdlinehelp.hxx6
-rwxr-xr-x[-rw-r--r--]desktop/source/app/configinit.cxx4
-rwxr-xr-x[-rw-r--r--]desktop/source/app/configinit.hxx3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/copyright_ascii_ooo.c2
-rwxr-xr-x[-rw-r--r--]desktop/source/app/copyright_ascii_sun.c2
-rwxr-xr-x[-rw-r--r--]desktop/source/app/desktop.hrc0
-rwxr-xr-x[-rw-r--r--]desktop/source/app/desktop.src0
-rwxr-xr-x[-rw-r--r--]desktop/source/app/desktopcontext.cxx8
-rwxr-xr-x[-rw-r--r--]desktop/source/app/desktopcontext.hxx3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/desktopresid.cxx3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/desktopresid.hxx3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/dispatchwatcher.cxx267
-rwxr-xr-x[-rw-r--r--]desktop/source/app/dispatchwatcher.hxx14
-rwxr-xr-x[-rw-r--r--]desktop/source/app/exports.dxp0
-rwxr-xr-x[-rw-r--r--]desktop/source/app/langselect.cxx38
-rwxr-xr-x[-rw-r--r--]desktop/source/app/langselect.hxx3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/lockfile.cxx135
-rwxr-xr-x[-rw-r--r--]desktop/source/app/lockfile.hxx20
-rwxr-xr-x[-rw-r--r--]desktop/source/app/lockfile2.cxx12
-rwxr-xr-x[-rw-r--r--]desktop/source/app/main.c3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/makefile.mk6
-rwxr-xr-x[-rw-r--r--]desktop/source/app/officeipcthread.cxx141
-rwxr-xr-x[-rw-r--r--]desktop/source/app/officeipcthread.hxx28
-rwxr-xr-x[-rw-r--r--]desktop/source/app/omutexmember.hxx3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/sofficemain.cxx27
-rwxr-xr-x[-rw-r--r--]desktop/source/app/sofficemain.h3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/userinstall.cxx40
-rwxr-xr-x[-rw-r--r--]desktop/source/app/userinstall.hxx3
-rwxr-xr-x[-rw-r--r--]desktop/source/app/version.map0
41 files changed, 1178 insertions, 1014 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index a2f602082fe4..82d5afd986cc 100644..100755
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,7 @@
#include "userinstall.hxx"
#include "desktopcontext.hxx"
#include "exithelper.hxx"
-#include "../migration/pages.hxx"
+#include "migration.hxx"
#include <svtools/javacontext.hxx>
#include <com/sun/star/frame/XSessionManagerListener.hpp>
@@ -88,9 +89,7 @@
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/task/XJobExecutor.hpp>
#include <com/sun/star/task/XRestartManager.hpp>
-#ifndef _COM_SUN_STAR_TASK_XJOBEXECUTOR_HPP_
#include <com/sun/star/task/XJob.hpp>
-#endif
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/task/XJob.hpp>
@@ -101,17 +100,13 @@
#include <com/sun/star/java/XJavaVM.hpp>
#include <tools/testtoolloader.hxx>
#include <tools/solar.h>
-#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
#include <toolkit/unohlp.hxx>
-#endif
-#include <vos/security.hxx>
-#include <vos/ref.hxx>
+#include <osl/security.hxx>
+#include <rtl/ref.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/componentcontext.hxx>
#include <comphelper/configurationhelper.hxx>
-#ifndef _UTL__HXX_
#include <unotools/configmgr.hxx>
-#endif
#include <unotools/configitem.hxx>
#include <unotools/confignode.hxx>
#include <unotools/ucbhelper.hxx>
@@ -120,6 +115,7 @@
#include <unotools/moduleoptions.hxx>
#include <osl/module.h>
#include <osl/file.hxx>
+#include <osl/process.h>
#include <osl/signal.h>
#include <osl/thread.hxx>
#include <rtl/uuid.h>
@@ -145,12 +141,13 @@
#include <vcl/stdtext.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/sfx.hrc>
+#include <sfx2/app.hxx>
+#include <svl/itemset.hxx>
+#include <svl/eitem.hxx>
#include <ucbhelper/contentbroker.hxx>
#include <unotools/bootstrap.hxx>
#include <cppuhelper/bootstrap.hxx>
-#include "vos/process.hxx"
-
#include <svtools/fontsubstconfig.hxx>
#include <svtools/accessibilityoptions.hxx>
#include <svtools/apearcfg.hxx>
@@ -168,17 +165,13 @@
#define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII))
#define U2S(STRING) ::rtl::OUStringToOString(STRING, RTL_TEXTENCODING_UTF8)
-using namespace vos;
-using namespace rtl;
-
-//Gives an ICE with MSVC6
-//namespace css = ::com::sun::star;
+using rtl::OUString;
+using rtl::OUStringBuffer;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::bridge;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::document;
using namespace ::com::sun::star::view;
@@ -194,14 +187,9 @@ ResMgr* desktop::Desktop::pResMgr = 0;
namespace desktop
{
-static SalMainPipeExchangeSignalHandler* pSignalHandler = 0;
+static oslSignalHandler pSignalHandler = 0;
static sal_Bool _bCrashReporterEnabled = sal_True;
-static const ::rtl::OUString CFG_PACKAGE_COMMON_HELP ( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Help"));
-static const ::rtl::OUString CFG_PATH_REG ( RTL_CONSTASCII_USTRINGPARAM( "Registration" ));
-static const ::rtl::OUString CFG_ENTRY_REGURL ( RTL_CONSTASCII_USTRINGPARAM( "URL" ));
-static const ::rtl::OUString CFG_ENTRY_TEMPLATEREGURL ( RTL_CONSTASCII_USTRINGPARAM( "TemplateURL" ));
-
static ::rtl::OUString getBrandSharePreregBundledPathURL();
// ----------------------------------------------------------------------------
@@ -209,27 +197,16 @@ ResMgr* Desktop::GetDesktopResManager()
{
if ( !Desktop::pResMgr )
{
- String aMgrName = String::CreateFromAscii( "dkt" );
-
// Create desktop resource manager and bootstrap process
// was successful. Use default way to get language specific message.
if ( Application::IsInExecute() )
- Desktop::pResMgr = ResMgr::CreateResMgr( U2S( aMgrName ));
+ Desktop::pResMgr = ResMgr::CreateResMgr("dkt");
if ( !Desktop::pResMgr )
{
// Use VCL to get the correct language specific message as we
// are in the bootstrap process and not able to get the installed
// language!!
-/*
- LanguageType aLanguageType = LANGUAGE_DONTKNOW;
-
- Desktop::pResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLanguageType );
- AllSettings as = GetSettings();
- as.SetUILanguage(aLanguageType);
- SetSettings(as);
-*/
- // LanguageSelection langselect;
OUString aUILocaleString = LanguageSelection::getLanguageString();
sal_Int32 nIndex = 0;
OUString aLanguage = aUILocaleString.getToken( 0, '-', nIndex);
@@ -238,7 +215,7 @@ ResMgr* Desktop::GetDesktopResManager()
::com::sun::star::lang::Locale aLocale( aLanguage, aCountry, aVariant );
- Desktop::pResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLocale);
+ Desktop::pResMgr = ResMgr::SearchCreateResMgr( "dkt", aLocale);
AllSettings as = GetSettings();
as.SetUILocale(aLocale);
SetSettings(as);
@@ -294,7 +271,7 @@ OUString MakeStartupConfigAccessErrorMessage( OUString const & aInternalErrMsg )
if ( pResMgr )
aDiagnosticMessage.append( OUString(String(ResId(STR_INTERNAL_ERRMSG, *pResMgr ))) );
else
- aDiagnosticMessage.appendAscii( "The following internal error has occured:\n\n" );
+ aDiagnosticMessage.appendAscii( "The following internal error has occurred:\n\n" );
aDiagnosticMessage.append( aInternalErrMsg );
}
@@ -319,8 +296,7 @@ void FatalError(const ::rtl::OUString& sMessage)
::rtl::OUString sProductKey = ::utl::Bootstrap::getProductKey();
if ( ! sProductKey.getLength())
{
- ::vos::OStartupInfo aInfo;
- aInfo.getExecutableFile( sProductKey );
+ osl_getExecutableFile( &sProductKey.pData );
::sal_uInt32 nLastIndex = sProductKey.lastIndexOf('/');
if ( nLastIndex > 0 )
@@ -632,70 +608,73 @@ throw()
}
else if( TypeToCopy == +1 ) // Folder
{
- osl::Directory aDir( srcUnqPath );
- aDir.open();
-
err = osl::Directory::create( dstUnqPath );
osl::FileBase::RC next = err;
- if( err == osl::FileBase::E_None ||
- err == osl::FileBase::E_EXIST )
+ if( err == osl::FileBase::E_None || err == osl::FileBase::E_EXIST )
{
err = osl::FileBase::E_None;
- sal_Int32 n_Mask = FileStatusMask_FileURL | FileStatusMask_FileName | FileStatusMask_Type;
- osl::DirectoryItem aDirItem;
+ osl::Directory aDir( srcUnqPath );
bool bExcludeFiles = excludeTmpFilesAndFolders(srcUnqPath);
-
- while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None )
+ if (aDir.open() == osl::FileBase::E_None)
{
- sal_Bool IsDoc = false;
- sal_Bool bFilter = false;
- osl::FileStatus aFileStatus( n_Mask );
- aDirItem.getFileStatus( aFileStatus );
- if( aFileStatus.isValid( FileStatusMask_Type ) )
- IsDoc = aFileStatus.getFileType() == osl::FileStatus::Regular;
-
- // Getting the information for the next recursive copy
- sal_Int32 newTypeToCopy = IsDoc ? -1 : +1;
-
- rtl::OUString newSrcUnqPath;
- if( aFileStatus.isValid( FileStatusMask_FileURL ) )
- newSrcUnqPath = aFileStatus.getFileURL();
-
- rtl::OUString newDstUnqPath = dstUnqPath;
- rtl::OUString tit;
- if( aFileStatus.isValid( FileStatusMask_FileName ) )
+ sal_Int32 n_Mask = FileStatusMask_FileURL |
+ FileStatusMask_FileName |
+ FileStatusMask_Type;
+
+ osl::DirectoryItem aDirItem;
+ while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None )
{
- ::rtl::OUString aFileName = aFileStatus.getFileName();
- tit = rtl::Uri::encode( aFileName,
- rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 );
-
- // Special treatment for "lastsychronized" file. Must not be
- // copied from the bundled folder!
- //Also do not copy *.tmp files and *.tmp_ folders. This affects the files/folders
- //from the help and configuration backend
- if ( IsDoc && (aFileName.equalsAscii( pLastSyncFileName )
- || bExcludeFiles && isExcludedFileOrFolder(aFileName)))
- bFilter = true;
- else if (!IsDoc && bExcludeFiles && isExcludedFileOrFolder(aFileName))
- bFilter = true;
- }
+ sal_Bool IsDoc = false;
+ sal_Bool bFilter = false;
+ osl::FileStatus aFileStatus( n_Mask );
+ aDirItem.getFileStatus( aFileStatus );
+ if( aFileStatus.isValid( FileStatusMask_Type ) )
+ IsDoc = aFileStatus.getFileType() == osl::FileStatus::Regular;
+
+ // Getting the information for the next recursive copy
+ sal_Int32 newTypeToCopy = IsDoc ? -1 : +1;
+
+ rtl::OUString newSrcUnqPath;
+ if( aFileStatus.isValid( FileStatusMask_FileURL ) )
+ newSrcUnqPath = aFileStatus.getFileURL();
+
+ rtl::OUString newDstUnqPath = dstUnqPath;
+ rtl::OUString tit;
+ if( aFileStatus.isValid( FileStatusMask_FileName ) )
+ {
+ ::rtl::OUString aFileName = aFileStatus.getFileName();
+ tit = rtl::Uri::encode( aFileName,
+ rtl_UriCharClassPchar,
+ rtl_UriEncodeIgnoreEscapes,
+ RTL_TEXTENCODING_UTF8 );
+
+ // Special treatment for "lastsychronized" file. Must not be
+ // copied from the bundled folder!
+ //Also do not copy *.tmp files and *.tmp_ folders. This affects the files/folders
+ //from the help and configuration backend
+ if ( IsDoc && (aFileName.equalsAscii( pLastSyncFileName )
+ || bExcludeFiles && isExcludedFileOrFolder(aFileName)))
+ bFilter = true;
+ else if (!IsDoc && bExcludeFiles && isExcludedFileOrFolder(aFileName))
+ bFilter = true;
+ }
- if( newDstUnqPath.lastIndexOf( sal_Unicode('/') ) != newDstUnqPath.getLength()-1 )
- newDstUnqPath += rtl::OUString::createFromAscii( "/" );
+ if( newDstUnqPath.lastIndexOf( sal_Unicode('/') ) != newDstUnqPath.getLength()-1 )
+ newDstUnqPath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- newDstUnqPath += tit;
+ newDstUnqPath += tit;
- if (( newSrcUnqPath != dstUnqPath ) && !bFilter )
- err = copy_bundled_recursive( newSrcUnqPath,newDstUnqPath, newTypeToCopy );
- }
+ if (( newSrcUnqPath != dstUnqPath ) && !bFilter )
+ err = copy_bundled_recursive( newSrcUnqPath,newDstUnqPath, newTypeToCopy );
+ }
+
+ if( err == osl::FileBase::E_None && next != osl::FileBase::E_NOENT )
+ err = next;
- if( err == osl::FileBase::E_None && next != osl::FileBase::E_NOENT )
- err = next;
+ aDir.close();
+ }
}
- aDir.close();
}
return err;
@@ -736,14 +715,10 @@ void Desktop::Init()
}
}
- // create service factory...
- Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager();
- if( rSMgr.is() )
- {
- ::comphelper::setProcessServiceFactory( rSMgr );
- }
- else
+ // We need to have service factory before going further.
+ if( !::comphelper::getProcessServiceFactory().is())
{
+ OSL_ENSURE(0, "Service factory should have been crated in soffice_main().");
SetBootstrapError( BE_UNO_SERVICEMANAGER );
}
@@ -762,13 +737,6 @@ void Desktop::Init()
if ( GetBootstrapError() == BE_OK )
{
CommandLineArgs* pCmdLineArgs = GetCommandLineArgs();
-#ifdef UNX
- // check whether we need to print cmdline help
- if ( pCmdLineArgs->IsHelp() ) {
- displayCmdlineHelp();
- SetBootstrapStatus(BS_TERMINATE);
- }
-#endif
// start ipc thread only for non-remote offices
RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) ::OfficeIPCThread::EnableOfficeIPCThread" );
OfficeIPCThread::Status aStatus = OfficeIPCThread::EnableOfficeIPCThread();
@@ -786,7 +754,25 @@ void Desktop::Init()
// disable IPC thread in an instance that is just showing a help message
OfficeIPCThread::DisableOfficeIPCThread();
}
- pSignalHandler = new SalMainPipeExchangeSignalHandler;
+ pSignalHandler = osl_addSignalHandler(SalMainPipeExchangeSignal_impl, NULL);
+ }
+}
+
+void Desktop::InitFinished()
+{
+ RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::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::CreateProcessServiceFactory()
+{
+ Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager();
+ if( rSMgr.is() )
+ {
+ ::comphelper::setProcessServiceFactory( rSMgr );
}
}
@@ -797,7 +783,7 @@ void Desktop::DeInit()
try {
// instead of removing of the configManager just let it commit all the changes
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
- utl::ConfigManager::GetConfigManager()->StoreConfigItems();
+ utl::ConfigManager::GetConfigManager().StoreConfigItems();
FlushConfiguration();
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
@@ -814,7 +800,7 @@ void Desktop::DeInit()
OfficeIPCThread::DisableOfficeIPCThread();
if( pSignalHandler )
- DELETEZ( pSignalHandler );
+ osl_removeSignalHandler( pSignalHandler );
} catch (RuntimeException&) {
// someone threw an exception during shutdown
// this will leave some garbage behind..
@@ -828,7 +814,7 @@ sal_Bool Desktop::QueryExit()
try
{
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
- utl::ConfigManager::GetConfigManager()->StoreConfigItems();
+ utl::ConfigManager::GetConfigManager().StoreConfigItems();
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
}
catch ( RuntimeException& )
@@ -881,14 +867,10 @@ void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStat
{
if ( aBootstrapStatus != ::utl::Bootstrap::DATA_OK )
{
- sal_Bool bWorkstationInstallation = sal_False;
- ::rtl::OUString aBaseInstallURL;
- ::rtl::OUString aUserInstallURL;
::rtl::OUString aProductKey;
::rtl::OUString aTemp;
- ::vos::OStartupInfo aInfo;
- aInfo.getExecutableFile( aProductKey );
+ osl_getExecutableFile( &aProductKey.pData );
sal_uInt32 lastIndex = aProductKey.lastIndexOf('/');
if ( lastIndex > 0 )
aProductKey = aProductKey.copy( lastIndex+1 );
@@ -897,16 +879,6 @@ void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStat
if ( aTemp.getLength() > 0 )
aProductKey = aTemp;
- ::utl::Bootstrap::PathStatus aBaseInstallStatus = ::utl::Bootstrap::locateBaseInstallation( aBaseInstallURL );
- ::utl::Bootstrap::PathStatus aUserInstallStatus = ::utl::Bootstrap::locateUserInstallation( aUserInstallURL );
-
- if (( aBaseInstallStatus == ::utl::Bootstrap::PATH_EXISTS &&
- aUserInstallStatus == ::utl::Bootstrap::PATH_EXISTS ))
- {
- if ( aBaseInstallURL != aUserInstallURL )
- bWorkstationInstallation = sal_True;
- }
-
OUString aMessage;
OUStringBuffer aBuffer( 100 );
aBuffer.append( aDiagnosticMessage );
@@ -1213,9 +1185,9 @@ void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError )
void Desktop::retrieveCrashReporterState()
{
- static const ::rtl::OUString CFG_PACKAGE_RECOVERY = ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery/");
- static const ::rtl::OUString CFG_PATH_CRASHREPORTER = ::rtl::OUString::createFromAscii("CrashReporter" );
- static const ::rtl::OUString CFG_ENTRY_ENABLED = ::rtl::OUString::createFromAscii("Enabled" );
+ static const ::rtl::OUString CFG_PACKAGE_RECOVERY(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery/"));
+ static const ::rtl::OUString CFG_PATH_CRASHREPORTER(RTL_CONSTASCII_USTRINGPARAM("CrashReporter"));
+ static const ::rtl::OUString CFG_ENTRY_ENABLED(RTL_CONSTASCII_USTRINGPARAM("Enabled"));
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
@@ -1235,9 +1207,9 @@ void Desktop::retrieveCrashReporterState()
sal_Bool Desktop::isUIOnSessionShutdownAllowed()
{
- static const ::rtl::OUString CFG_PACKAGE_RECOVERY = ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery/");
- static const ::rtl::OUString CFG_PATH_SESSION = ::rtl::OUString::createFromAscii("SessionShutdown" );
- static const ::rtl::OUString CFG_ENTRY_UIENABLED = ::rtl::OUString::createFromAscii("DocumentStoreUIEnabled" );
+ static const ::rtl::OUString CFG_PACKAGE_RECOVERY(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery/"));
+ static const ::rtl::OUString CFG_PATH_SESSION(RTL_CONSTASCII_USTRINGPARAM("SessionShutdown"));
+ static const ::rtl::OUString CFG_ENTRY_UIENABLED(RTL_CONSTASCII_USTRINGPARAM("DocumentStoreUIEnabled"));
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
@@ -1286,12 +1258,10 @@ void impl_checkRecoveryState(sal_Bool& bCrashed ,
sal_Bool& bRecoveryDataExists,
sal_Bool& bSessionDataExists )
{
- static const ::rtl::OUString SERVICENAME_RECOVERYCORE = ::rtl::OUString::createFromAscii("com.sun.star.frame.AutoRecovery");
- static const ::rtl::OUString PROP_CRASHED = ::rtl::OUString::createFromAscii("Crashed" );
- static const ::rtl::OUString PROP_EXISTSRECOVERY = ::rtl::OUString::createFromAscii("ExistsRecoveryData" );
- static const ::rtl::OUString PROP_EXISTSSESSION = ::rtl::OUString::createFromAscii("ExistsSessionData" );
- static const ::rtl::OUString CFG_PACKAGE_RECOVERY = ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery/");
- static const ::rtl::OUString CFG_PATH_RECOVERYINFO = ::rtl::OUString::createFromAscii("RecoveryInfo" );
+ static const ::rtl::OUString SERVICENAME_RECOVERYCORE(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.AutoRecovery"));
+ static const ::rtl::OUString PROP_CRASHED(RTL_CONSTASCII_USTRINGPARAM("Crashed"));
+ static const ::rtl::OUString PROP_EXISTSRECOVERY(RTL_CONSTASCII_USTRINGPARAM("ExistsRecoveryData"));
+ static const ::rtl::OUString PROP_EXISTSSESSION(RTL_CONSTASCII_USTRINGPARAM("ExistsSessionData"));
bCrashed = sal_False;
bRecoveryDataExists = sal_False;
@@ -1321,11 +1291,11 @@ sal_Bool impl_callRecoveryUI(sal_Bool bEmergencySave ,
sal_Bool bCrashed ,
sal_Bool bExistsRecoveryData)
{
- static ::rtl::OUString SERVICENAME_RECOVERYUI = ::rtl::OUString::createFromAscii("com.sun.star.comp.svx.RecoveryUI" );
- static ::rtl::OUString SERVICENAME_URLPARSER = ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" );
- static ::rtl::OUString COMMAND_EMERGENCYSAVE = ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doEmergencySave");
- static ::rtl::OUString COMMAND_RECOVERY = ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doAutoRecovery" );
- static ::rtl::OUString COMMAND_CRASHREPORT = ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/doCrashReport" );
+ static ::rtl::OUString SERVICENAME_RECOVERYUI(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.svx.RecoveryUI"));
+ static ::rtl::OUString SERVICENAME_URLPARSER(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"));
+ static ::rtl::OUString COMMAND_EMERGENCYSAVE(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.autorecovery:/doEmergencySave"));
+ static ::rtl::OUString COMMAND_RECOVERY(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.autorecovery:/doAutoRecovery"));
+ static ::rtl::OUString COMMAND_CRASHREPORT(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.autorecovery:/doCrashReport"));
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
@@ -1509,8 +1479,12 @@ sal_uInt16 Desktop::Exception(sal_uInt16 nError)
{
OfficeIPCThread::DisableOfficeIPCThread();
if( pSignalHandler )
- DELETEZ( pSignalHandler );
+ osl_removeSignalHandler( pSignalHandler );
+
restartOnMac(false);
+ if ( m_rSplashScreen.is() )
+ m_rSplashScreen->reset();
+
_exit( ExitHelper::E_CRASH_WITH_RESTART );
}
else
@@ -1531,6 +1505,24 @@ void Desktop::AppEvent( const ApplicationEvent& rAppEvent )
HandleAppEvent( rAppEvent );
}
+namespace {
+ void SetDocumentExtendedStyle( const Reference< ::com::sun::star::awt::XWindow > &xContainerWindow )
+ {
+ // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank"
+ // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
+ // otherwise documents loaded into this frame will later on miss functionality depending on the style.
+ Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
+ OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" );
+ if (!pContainerWindow) {
+ fprintf (stderr, "Error: It very much looks as if you have used 'linkoo' (or bin/ooinstall -l)\n"
+ "but have then forgotten to source 'ooenv' into your shell before running !\n"
+ "to save a crash, we will exit now with an error - please '. ./ooenv' first.\n");
+ exit (1);
+ }
+ pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT );
+ }
+}
+
struct ExecuteGlobals
{
Reference < css::document::XEventListener > xGlobalBroadcaster;
@@ -1561,12 +1553,12 @@ void Desktop::Main()
if ( eError != BE_OK )
{
HandleBootstrapErrors( eError );
- return;
+ return EXIT_FAILURE;
}
BootstrapStatus eStatus = GetBootstrapStatus();
if (eStatus == BS_TERMINATE) {
- return;
+ return EXIT_FAILURE;
}
// Detect desktop environment - need to do this as early as possible
@@ -1587,6 +1579,7 @@ void Desktop::Main()
OpenSplashScreen();
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main } OpenSplashScreen" );
+ SetSplashScreenProgress(10);
{
UserInstall::UserInstallError instErr_fin = UserInstall::finalize();
if ( instErr_fin != UserInstall::E_None)
@@ -1598,11 +1591,11 @@ void Desktop::Main()
HandleBootstrapErrors( BE_USERINSTALL_NOWRITEACCESS );
else
HandleBootstrapErrors( BE_USERINSTALL_FAILED );
- return;
+ return EXIT_FAILURE;
}
// refresh path information
utl::Bootstrap::reloadData();
- SetSplashScreenProgress(25);
+ SetSplashScreenProgress(20);
}
Reference< XMultiServiceFactory > xSMgr =
@@ -1614,12 +1607,12 @@ void Desktop::Main()
{
RegisterServices( xSMgr );
- //SetSplashScreenProgress(15);
+ SetSplashScreenProgress(25);
#ifndef UNX
if ( pCmdLineArgs->IsHelp() ) {
displayCmdlineHelp();
- return;
+ return EXIT_SUCCESS;
}
#endif
@@ -1629,7 +1622,7 @@ void Desktop::Main()
m_pLockfile = new Lockfile;
if ( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoLockcheck() && !m_pLockfile->check( Lockfile_execWarning )) {
// Lockfile exists, and user clicked 'no'
- return;
+ return EXIT_FAILURE;
}
RTL_LOGFILE_CONTEXT_TRACE( aLog, "desktop (lo119109) Desktop::Main <- Lockfile" );
@@ -1641,18 +1634,20 @@ void Desktop::Main()
if( !InitAccessBridge( true, bQuitApp ) )
if( bQuitApp )
- return;
+ return EXIT_FAILURE;
}
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} GetEnableATToolSupport" );
// terminate if requested...
- if( pCmdLineArgs->IsTerminateAfterInit() ) return;
+ if( pCmdLineArgs->IsTerminateAfterInit() )
+ return EXIT_SUCCESS;
// Read the common configuration items for optimization purpose
- if ( !InitializeConfiguration() ) return;
+ if ( !InitializeConfiguration() )
+ return EXIT_FAILURE;
- //SetSplashScreenProgress(20);
+ SetSplashScreenProgress(30);
// set static variable to enabled/disable crash reporter
retrieveCrashReporterState();
@@ -1666,7 +1661,7 @@ void Desktop::Main()
sal_Bool bCheckOk = sal_False;
::com::sun::star::lang::Locale aLocale;
String aMgrName = String::CreateFromAscii( "ofa" );
- ResMgr* pLabelResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ), aLocale );
+ ResMgr* pLabelResMgr = ResMgr::SearchCreateResMgr( "ofa", aLocale );
String aTitle = pLabelResMgr ? String( ResId( RID_APPTITLE, *pLabelResMgr ) ) : String();
delete pLabelResMgr;
@@ -1674,7 +1669,7 @@ void Desktop::Main()
OUString aTitleString( aTitle );
bCheckOk = CheckInstallation( aTitleString );
if ( !bCheckOk )
- return;
+ return EXIT_FAILURE;
else
aTitle = aTitleString;
@@ -1688,6 +1683,7 @@ void Desktop::Main()
#endif
SetDisplayName( aTitle );
+ SetSplashScreenProgress(35);
RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create SvtPathOptions and SvtLanguageOptions" );
pExecGlobals->pPathOptions.reset( new SvtPathOptions);
SetSplashScreenProgress(40);
@@ -1728,38 +1724,9 @@ void Desktop::Main()
SynchronizeExtensionRepositories();
bool bAbort = CheckExtensionDependencies();
if ( bAbort )
- return;
- // First Start Wizard allowed ?
- if ( ! pCmdLineArgs->IsNoFirstStartWizard())
- {
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ FirstStartWizard" );
-
- if (IsFirstStartWizardNeeded())
- {
- ::utl::RegOptions().removeReminder(); // remove patch registration reminder
- Reference< XJob > xFirstStartJob( xSMgr->createInstance(
- DEFINE_CONST_UNICODE( "com.sun.star.comp.desktop.FirstStart" ) ), UNO_QUERY );
- if (xFirstStartJob.is())
- {
- sal_Bool bDone = sal_False;
- Sequence< NamedValue > lArgs(2);
- lArgs[0].Name = ::rtl::OUString::createFromAscii("LicenseNeedsAcceptance");
- lArgs[0].Value <<= LicenseNeedsAcceptance();
- lArgs[1].Name = ::rtl::OUString::createFromAscii("LicensePath");
- lArgs[1].Value <<= GetLicensePath();
-
- xFirstStartJob->execute(lArgs) >>= bDone;
- if ( !bDone )
- {
- return;
- }
- }
- }
- else if ( RegistrationPage::hasReminderDateCome() )
- RegistrationPage::executeSingleMode();
+ return EXIT_FAILURE;
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "} FirstStartWizard" );
- }
+ Migration::migrateSettingsIfNecessary();
// keep a language options instance...
pExecGlobals->pLanguageOptions.reset( new SvtLanguageOptions(sal_True));
@@ -1767,7 +1734,7 @@ void Desktop::Main()
if (pExecGlobals->xGlobalBroadcaster.is())
{
css::document::EventObject aEvent;
- aEvent.EventName = ::rtl::OUString::createFromAscii("OnStartApp");
+ aEvent.EventName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnStartApp"));
pExecGlobals->xGlobalBroadcaster->notifyEvent(aEvent);
}
@@ -1812,6 +1779,7 @@ void Desktop::Main()
Reference< XFrame > xDesktopFrame( xSMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY );
if (xDesktopFrame.is())
{
+ SetSplashScreenProgress(60);
Reference< XFrame > xBackingFrame;
Reference< ::com::sun::star::awt::XWindow > xContainerWindow;
@@ -1820,13 +1788,7 @@ void Desktop::Main()
xContainerWindow = xBackingFrame->getContainerWindow();
if (xContainerWindow.is())
{
- // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank"
- // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior,
- // otherwise documents loaded into this frame will later on miss functionality depending on the style.
- Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow );
- OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" );
- pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT );
-
+ SetDocumentExtendedStyle(xContainerWindow);
SetSplashScreenProgress(75);
Sequence< Any > lArgs(1);
lArgs[0] <<= xContainerWindow;
@@ -1856,13 +1818,14 @@ void Desktop::Main()
com::sun::star::uno::Exception te;
wte.TargetException >>= te;
FatalError( MakeStartupConfigAccessErrorMessage(wte.Message + te.Message) );
- return;
+ return EXIT_FAILURE;
}
catch ( com::sun::star::uno::Exception& e )
{
FatalError( MakeStartupErrorMessage(e.Message) );
- return;
+ return EXIT_FAILURE;
}
+ SetSplashScreenProgress(55);
SvtFontSubstConfig().Apply();
@@ -1871,6 +1834,7 @@ void Desktop::Main()
aAppearanceCfg.SetApplicationDefaults( this );
SvtAccessibilityOptions aOptions;
aOptions.SetVCLSettings();
+ SetSplashScreenProgress(60);
if ( !pExecGlobals->bRestartRequested )
{
@@ -1883,7 +1847,7 @@ void Desktop::Main()
// use system window dialogs
Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_DIALOG );
- // SetSplashScreenProgress(80);
+ SetSplashScreenProgress(80);
if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() &&
!pCmdLineArgs->IsNoQuickstart() )
@@ -1901,7 +1865,7 @@ void Desktop::Main()
catch ( com::sun::star::uno::Exception& e )
{
FatalError( MakeStartupErrorMessage(e.Message) );
- return;
+ return EXIT_FAILURE;
}
// Post user event to startup first application component window
@@ -1967,7 +1931,7 @@ void Desktop::doShutdown()
if (pExecGlobals->xGlobalBroadcaster.is())
{
css::document::EventObject aEvent;
- aEvent.EventName = ::rtl::OUString::createFromAscii("OnCloseApp");
+ aEvent.EventName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnCloseApp"));
pExecGlobals->xGlobalBroadcaster->notifyEvent(aEvent);
}
@@ -2004,9 +1968,12 @@ void Desktop::doShutdown()
if ( bRR )
{
restartOnMac(true);
- // wouldn't the solution be more clean if SalMain returns the exit code to the system?
- _exit( ExitHelper::E_NORMAL_RESTART );
+ if ( m_rSplashScreen.is() )
+ m_rSplashScreen->reset();
+
+ return ExitHelper::E_NORMAL_RESTART;
}
+ return EXIT_SUCCESS;
}
IMPL_LINK( Desktop, ImplInitFilterHdl, ConvertData*, pData )
@@ -2082,7 +2049,7 @@ sal_Bool Desktop::InitializeConfiguration()
void Desktop::FlushConfiguration()
{
- Reference < XFlushable > xCFGFlush( ::utl::ConfigManager::GetConfigManager()->GetConfigurationProvider(), UNO_QUERY );
+ Reference < XFlushable > xCFGFlush( ::utl::ConfigManager::GetConfigManager().GetConfigurationProvider(), UNO_QUERY );
if (xCFGFlush.is())
{
xCFGFlush->flush();
@@ -2090,12 +2057,28 @@ void Desktop::FlushConfiguration()
else
{
// because there is no method to flush the condiguration data, we must dispose the ConfigManager
- Reference < XComponent > xCFGDispose( ::utl::ConfigManager::GetConfigManager()->GetConfigurationProvider(), UNO_QUERY );
+ Reference < XComponent > xCFGDispose( ::utl::ConfigManager::GetConfigManager().GetConfigurationProvider(), UNO_QUERY );
if (xCFGDispose.is())
xCFGDispose->dispose();
}
}
+sal_Bool Desktop::shouldLaunchQuickstart()
+{
+ sal_Bool bQuickstart = GetCommandLineArgs()->IsQuickstart();
+ if (!bQuickstart)
+ {
+ const SfxPoolItem* pItem=0;
+ SfxItemSet aQLSet(SFX_APP()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER);
+ SFX_APP()->GetOptions(aQLSet);
+ SfxItemState eState = aQLSet.GetItemState(SID_ATTR_QUICKLAUNCHER, FALSE, &pItem);
+ if (SFX_ITEM_SET == eState)
+ bQuickstart = ((SfxBoolItem*)pItem)->GetValue();
+ }
+ return bQuickstart;
+}
+
+
sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& rSMgr )
{
try
@@ -2105,9 +2088,7 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
// this will only be activated if -quickstart was specified on cmdline
RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) createInstance com.sun.star.office.Quickstart" );
- sal_Bool bQuickstart = GetCommandLineArgs()->IsQuickstart();
- Sequence< Any > aSeq( 1 );
- aSeq[0] <<= bQuickstart;
+ sal_Bool bQuickstart = shouldLaunchQuickstart();
// Try to instanciate quickstart service. This service is not mandatory, so
// do nothing if service is not available
@@ -2120,6 +2101,8 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
if ( bQuickstart )
//#endif
{
+ Sequence< Any > aSeq( 1 );
+ aSeq[0] <<= bQuickstart;
Reference < XComponent > xQuickstart( rSMgr->createInstanceWithArguments(
DEFINE_CONST_UNICODE( "com.sun.star.office.Quickstart" ), aSeq ),
UNO_QUERY );
@@ -2168,24 +2151,8 @@ void Desktop::SystemSettingsChanging( AllSettings& rSettings, Window* )
hMouseSettings.SetFollow( aAppearanceCfg.IsMenuMouseFollow() ? (nFollow|MOUSE_FOLLOW_MENU) : (nFollow&~MOUSE_FOLLOW_MENU));
rSettings.SetMouseSettings(hMouseSettings);
- sal_Bool bUseImagesInMenus = hStyleSettings.GetUseImagesInMenus();
-
SvtMenuOptions aMenuOpt;
- nGet = aMenuOpt.GetMenuIconsState();
- switch ( nGet )
- {
- case 0:
- bUseImagesInMenus = sal_False;
- break;
- case 1:
- bUseImagesInMenus = sal_True;
- break;
- case 2:
- default:
- break;
- }
- hStyleSettings.SetUseImagesInMenus(bUseImagesInMenus);
-
+ hStyleSettings.SetUseImagesInMenus(aMenuOpt.GetMenuIconsState());
hStyleSettings.SetDragFullOptions( nDragFullOptions );
rSettings.SetStyleSettings ( hStyleSettings );
}
@@ -2221,7 +2188,6 @@ IMPL_LINK( Desktop, OpenClients_Impl, void*, EMPTYARG )
OfficeIPCThread::SetReady();
- // CloseStartupScreen();
CloseSplashScreen();
CheckFirstRun( );
EnableOleAutomation();
@@ -2254,7 +2220,7 @@ sal_Bool Desktop::CheckOEM()
{
Reference<XMultiServiceFactory> rFactory = ::comphelper::getProcessServiceFactory();
Reference<XJob> rOemJob(rFactory->createInstance(
- OUString::createFromAscii("com.sun.star.office.OEMPreloadJob")),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.office.OEMPreloadJob"))),
UNO_QUERY );
Sequence<NamedValue> args;
sal_Bool bResult = sal_False;
@@ -2511,7 +2477,7 @@ void Desktop::PreloadConfigurationData()
{
// preload writer configuration
Sequence< Any > theArgs(1);
- theArgs[ 0 ] <<= OUString::createFromAscii( "org.openoffice.Office.Writer/MailMergeWizard" );
+ theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Writer/MailMergeWizard"));
try
{
xNameAccess = Reference< XNameAccess >(
@@ -2522,7 +2488,7 @@ void Desktop::PreloadConfigurationData()
}
// WriterWeb
- theArgs[ 0 ] <<= OUString::createFromAscii( "org.openoffice.Office.WriterWeb/Content" );
+ theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.WriterWeb/Content"));
try
{
xNameAccess = Reference< XNameAccess >(
@@ -2533,7 +2499,7 @@ void Desktop::PreloadConfigurationData()
}
// preload compatibility
- theArgs[ 0 ] <<= OUString::createFromAscii( "org.openoffice.Office.Compatibility/WriterCompatibilityVersion" );
+ theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Compatibility/WriterCompatibilityVersion"));
try
{
xNameAccess = Reference< XNameAccess >(
@@ -2544,7 +2510,7 @@ void Desktop::PreloadConfigurationData()
}
// preload calc configuration
- theArgs[ 0 ] <<= OUString::createFromAscii( "org.openoffice.Office.Calc/Content" );
+ theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Calc/Content"));
try
{
xNameAccess = Reference< XNameAccess >(
@@ -2555,7 +2521,7 @@ void Desktop::PreloadConfigurationData()
}
// preload impress configuration
- theArgs[ 0 ] <<= OUString::createFromAscii( "org.openoffice.Office.UI.Effects/UserInterface" );
+ theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.UI.Effects/UserInterface"));
try
{
xNameAccess = Reference< XNameAccess >(
@@ -2565,7 +2531,7 @@ void Desktop::PreloadConfigurationData()
{
}
- theArgs[ 0 ] <<= OUString::createFromAscii( "org.openoffice.Office.Impress/Layout" );
+ theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Impress/Layout"));
try
{
xNameAccess = Reference< XNameAccess >(
@@ -2576,7 +2542,7 @@ void Desktop::PreloadConfigurationData()
}
// preload draw configuration
- theArgs[ 0 ] <<= OUString::createFromAscii( "org.openoffice.Office.Draw/Layout" );
+ theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Draw/Layout"));
try
{
xNameAccess = Reference< XNameAccess >(
@@ -2587,7 +2553,7 @@ void Desktop::PreloadConfigurationData()
}
// preload ui configuration
- theArgs[ 0 ] <<= OUString::createFromAscii( "org.openoffice.Office.UI/FilterClassification" );
+ theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.UI/FilterClassification"));
try
{
xNameAccess = Reference< XNameAccess >(
@@ -2598,7 +2564,7 @@ void Desktop::PreloadConfigurationData()
}
// preload addons configuration
- theArgs[ 0 ] <<= OUString::createFromAscii( "org.openoffice.Office.Addons/AddonUI" );
+ theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Addons/AddonUI"));
try
{
xNameAccess = Reference< XNameAccess >(
@@ -2670,9 +2636,8 @@ void Desktop::OpenClients()
else
{
OUString aIniName;
- ::vos::OStartupInfo aInfo;
- aInfo.getExecutableFile( aIniName );
+ osl_getExecutableFile( &aIniName.pData );
sal_uInt32 lastIndex = aIniName.lastIndexOf('/');
if ( lastIndex > 0 )
{
@@ -2691,7 +2656,7 @@ void Desktop::OpenClients()
OUString aPreloadData;
aPerfTuneIniFile.getFrom( OUString( RTL_CONSTASCII_USTRINGPARAM( "QuickstartPreloadConfiguration" )), aPreloadData, aDefault );
- if ( aPreloadData.equalsAscii( "1" ))
+ if ( aPreloadData.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "1" ) ))
{
if ( pArgs->IsWriter() ||
pArgs->IsCalc() ||
@@ -2731,14 +2696,14 @@ void Desktop::OpenClients()
::com::sun::star::uno::UNO_QUERY_THROW );
css::util::URL aCmd;
- aCmd.Complete = ::rtl::OUString::createFromAscii("vnd.sun.star.autorecovery:/disableRecovery");
+ aCmd.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.autorecovery:/disableRecovery"));
xParser->parseStrict(aCmd);
xRecovery->dispatch(aCmd, css::uno::Sequence< css::beans::PropertyValue >());
}
catch(const css::uno::Exception& e)
{
- OUString aMessage = OUString::createFromAscii("Could not disable AutoRecovery.\n")
+ OUString aMessage = OUString(RTL_CONSTASCII_USTRINGPARAM("Could not disable AutoRecovery.\n"))
+ e.Message;
OSL_ENSURE(sal_False, OUStringToOString(aMessage, RTL_TEXTENCODING_ASCII_US).getStr());
}
@@ -2780,7 +2745,7 @@ void Desktop::OpenClients()
}
catch(const css::uno::Exception& e)
{
- OUString aMessage = OUString::createFromAscii("Error during recovery\n")
+ OUString aMessage = OUString(RTL_CONSTASCII_USTRINGPARAM("Error during recovery\n"))
+ e.Message;
OSL_ENSURE(sal_False, OUStringToOString(aMessage, RTL_TEXTENCODING_ASCII_US).getStr());
}
@@ -2790,7 +2755,7 @@ void Desktop::OpenClients()
try
{
xSessionListener = Reference< XInitialization >(::comphelper::getProcessServiceFactory()->createInstance(
- OUString::createFromAscii("com.sun.star.frame.SessionListener")), UNO_QUERY_THROW);
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.SessionListener"))), UNO_QUERY_THROW);
// specifies whether the UI-interaction on Session shutdown is allowed
sal_Bool bAllowUI = isUIOnSessionShutdownAllowed();
@@ -2803,7 +2768,7 @@ void Desktop::OpenClients()
}
catch(const com::sun::star::uno::Exception& e)
{
- OUString aMessage = OUString::createFromAscii("Registration of session listener failed\n")
+ OUString aMessage = OUString(RTL_CONSTASCII_USTRINGPARAM("Registration of session listener failed\n"))
+ e.Message;
OSL_ENSURE(sal_False, OUStringToOString(aMessage, RTL_TEXTENCODING_ASCII_US).getStr());
}
@@ -2821,7 +2786,7 @@ void Desktop::OpenClients()
}
catch(const com::sun::star::uno::Exception& e)
{
- OUString aMessage = OUString::createFromAscii("Error in session management\n")
+ OUString aMessage = OUString(RTL_CONSTASCII_USTRINGPARAM("Error in session management\n"))
+ e.Message;
OSL_ENSURE(sal_False, OUStringToOString(aMessage, RTL_TEXTENCODING_ASCII_US).getStr());
}
@@ -2844,6 +2809,10 @@ void Desktop::OpenClients()
pArgs->GetPrinterName( aRequest.aPrinterName );
pArgs->GetForceOpenList( aRequest.aForceOpenList );
pArgs->GetForceNewList( aRequest.aForceNewList );
+ pArgs->GetConversionList( aRequest.aConversionList );
+ pArgs->GetConversionParams( aRequest.aConversionParams );
+ pArgs->GetConversionOut( aRequest.aConversionOut );
+ pArgs->GetInFilter( aRequest.aInFilter );
if ( aRequest.aOpenList.getLength() > 0 ||
aRequest.aViewList.getLength() > 0 ||
@@ -2851,7 +2820,8 @@ void Desktop::OpenClients()
aRequest.aPrintList.getLength() > 0 ||
aRequest.aForceOpenList.getLength() > 0 ||
aRequest.aForceNewList.getLength() > 0 ||
- ( aRequest.aPrintToList.getLength() > 0 && aRequest.aPrinterName.getLength() > 0 ))
+ ( aRequest.aPrintToList.getLength() > 0 && aRequest.aPrinterName.getLength() > 0 ) ||
+ aRequest.aConversionList.getLength() > 0 )
{
bLoaded = sal_True;
@@ -2987,7 +2957,7 @@ String GetURL_Impl(
}
// Add path seperator to these directory and make given URL (rName) absolute by using of current working directory
- // Attention: "setFianlSlash()" is neccessary for calling "smartRel2Abs()"!!!
+ // Attention: "setFinalSlash()" is necessary for calling "smartRel2Abs()"!!!
// Otherwhise last part will be ignored and wrong result will be returned!!!
// "smartRel2Abs()" interpret given URL as file not as path. So he truncate last element to get the base path ...
// But if we add a seperator - he doesn't do it anymore.
@@ -3208,7 +3178,8 @@ void Desktop::OpenSplashScreen()
!pCmdLine->IsNoLogo() &&
!pCmdLine->IsTerminateAfterInit() &&
!pCmdLine->GetPrintList( aTmpString ) &&
- !pCmdLine->GetPrintToList( aTmpString ) )
+ !pCmdLine->GetPrintToList( aTmpString ) &&
+ !pCmdLine->GetConversionList( aTmpString ))
{
// Determine application name from command line parameters
OUString aAppName;
@@ -3229,17 +3200,21 @@ void Desktop::OpenSplashScreen()
else if ( pCmdLine->IsWeb() )
aAppName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "web" ));
+ // Which splash to use
+ OUString aSplashService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.SplashScreen" ));
+ if ( pCmdLine->GetStringParam( CommandLineArgs::CMD_STRINGPARAM_SPLASHPIPE ).getLength() )
+ aSplashService = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.office.PipeSplashScreen"));
+
bVisible = sal_True;
Sequence< Any > aSeq( 2 );
aSeq[0] <<= bVisible;
aSeq[1] <<= aAppName;
m_rSplashScreen = Reference<XStatusIndicator>(
comphelper::getProcessServiceFactory()->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.office.SplashScreen"),
- aSeq), UNO_QUERY);
+ aSplashService, aSeq), UNO_QUERY);
if(m_rSplashScreen.is())
- m_rSplashScreen->start(OUString::createFromAscii("SplashScreen"), 100);
+ m_rSplashScreen->start(OUString(RTL_CONSTASCII_USTRINGPARAM("SplashScreen")), 100);
}
}
@@ -3274,9 +3249,9 @@ void Desktop::DoFirstRunInitializations()
{
try
{
- Reference< XJobExecutor > xExecutor( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.task.JobExecutor" ) ), UNO_QUERY );
+ Reference< XJobExecutor > xExecutor( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.JobExecutor")) ), UNO_QUERY );
if( xExecutor.is() )
- xExecutor->trigger( ::rtl::OUString::createFromAscii("onFirstRunInitialization") );
+ xExecutor->trigger( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("onFirstRunInitialization")) );
}
catch(const ::com::sun::star::uno::Exception&)
{
@@ -3287,8 +3262,8 @@ void Desktop::DoFirstRunInitializations()
// ========================================================================
void Desktop::CheckFirstRun( )
{
- const ::rtl::OUString sCommonMiscNodeName = ::rtl::OUString::createFromAscii( "/org.openoffice.Office.Common/Misc" );
- const ::rtl::OUString sFirstRunNodeName = ::rtl::OUString::createFromAscii( "FirstRun" );
+ const ::rtl::OUString sCommonMiscNodeName(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Common/Misc"));
+ const ::rtl::OUString sFirstRunNodeName(RTL_CONSTASCII_USTRINGPARAM("FirstRun"));
// --------------------------------------------------------------------
// check if this is the first office start
@@ -3330,3 +3305,5 @@ void Desktop::CheckFirstRun( )
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx
index 6adc4b81dc54..a5a161181efa 100644..100755
--- a/desktop/source/app/appfirststart.cxx
+++ b/desktop/source/app/appfirststart.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,88 +49,6 @@ using namespace ::com::sun::star::beans;
static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) );
static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) );
-/* Path of the license. */
-OUString Desktop::GetLicensePath()
-{
- // license file name
- static const char *szLicensePath = "/share/readme";
-#if defined(WNT) || defined(OS2)
- static const char *szWNTLicenseName = "/license";
- static const char *szWNTLicenseExt = ".txt";
-#else
- static const char *szUNXLicenseName = "/LICENSE";
- static const char *szUNXLicenseExt = "";
-#endif
- static OUString aLicensePath;
-
- if (aLicensePath.getLength() > 0)
- return aLicensePath;
-
- OUString aBaseInstallPath(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR"));
- rtl::Bootstrap::expandMacros(aBaseInstallPath);
-
- // determine the filename of the license to show
- OUString aLangString;
- ::com::sun::star::lang::Locale aLocale;
- OString aMgrName = OString("dkt");
-
- AllSettings aSettings(Application::GetSettings());
- aLocale = aSettings.GetUILocale();
- ResMgr* pLocalResMgr = ResMgr::SearchCreateResMgr(aMgrName, aLocale);
-
- aLangString = aLocale.Language;
- if ( aLocale.Country.getLength() != 0 )
- {
- aLangString += OUString::createFromAscii("-");
- aLangString += aLocale.Country;
- if ( aLocale.Variant.getLength() != 0 )
- {
- aLangString += OUString::createFromAscii("-");
- aLangString += aLocale.Variant;
- }
- }
-#if defined(WNT) || defined(OS2)
- aLicensePath =
- aBaseInstallPath + OUString::createFromAscii(szLicensePath)
- + OUString::createFromAscii(szWNTLicenseName)
- + OUString::createFromAscii("_")
- + aLangString
- + OUString::createFromAscii(szWNTLicenseExt);
-#else
- aLicensePath =
- aBaseInstallPath + OUString::createFromAscii(szLicensePath)
- + OUString::createFromAscii(szUNXLicenseName)
- + OUString::createFromAscii("_")
- + aLangString
- + OUString::createFromAscii(szUNXLicenseExt);
-#endif
- delete pLocalResMgr;
- return aLicensePath;
-}
-
-/* Check if we need to accept license. */
-sal_Bool Desktop::LicenseNeedsAcceptance()
-{
- // Don't show a license
- return sal_False;
-/*
- sal_Bool bShowLicense = sal_True;
- sal_Int32 nOpenSourceContext = 0;
- try
- {
- ::utl::ConfigManager::GetDirectConfigProperty(
- ::utl::ConfigManager::OPENSOURCECONTEXT ) >>= nOpenSourceContext;
- }
- catch( const ::com::sun::star::uno::Exception& ) {}
-
- // open source needs no license
- if ( nOpenSourceContext > 0 )
- bShowLicense = sal_False;
-
- return bShowLicense;
-*/
-}
-
/* Local function - get access to the configuration */
static Reference< XPropertySet > impl_getConfigurationAccess( const OUString& rPath )
{
@@ -146,128 +65,6 @@ static Reference< XPropertySet > impl_getConfigurationAccess( const OUString& rP
xConfigProvider->createInstanceWithArguments( sAccessSrvc, aArgs ), UNO_QUERY_THROW );
}
-/* Local function - was the wizard completed already? */
-static sal_Bool impl_isFirstStart()
-{
- try {
- Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
-
- Any result = xPSet->getPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted"));
- sal_Bool bCompleted = sal_False;
- if ((result >>= bCompleted) && bCompleted)
- return sal_False; // wizard was already completed
- else
- return sal_True;
- } catch (const Exception&)
- {
- return sal_True;
- }
-}
-
-/* Local function - convert oslDateTime to tools DateTime */
-static DateTime impl_oslDateTimeToDateTime(const oslDateTime& aDateTime)
-{
- return DateTime(
- Date(aDateTime.Day, aDateTime.Month, aDateTime.Year),
- Time(aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds));
-}
-
-/* Local function - get DateTime from a string */
-static sal_Bool impl_parseDateTime(const OUString& aString, DateTime& aDateTime)
-{
- // take apart a canonical literal xsd:dateTime string
- //CCYY-MM-DDThh:mm:ss(Z)
-
- OUString aDateTimeString = aString.trim();
-
- // check length
- if (aDateTimeString.getLength() < 19 || aDateTimeString.getLength() > 20)
- return sal_False;
-
- sal_Int32 nDateLength = 10;
- sal_Int32 nTimeLength = 8;
-
- OUString aDateTimeSep = OUString::createFromAscii("T");
- OUString aDateSep = OUString::createFromAscii("-");
- OUString aTimeSep = OUString::createFromAscii(":");
- OUString aUTCString = OUString::createFromAscii("Z");
-
- OUString aDateString = aDateTimeString.copy(0, nDateLength);
- OUString aTimeString = aDateTimeString.copy(nDateLength+1, nTimeLength);
-
- sal_Int32 nIndex = 0;
- sal_Int32 nYear = aDateString.getToken(0, '-', nIndex).toInt32();
- sal_Int32 nMonth = aDateString.getToken(0, '-', nIndex).toInt32();
- sal_Int32 nDay = aDateString.getToken(0, '-', nIndex).toInt32();
- nIndex = 0;
- sal_Int32 nHour = aTimeString.getToken(0, ':', nIndex).toInt32();
- sal_Int32 nMinute = aTimeString.getToken(0, ':', nIndex).toInt32();
- sal_Int32 nSecond = aTimeString.getToken(0, ':', nIndex).toInt32();
-
- Date tmpDate((sal_uInt16)nDay, (sal_uInt16)nMonth, (sal_uInt16)nYear);
- Time tmpTime(nHour, nMinute, nSecond);
- DateTime tmpDateTime(tmpDate, tmpTime);
- if (aString.indexOf(aUTCString) < 0)
- tmpDateTime.ConvertToUTC();
-
- aDateTime = tmpDateTime;
- return sal_True;
-}
-
-/* Local function - was the license accepted already? */
-static sal_Bool impl_isLicenseAccepted()
-{
- // If no license will be shown ... it must not be accepted.
- // So it was accepted "hardly" by the outside installer.
- // But if the configuration entry "HideEula" will be removed afterwards ..
- // we have to show the licese page again and user has to accept it here .-)
- if ( ! Desktop::LicenseNeedsAcceptance() )
- return sal_True;
-
- try
- {
- Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
-
- Any result = xPSet->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate"));
-
- OUString aAcceptDate;
- if (result >>= aAcceptDate)
- {
- // compare to date of license file
- OUString aLicenseURL = Desktop::GetLicensePath();
- osl::DirectoryItem aDirItem;
- if (osl::DirectoryItem::get(aLicenseURL, aDirItem) != osl::FileBase::E_None)
- return sal_False;
- osl::FileStatus aStatus(FileStatusMask_All);
- if (aDirItem.getFileStatus(aStatus) != osl::FileBase::E_None)
- return sal_False;
- TimeValue aTimeVal = aStatus.getModifyTime();
- oslDateTime aDateTimeVal;
- if (!osl_getDateTimeFromTimeValue(&aTimeVal, &aDateTimeVal))
- return sal_False;
-
- // compare dates
- DateTime aLicenseDateTime = impl_oslDateTimeToDateTime(aDateTimeVal);
- DateTime aAcceptDateTime;
- if (!impl_parseDateTime(aAcceptDate, aAcceptDateTime))
- return sal_False;
-
- if ( aAcceptDateTime > aLicenseDateTime )
- return sal_True;
- }
- return sal_False;
- } catch (const Exception&)
- {
- return sal_False;
- }
-}
-
-/* Check if we need the first start wizard. */
-sal_Bool Desktop::IsFirstStartWizardNeeded()
-{
- return impl_isFirstStart() || !impl_isLicenseAccepted();
-}
-
void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart )
{
if ( bQuickStart )
@@ -284,9 +81,9 @@ void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart )
xPSet->setPropertyValue( sPropName, makeAny( sal_False ) );
Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges();
- Sequence< Any > aSeq( 2 );
- aSeq[0] <<= sal_True;
- aSeq[1] <<= sal_True;
+ Sequence< Any > aSeq( 1 );
+ sal_Bool bQuickstart = shouldLaunchQuickstart();
+ aSeq[0] <<= bQuickstart;
Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Quickstart" ) ) ),UNO_QUERY_THROW );
@@ -316,3 +113,4 @@ void Desktop::SetRestartState()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 97eb3f555f60..973a88357f46 100644..100755
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,7 @@
#include <cppuhelper/bootstrap.hxx>
#include <osl/file.hxx>
#include <osl/module.h>
-#include <vos/process.hxx>
+#include <osl/security.hxx>
#include <rtl/uri.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/bootstrap.hxx>
@@ -81,8 +82,6 @@
#define DESKTOP_TEMPDIRNAME "soffice.tmp"
-using namespace rtl;
-using namespace vos;
using namespace desktop;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -90,6 +89,8 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::registry;
using namespace ::com::sun::star::ucb;
+using ::rtl::OUString;
+
namespace desktop
{
@@ -102,12 +103,12 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect)
xServiceFactory( comphelper::getProcessServiceFactory() );
if (!xServiceFactory.is())
{
- DBG_ERROR("configureUcb(): No XMultiServiceFactory");
+ OSL_FAIL("configureUcb(): No XMultiServiceFactory");
return false;
}
rtl::OUString aPipe;
- vos::OSecurity().getUserIdent(aPipe);
+ osl::Security().getUserIdent(aPipe);
rtl::OUStringBuffer aPortal;
if (rPortalConnect.getLength() != 0)
@@ -118,14 +119,13 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect)
Sequence< Any > aArgs(6);
aArgs[0]
- <<= rtl::OUString::createFromAscii(bServer ?
- UCB_CONFIGURATION_KEY1_SERVER :
- UCB_CONFIGURATION_KEY1_LOCAL);
+ <<= bServer ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UCB_CONFIGURATION_KEY1_SERVER)) :
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UCB_CONFIGURATION_KEY1_LOCAL));
aArgs[1]
- <<= rtl::OUString::createFromAscii(UCB_CONFIGURATION_KEY2_OFFICE);
- aArgs[2] <<= rtl::OUString::createFromAscii("PIPE");
+ <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UCB_CONFIGURATION_KEY2_OFFICE));
+ aArgs[2] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PIPE"));
aArgs[3] <<= aPipe;
- aArgs[4] <<= rtl::OUString::createFromAscii("PORTAL");
+ aArgs[4] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PORTAL"));
aArgs[5] <<= aPortal.makeStringAndClear();
bool ret =
@@ -146,32 +146,11 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect)
);
rtl::OUString aDesktopEnvironment;
if ((aValue >>= aDesktopEnvironment)
- && aDesktopEnvironment.equalsAscii("GNOME"))
+ && aDesktopEnvironment.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("GNOME")))
{
Reference<XContentProviderManager> xCPM =
cb->getContentProviderManagerInterface();
-#if 0
- try
- {
- Reference<XContentProviderFactory> xCPF(
- xServiceFactory->createInstance(
- rtl::OUString::createFromAscii(
- "com.sun.star.ucb.ContentProviderProxyFactory")),
- UNO_QUERY);
- if(xCPF.is())
- xCPM->registerContentProvider(
- xCPF->createContentProvider(
- rtl::OUString::createFromAscii(
- "com.sun.star.ucb.GnomeVFSContentProvider"
- )
- ),
- rtl::OUString::createFromAscii(".*"),
- false);
- } catch (...)
- {
- }
-#else
// Workaround for P1 #124597#. Instanciate GNOME-VFS-UCP in the thread that initialized
// GNOME in order to avoid a deadlock that may occure in case UCP gets initialized from
@@ -182,21 +161,20 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect)
{
Reference<XContentProvider> xCP(
xServiceFactory->createInstance(
- rtl::OUString::createFromAscii(
- "com.sun.star.ucb.GnomeVFSContentProvider")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ucb.GnomeVFSContentProvider"))),
UNO_QUERY);
if(xCP.is())
xCPM->registerContentProvider(
xCP,
- rtl::OUString::createFromAscii(".*"),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*")),
false);
} catch (...)
{
}
}
-#endif
}
- } catch (RuntimeException e) {
+ } catch (RuntimeException &e) {
}
}
#endif // GNOME_VFS_ENABLED
@@ -299,8 +277,8 @@ void Desktop::RegisterServices( Reference< XMultiServiceFactory >& xSMgr )
pCmdLine->GetPortalConnectString( aPortalConnect );
if ( !configureUcb( bServer, aPortalConnect ) )
{
- DBG_ERROR( "Can't configure UCB" );
- throw com::sun::star::uno::Exception(rtl::OUString::createFromAscii("RegisterServices, configureUcb"), NULL);
+ OSL_FAIL( "Can't configure UCB" );
+ throw com::sun::star::uno::Exception(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RegisterServices, configureUcb")), NULL);
}
CreateTemporaryDirectory();
@@ -328,7 +306,7 @@ void Desktop::createAcceptor(const OUString& aAcceptString)
aSeq[1] <<= bAccept;
Reference<XInitialization> rAcceptor(
::comphelper::getProcessServiceFactory()->createInstance(
- OUString::createFromAscii( "com.sun.star.office.Acceptor" )), UNO_QUERY );
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Acceptor" ))), UNO_QUERY );
if ( rAcceptor.is() ) {
try{
rAcceptor->initialize( aSeq );
@@ -482,3 +460,5 @@ void Desktop::RemoveTemporaryDirectory()
}
} // namespace desktop
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/appinit.hxx b/desktop/source/app/appinit.hxx
index c5b48fd4a488..b4a756aa31ee 100644..100755
--- a/desktop/source/app/appinit.hxx
+++ b/desktop/source/app/appinit.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@ void removeTemporaryDirectory();
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/appsys.cxx b/desktop/source/app/appsys.cxx
index 4cff81e3bb54..287a9464793e 100644..100755
--- a/desktop/source/app/appsys.cxx
+++ b/desktop/source/app/appsys.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,8 @@
#include <rtl/ustring.hxx>
#include <tools/solar.h>
-#include <tools/prewin.h>
-#include <winreg.h>
-#include <tools/postwin.h>
+#include <prewin.h>
+#include <postwin.h>
#include <tools/urlobj.hxx>
@@ -54,7 +54,7 @@ void FATToVFat_Impl( String& aName )
HANDLE h = FindFirstFile( U2S(aName).getStr(), &aData );
if ( h )
{
- // FAT-Kurzname in VFAT-Langname wandeln
+ // Change FAT short filename into VFAT long filename
aObj.removeSegment();
aObj.insertName( String::CreateFromAscii( aData.cFileName ) );
aName = aObj.PathToFileName();
@@ -67,3 +67,4 @@ void FATToVFat_Impl( String& aName )
#endif // WNT
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/appsys.hxx b/desktop/source/app/appsys.hxx
index 5d1b06c1bbe7..d2f13ff0aace 100644..100755
--- a/desktop/source/app/appsys.hxx
+++ b/desktop/source/app/appsys.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,3 +41,5 @@ void FATToVFat_Impl( String& aName );
}
#endif // _DESKTOP_APPSYS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx
index 664e63c7f6ca..20bad6f4504a 100755
--- a/desktop/source/app/check_ext_deps.cxx
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -333,15 +334,15 @@ static void impl_setNeedsCompatCheck()
xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
Sequence< Any > theArgs(1);
- beans::NamedValue v( OUString::createFromAscii("NodePath"),
- makeAny( OUString::createFromAscii("org.openoffice.Setup/Office") ) );
+ beans::NamedValue v( OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath")),
+ makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup/Office")) ) );
theArgs[0] <<= v;
Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >(
theConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY_THROW );
- Any value = makeAny( OUString::createFromAscii("never") );
+ Any value = makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("never")) );
- pset->setPropertyValue( OUString::createFromAscii("LastCompatibilityCheckID"), value );
+ pset->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LastCompatibilityCheckID")), value );
Reference< util::XChangesBatch >( pset, UNO_QUERY_THROW )->commitChanges();
}
catch (const Exception&) {}
@@ -386,20 +387,20 @@ static bool impl_needsCompatCheck()
xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
Sequence< Any > theArgs(1);
- beans::NamedValue v( OUString::createFromAscii("NodePath"),
- makeAny( OUString::createFromAscii("org.openoffice.Setup/Office") ) );
+ beans::NamedValue v( OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath")),
+ makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup/Office")) ) );
theArgs[0] <<= v;
Reference< beans::XPropertySet > pset = Reference< beans::XPropertySet >(
theConfigProvider->createInstanceWithArguments( sAccessSrvc, theArgs ), UNO_QUERY_THROW );
- Any result = pset->getPropertyValue( OUString::createFromAscii("LastCompatibilityCheckID") );
+ Any result = pset->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LastCompatibilityCheckID")) );
result >>= aLastCheckBuildID;
if ( aLastCheckBuildID != aCurrentBuildID )
{
bNeedsCheck = true;
result <<= aCurrentBuildID;
- pset->setPropertyValue( OUString::createFromAscii("LastCompatibilityCheckID"), result );
+ pset->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LastCompatibilityCheckID")), result );
Reference< util::XChangesBatch >( pset, UNO_QUERY_THROW )->commitChanges();
}
#ifdef DEBUG
@@ -429,3 +430,5 @@ void Desktop::SynchronizeExtensionRepositories()
RTL_LOGFILE_CONTEXT(aLog,"desktop (jl) ::Desktop::SynchronizeExtensionRepositories");
dp_misc::syncRepositories( new SilentCommandEnv( this ) );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/checkinstall.cxx b/desktop/source/app/checkinstall.cxx
index bb7258554cfe..c0e853d9eef5 100644..100755
--- a/desktop/source/app/checkinstall.cxx
+++ b/desktop/source/app/checkinstall.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,11 +39,12 @@
#include <vcl/msgbox.hxx>
#include <tools/date.hxx>
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
+using ::rtl::OUString;
+
namespace desktop
{
@@ -116,3 +118,5 @@ sal_Bool CheckInstallation( OUString& rTitle )
}
} // namespace desktop
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/checkinstall.hxx b/desktop/source/app/checkinstall.hxx
index 495ea3161bd3..a4ee8c05c9ef 100644..100755
--- a/desktop/source/app/checkinstall.hxx
+++ b/desktop/source/app/checkinstall.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,3 +41,5 @@ sal_Bool CheckInstallation( rtl::OUString& rTitle );
}
#endif // _DESKTOP_CHECKINSTALL_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 14b4fd1d6ddc..998f414c6887 100644..100755
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,11 +41,14 @@
#include <svl/documentlockfile.hxx>
-using namespace rtl;
+#include <cstdio>
+
using namespace com::sun::star::lang;
using namespace com::sun::star::uri;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
namespace desktop
{
@@ -57,7 +61,7 @@ public:
m_index(0)
{
rtl::OUString url;
- if (tools::getProcessWorkingDir(&url)) {
+ if (tools::getProcessWorkingDir(url)) {
m_cwdUrl.reset(url);
}
}
@@ -137,8 +141,8 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
Reference< XExternalUriReferenceTranslator > xTranslator(
xMS->createInstance(
- OUString::createFromAscii(
- "com.sun.star.uri.ExternalUriReferenceTranslator")),
+ OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.uri.ExternalUriReferenceTranslator"))),
UNO_QUERY);
// parse command line arguments
@@ -152,6 +156,11 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bool bForceNewEvent(false);
bool bDisplaySpec(false);
bool bOpenDoc(false);
+ bool bConversionEvent(false);
+ bool bConversionParamsEvent(false);
+ bool bBatchPrintEvent(false);
+ bool bBatchPrinterNameEvent(false);
+ bool bConversionOutEvent(false);
m_eArgumentCount = NONE;
@@ -163,7 +172,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
break;
}
// convert file URLs to internal form #112849#
- if (aArg.indexOf(OUString::createFromAscii("file:"))==0 &&
+ if (aArg.indexOfAsciiL(RTL_CONSTASCII_STRINGPARAM("file:"))==0 &&
xTranslator.is())
{
OUString tmp(xTranslator->translateToInternal(aArg));
@@ -171,16 +180,16 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
aArg = tmp;
}
- String aArgStr = aArg;
if ( aArg.getLength() > 0 )
{
m_eArgumentCount = m_eArgumentCount == NONE ? ONE : MANY;
- if ( !InterpretCommandLineParameter( aArg ))
+ ::rtl::OUString oArg;
+ if ( !InterpretCommandLineParameter( aArg, oArg ))
{
- if ( aArgStr.GetChar(0) == '-' )
+ if ( aArg.toChar() == '-' )
{
// handle this argument as an option
- if ( aArgStr.EqualsIgnoreCaseAscii( "-n" ))
+ if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("-n")))
{
// force new documents based on the following documents
bForceNewEvent = true;
@@ -192,7 +201,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false;
bDisplaySpec = false;
}
- else if ( aArgStr.EqualsIgnoreCaseAscii( "-o" ))
+ else if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( "-o" )))
{
// force open documents regardless if they are templates or not
bForceOpenEvent = true;
@@ -204,7 +213,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false;
bDisplaySpec = false;
}
- else if ( aArgStr.EqualsIgnoreCaseAscii( "-pt" ))
+ else if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( "-pt" )))
{
// Print to special printer
bPrintToEvent = true;
@@ -217,7 +226,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bDisplaySpec = false;
bForceOpenEvent = false;
}
- else if ( aArgStr.EqualsIgnoreCaseAscii( "-p" ))
+ else if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( "-p" )))
{
// Print to default printer
bPrintEvent = true;
@@ -229,7 +238,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false;
bDisplaySpec = false;
}
- else if ( aArgStr.EqualsIgnoreCaseAscii( "-view" ))
+ else if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( "-view" )))
{
// open in viewmode
bOpenEvent = false;
@@ -240,9 +249,9 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bViewEvent = true;
bStartEvent = false;
bDisplaySpec = false;
- }
- else if ( aArgStr.EqualsIgnoreCaseAscii( "-show" ))
- {
+ }
+ else if ( aArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( "-show" )))
+ {
// open in viewmode
bOpenEvent = false;
bViewEvent = false;
@@ -253,7 +262,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bForceOpenEvent = false;
bDisplaySpec = false;
}
- else if ( aArgStr.EqualsIgnoreCaseAscii( "-display" ))
+ else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("display")))
{
// set display
bOpenEvent = false;
@@ -265,7 +274,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false;
bDisplaySpec = true;
}
- else if ( aArgStr.EqualsIgnoreCaseAscii( "-language" ))
+ else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("language")))
{
bOpenEvent = false;
bPrintEvent = false;
@@ -276,79 +285,108 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false;
bDisplaySpec = false;
}
-
- #ifdef MACOSX
- /* #i84053# ignore -psn on Mac
- Platform dependent #ifdef here is ugly, however this is currently
- the only platform dependent parameter. Should more appear
- we should find a better solution
- */
- else if ( aArgStr.CompareToAscii( "-psn", 4 ) == COMPARE_EQUAL )
+ else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("convert-to")))
{
- // finder argument from MacOSX
- bOpenEvent = false;
- bPrintEvent = false;
- bForceOpenEvent = false;
- bPrintToEvent = false;
- bForceNewEvent = false;
- bViewEvent = false;
- bStartEvent = false;
- bDisplaySpec = false;
+ bOpenEvent = false;
+ bConversionEvent = true;
+ bConversionParamsEvent = true;
+ }
+ else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("print-to-file")))
+ {
+ bOpenEvent = false;
+ bBatchPrintEvent = true;
+ }
+ else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("printer-name")) &&
+ bBatchPrintEvent )
+ {
+ bBatchPrinterNameEvent = true;
+ }
+ else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("outdir")) &&
+ (bConversionEvent || bBatchPrintEvent) )
+ {
+ bConversionOutEvent = true;
}
- #endif
}
else
{
if ( bPrinterName && bPrintToEvent )
{
// first argument after "-pt" this must be the printer name
- AddStringListParam_Impl( CMD_STRINGPARAM_PRINTERNAME, aArgStr );
- bPrinterName = sal_False;
+ AddStringListParam_Impl( CMD_STRINGPARAM_PRINTERNAME, aArg );
+ bPrinterName = false;
+ }
+ else if ( bConversionParamsEvent && bConversionEvent )
+ {
+ // first argument must be the the params
+ AddStringListParam_Impl( CMD_STRINGPARAM_CONVERSIONPARAMS, aArg );
+ bConversionParamsEvent = false;
+ }
+ else if ( bBatchPrinterNameEvent && bBatchPrintEvent )
+ {
+ // first argument is the printer name
+ AddStringListParam_Impl( CMD_STRINGPARAM_PRINTERNAME, aArg );
+ bBatchPrinterNameEvent = false;
+ }
+ else if ( (bConversionEvent || bBatchPrintEvent) && bConversionOutEvent )
+ {
+ AddStringListParam_Impl( CMD_STRINGPARAM_CONVERSIONOUT, aArg );
+ bConversionOutEvent = false;
}
else
{
+ if( bOpenEvent || bViewEvent || bForceNewEvent || bForceOpenEvent )
+ {
+ if( aArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("::ODMA")) )
+ {
+ ::rtl::OUString sArg(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.odma:/"));
+ sArg += aArg;
+ aArg = sArg;
+ }
+ }
// handle this argument as a filename
if ( bOpenEvent )
{
- AddStringListParam_Impl( CMD_STRINGPARAM_OPENLIST, aArgStr );
+ AddStringListParam_Impl( CMD_STRINGPARAM_OPENLIST, aArg );
bOpenDoc = true;
}
else if ( bViewEvent )
- {
- AddStringListParam_Impl( CMD_STRINGPARAM_VIEWLIST, aArgStr );
+ {
+ AddStringListParam_Impl( CMD_STRINGPARAM_VIEWLIST, aArg );
bOpenDoc = true;
}
else if ( bStartEvent )
{
- AddStringListParam_Impl( CMD_STRINGPARAM_STARTLIST, aArgStr );
+ AddStringListParam_Impl( CMD_STRINGPARAM_STARTLIST, aArg );
bOpenDoc = true;
}
else if ( bPrintEvent )
{
- AddStringListParam_Impl( CMD_STRINGPARAM_PRINTLIST, aArgStr );
+ AddStringListParam_Impl( CMD_STRINGPARAM_PRINTLIST, aArg );
bOpenDoc = true;
}
else if ( bPrintToEvent )
{
- AddStringListParam_Impl( CMD_STRINGPARAM_PRINTTOLIST, aArgStr );
+ AddStringListParam_Impl( CMD_STRINGPARAM_PRINTTOLIST, aArg );
bOpenDoc = true;
}
else if ( bForceNewEvent )
{
- AddStringListParam_Impl( CMD_STRINGPARAM_FORCENEWLIST, aArgStr );
+ AddStringListParam_Impl( CMD_STRINGPARAM_FORCENEWLIST, aArg );
bOpenDoc = true;
}
else if ( bForceOpenEvent )
{
- AddStringListParam_Impl( CMD_STRINGPARAM_FORCEOPENLIST, aArgStr );
+ AddStringListParam_Impl( CMD_STRINGPARAM_FORCEOPENLIST, aArg );
bOpenDoc = true;
}
else if ( bDisplaySpec )
{
- AddStringListParam_Impl( CMD_STRINGPARAM_DISPLAY, aArgStr );
+ AddStringListParam_Impl( CMD_STRINGPARAM_DISPLAY, aArg );
bDisplaySpec = false; // only one display, not a lsit
bOpenEvent = true; // set back to standard
}
+ else if ( bConversionEvent || bBatchPrintEvent )
+ AddStringListParam_Impl( CMD_STRINGPARAM_CONVERSIONLIST, aArg );
}
}
}
@@ -374,250 +412,245 @@ void CommandLineArgs::SetBoolParam_Impl( BoolParam eParam, sal_Bool bValue )
m_aBoolParams[eParam] = bValue;
}
-sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& aArg )
+sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& aArg, ::rtl::OUString& oArg )
{
- String aArgStr( aArg );
+ bool bDeprecated = false;
+ if (aArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("--")))
+ {
+ oArg = ::rtl::OUString(aArg.getStr()+2, aArg.getLength()-2);
+ }
+ else if (aArg.toChar() == '-')
+ {
+ bDeprecated = true;
+ oArg = ::rtl::OUString(aArg.getStr()+1, aArg.getLength()-1);
+ }
+ else
+ {
+ return sal_False;
+ }
- if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-minimized" )) == sal_True )
+ if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "minimized" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_MINIMIZED, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-invisible" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "invisible" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_INVISIBLE, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-norestore" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "norestore" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_NORESTORE, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-nodefault" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "nodefault" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_NODEFAULT, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-bean" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "bean" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_BEAN, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-plugin" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "plugin" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_PLUGIN, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-server" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "server" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_SERVER, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-headless" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "headless" )) == sal_True )
{
// Headless means also invisibile, so set this parameter to true!
SetBoolParam_Impl( CMD_BOOLPARAM_HEADLESS, sal_True );
SetBoolParam_Impl( CMD_BOOLPARAM_INVISIBLE, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "quickstart" )) == sal_True )
{
-#if defined(WNT) || defined(OS2) || defined(QUARTZ)
+#if defined(ENABLE_QUICKSTART_APPLET)
SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
#endif
SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_False );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart=no" )))
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "quickstart=no" )))
{
SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_True );
SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_False );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-terminate_after_init" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "terminate_after_init" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_TERMINATEAFTERINIT, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-nofirststartwizard" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "nofirststartwizard" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_NOFIRSTSTARTWIZARD, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-nologo" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "nologo" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_NOLOGO, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-nolockcheck" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "nolockcheck" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_NOLOCKCHECK, sal_True );
// Workaround for automated testing
::svt::DocumentLockFile::AllowInteraction( sal_False );
-
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-help" ))
- || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" ))
- || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-?" )))
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "help" ))
+ || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" ))
+ || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-?" )))
{
SetBoolParam_Impl( CMD_BOOLPARAM_HELP, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpwriter" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpwriter" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_HELPWRITER, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpcalc" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpcalc" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_HELPCALC, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpdraw" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpdraw" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_HELPDRAW, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpimpress" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpimpress" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_HELPIMPRESS, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpbase" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpbase" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_HELPBASE, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpbasic" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpbasic" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_HELPBASIC, sal_True );
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpmath" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "helpmath" )) == sal_True )
{
SetBoolParam_Impl( CMD_BOOLPARAM_HELPMATH, sal_True );
- return sal_True;
+ }
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "version" )) == sal_True )
+ {
+ SetBoolParam_Impl( CMD_BOOLPARAM_VERSION, sal_True );
+ }
+ else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("splash-pipe=")) )
+ {
+ AddStringListParam_Impl( CMD_STRINGPARAM_SPLASHPIPE, oArg.copy(RTL_CONSTASCII_LENGTH("splash-pipe=")) );
}
#ifdef MACOSX
- /* #i84053# ignore -psn on Mac
- Platform dependent #ifdef here is ugly, however this is currently
- the only platform dependent parameter. Should more appear
- we should find a better solution
- */
- else if ( aArg.compareToAscii( "-psn", 4 ) == 0 )
+ /* #i84053# ignore -psn on Mac
+ Platform dependent #ifdef here is ugly, however this is currently
+ the only platform dependent parameter. Should more appear
+ we should find a better solution
+ */
+ else if ( aArg.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("-psn")) )
{
SetBoolParam_Impl( CMD_BOOLPARAM_PSN, sal_True );
return sal_True;
}
#endif
- else if ( aArgStr.Copy(0, 8).EqualsIgnoreCaseAscii( "-accept=" ))
+ else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("infilter=")))
{
- AddStringListParam_Impl( CMD_STRINGPARAM_ACCEPT, aArgStr.Copy( 8 ) );
- return sal_True;
+ AddStringListParam_Impl( CMD_STRINGPARAM_INFILTER, oArg.copy(RTL_CONSTASCII_LENGTH("infilter=")) );
}
- else if ( aArgStr.Copy(0, 10).EqualsIgnoreCaseAscii( "-unaccept=" ))
+ else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("accept=")))
{
- AddStringListParam_Impl( CMD_STRINGPARAM_UNACCEPT, aArgStr.Copy( 10 ) );
- return sal_True;
+ AddStringListParam_Impl( CMD_STRINGPARAM_ACCEPT, oArg.copy(RTL_CONSTASCII_LENGTH("accept=")) );
}
- else if ( aArgStr.CompareIgnoreCaseToAscii( "-portal," ,
- RTL_CONSTASCII_LENGTH( "-portal," )) == COMPARE_EQUAL )
+ else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("unaccept=")))
{
- AddStringListParam_Impl( CMD_STRINGPARAM_PORTAL, aArgStr.Copy( RTL_CONSTASCII_LENGTH( "-portal," )) );
- return sal_True;
+ AddStringListParam_Impl( CMD_STRINGPARAM_UNACCEPT, oArg.copy(RTL_CONSTASCII_LENGTH("unaccept=")) );
}
- else if ( aArgStr.Copy( 0, 7 ).EqualsIgnoreCaseAscii( "-userid" ))
+ else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("portal,")))
{
- if ( aArgStr.Len() > 8 )
+ AddStringListParam_Impl( CMD_STRINGPARAM_PORTAL, oArg.copy(RTL_CONSTASCII_LENGTH("portal,")) );
+ }
+ else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("userid")))
{
- rtl::OUString aUserDir = aArgStr;
- AddStringListParam_Impl( CMD_STRINGPARAM_USERDIR,
- ::rtl::Uri::decode( aUserDir.copy( 8 ), rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ) );
+ if ( oArg.getLength() > RTL_CONSTASCII_LENGTH("userid")+1 )
+ {
+ AddStringListParam_Impl(
+ CMD_STRINGPARAM_USERDIR,
+ ::rtl::Uri::decode( oArg.copy(RTL_CONSTASCII_LENGTH("userid")+1),
+ rtl_UriDecodeWithCharset,
+ RTL_TEXTENCODING_UTF8 ) );
}
- return sal_True;
}
- else if ( aArgStr.Copy( 0, 15).EqualsIgnoreCaseAscii( "-clientdisplay=" ))
+ else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("clientdisplay=")))
{
- AddStringListParam_Impl( CMD_STRINGPARAM_CLIENTDISPLAY, aArgStr.Copy( 15 ) );
- return sal_True;
+ AddStringListParam_Impl( CMD_STRINGPARAM_CLIENTDISPLAY, oArg.copy(RTL_CONSTASCII_LENGTH("clientdisplay=")) );
}
- else if ( aArgStr.Copy(0, 9).EqualsIgnoreCaseAscii( "-version=" ))
+ else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("version=")))
{
- AddStringListParam_Impl( CMD_STRINGPARAM_VERSION, aArgStr.Copy( 9 ) );
- return sal_True;
+ AddStringListParam_Impl( CMD_STRINGPARAM_VERSION, oArg.copy(RTL_CONSTASCII_LENGTH("version=")) );
}
- else if ( aArgStr.Copy(0, 10).EqualsIgnoreCaseAscii( "-language=" ))
+ else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("language=")))
{
- AddStringListParam_Impl( CMD_STRINGPARAM_LANGUAGE, aArgStr.Copy( 10 ) );
- return sal_True;
+ AddStringListParam_Impl( CMD_STRINGPARAM_LANGUAGE, oArg.copy(RTL_CONSTASCII_LENGTH("language=")) );
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-writer" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "writer" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_WRITER );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_WRITER, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_WRITER, sal_True );
m_bDocumentArgs = true;
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-calc" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "calc" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_CALC );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_CALC, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_CALC, sal_True );
m_bDocumentArgs = true;
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-draw" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "draw" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_DRAW );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_DRAW, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_DRAW, sal_True );
m_bDocumentArgs = true;
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-impress" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "impress" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_IMPRESS );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_IMPRESS, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_IMPRESS, sal_True );
m_bDocumentArgs = true;
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-base" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "base" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_BASE );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_BASE, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_BASE, sal_True );
m_bDocumentArgs = true;
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-global" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "global" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_GLOBAL );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_GLOBAL, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_GLOBAL, sal_True );
m_bDocumentArgs = true;
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-math" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "math" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_MATH );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_MATH, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_MATH, sal_True );
m_bDocumentArgs = true;
- return sal_True;
}
- else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-web" )) == sal_True )
+ else if ( oArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "web" )) == sal_True )
{
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_WEB );
if ( !bAlreadySet )
- SetBoolParam_Impl( CMD_BOOLPARAM_WEB, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_WEB, sal_True );
m_bDocumentArgs = true;
- return sal_True;
}
+ else
+ return sal_False;
- return sal_False;
+ if (bDeprecated)
+ {
+ rtl::OString sArg(rtl::OUStringToOString(aArg, RTL_TEXTENCODING_UTF8));
+ fprintf(stderr, "Warning: %s is deprecated. Use -%s instead.\n", sArg.getStr(), sArg.getStr());
+ }
+ return sal_True;
}
sal_Bool CommandLineArgs::CheckGroupMembers( GroupParamId nGroupId, BoolParam nExcludeMember ) const
@@ -652,6 +685,14 @@ void CommandLineArgs::SetBoolParam( BoolParam eParam, sal_Bool bNewValue )
m_aBoolParams[eParam] = bNewValue;
}
+const rtl::OUString& CommandLineArgs::GetStringParam( StringParam eParam ) const
+{
+ osl::MutexGuard aMutexGuard( m_aMutex );
+
+ OSL_ASSERT( ( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT ) );
+ return m_aStrParams[eParam];
+}
+
sal_Bool CommandLineArgs::IsMinimized() const
{
osl::MutexGuard aMutexGuard( m_aMutex );
@@ -712,12 +753,6 @@ sal_Bool CommandLineArgs::IsTerminateAfterInit() const
return m_aBoolParams[ CMD_BOOLPARAM_TERMINATEAFTERINIT ];
}
-sal_Bool CommandLineArgs::IsNoFirstStartWizard() const
-{
- osl::MutexGuard aMutexGuard( m_aMutex );
- return m_aBoolParams[ CMD_BOOLPARAM_NOFIRSTSTARTWIZARD ];
-}
-
sal_Bool CommandLineArgs::IsNoLogo() const
{
osl::MutexGuard aMutexGuard( m_aMutex );
@@ -823,6 +858,12 @@ sal_Bool CommandLineArgs::IsWeb() const
return m_aBoolParams[ CMD_BOOLPARAM_WEB ];
}
+sal_Bool CommandLineArgs::IsVersion() const
+{
+ osl::MutexGuard aMutexGuard( m_aMutex );
+ return m_aBoolParams[ CMD_BOOLPARAM_VERSION ];
+}
+
sal_Bool CommandLineArgs::HasModuleParam() const
{
osl::MutexGuard aMutexGuard( m_aMutex );
@@ -913,6 +954,33 @@ sal_Bool CommandLineArgs::GetLanguage( ::rtl::OUString& rPara ) const
return m_aStrSetParams[ CMD_STRINGPARAM_LANGUAGE ];
}
+sal_Bool CommandLineArgs::GetInFilter( ::rtl::OUString& rPara ) const
+{
+ osl::MutexGuard aMutexGuard( m_aMutex );
+ rPara = m_aStrParams[ CMD_STRINGPARAM_INFILTER ];
+ return m_aStrSetParams[ CMD_STRINGPARAM_INFILTER ];
+}
+
+sal_Bool CommandLineArgs::GetConversionList( ::rtl::OUString& rPara ) const
+{
+ osl::MutexGuard aMutexGuard( m_aMutex );
+ rPara = m_aStrParams[ CMD_STRINGPARAM_CONVERSIONLIST ];
+ return m_aStrSetParams[ CMD_STRINGPARAM_CONVERSIONLIST ];
+}
+
+sal_Bool CommandLineArgs::GetConversionParams( ::rtl::OUString& rPara ) const
+{
+ osl::MutexGuard aMutexGuard( m_aMutex );
+ rPara = m_aStrParams[ CMD_STRINGPARAM_CONVERSIONPARAMS ];
+ return m_aStrSetParams[ CMD_STRINGPARAM_CONVERSIONPARAMS ];
+}
+sal_Bool CommandLineArgs::GetConversionOut( ::rtl::OUString& rPara ) const
+{
+ osl::MutexGuard aMutexGuard( m_aMutex );
+ rPara = m_aStrParams[ CMD_STRINGPARAM_CONVERSIONOUT ];
+ return m_aStrSetParams[ CMD_STRINGPARAM_CONVERSIONOUT ];
+}
+
sal_Bool CommandLineArgs::IsEmpty() const
{
osl::MutexGuard aMutexGuard( m_aMutex );
@@ -924,6 +992,7 @@ sal_Bool CommandLineArgs::IsEmptyOrAcceptOnly() const
osl::MutexGuard aMutexGuard( m_aMutex );
return m_eArgumentCount == NONE ||
+ ( ( m_eArgumentCount == ONE ) && ( m_aStrParams[ CMD_STRINGPARAM_SPLASHPIPE ].getLength() )) ||
( ( m_eArgumentCount == ONE ) && ( m_aStrParams[ CMD_STRINGPARAM_ACCEPT ].getLength() )) ||
( ( m_eArgumentCount == ONE ) && m_aBoolParams[ CMD_BOOLPARAM_PSN ] );
}
@@ -935,3 +1004,5 @@ sal_Bool CommandLineArgs::WantsToLoadDocument() const
}
} // namespace desktop
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx
index a1c70bf5df72..bd7e24a81147 100644..100755
--- a/desktop/source/app/cmdlineargs.hxx
+++ b/desktop/source/app/cmdlineargs.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,7 +41,7 @@ class CommandLineArgs
public:
enum BoolParam // must be zero based!
{
- CMD_BOOLPARAM_MINIMIZED,
+ CMD_BOOLPARAM_MINIMIZED = 0,
CMD_BOOLPARAM_INVISIBLE,
CMD_BOOLPARAM_NORESTORE,
CMD_BOOLPARAM_BEAN,
@@ -71,12 +72,14 @@ class CommandLineArgs
CMD_BOOLPARAM_HELPIMPRESS,
CMD_BOOLPARAM_HELPBASE,
CMD_BOOLPARAM_PSN,
- CMD_BOOLPARAM_COUNT // must be last element!
+ CMD_BOOLPARAM_VERSION,
+ CMD_BOOLPARAM_COUNT // must be last element!
};
enum StringParam // must be zero based!
{
- CMD_STRINGPARAM_PORTAL,
+ CMD_STRINGPARAM_PORTAL = 0,
+ CMD_STRINGPARAM_SPLASHPIPE,
CMD_STRINGPARAM_ACCEPT,
CMD_STRINGPARAM_UNACCEPT,
CMD_STRINGPARAM_USERDIR,
@@ -90,6 +93,10 @@ class CommandLineArgs
CMD_STRINGPARAM_VERSION,
CMD_STRINGPARAM_PRINTTOLIST,
CMD_STRINGPARAM_PRINTERNAME,
+ CMD_STRINGPARAM_CONVERSIONLIST,
+ CMD_STRINGPARAM_CONVERSIONPARAMS,
+ CMD_STRINGPARAM_CONVERSIONOUT,
+ CMD_STRINGPARAM_INFILTER,
CMD_STRINGPARAM_DISPLAY,
CMD_STRINGPARAM_LANGUAGE,
CMD_STRINGPARAM_COUNT // must be last element!
@@ -97,7 +104,7 @@ class CommandLineArgs
enum GroupParamId
{
- CMD_GRPID_MODULE,
+ CMD_GRPID_MODULE = 0,
CMD_GRPID_COUNT
};
@@ -125,52 +132,58 @@ class CommandLineArgs
// generic methods to access parameter
void SetBoolParam( BoolParam eParam, sal_Bool bNewValue );
+ const rtl::OUString& GetStringParam( StringParam eParam ) const;
+
// Access to bool parameters
- sal_Bool IsMinimized() const;
- sal_Bool IsInvisible() const;
- sal_Bool IsNoRestore() const;
- sal_Bool IsNoDefault() const;
- sal_Bool IsBean() const;
- sal_Bool IsServer() const;
- sal_Bool IsHeadless() const;
- sal_Bool IsQuickstart() const;
- sal_Bool IsNoQuickstart() const;
- sal_Bool IsTerminateAfterInit() const;
- sal_Bool IsNoFirstStartWizard() const;
- sal_Bool IsNoLogo() const;
- sal_Bool IsNoLockcheck() const;
- sal_Bool IsHelp() const;
- sal_Bool IsHelpWriter() const;
- sal_Bool IsHelpCalc() const;
- sal_Bool IsHelpDraw() const;
- sal_Bool IsHelpImpress() const;
- sal_Bool IsHelpBase() const;
- sal_Bool IsHelpMath() const;
- sal_Bool IsHelpBasic() const;
- sal_Bool IsWriter() const;
- sal_Bool IsCalc() const;
- sal_Bool IsDraw() const;
- sal_Bool IsImpress() const;
- sal_Bool IsBase() const;
- sal_Bool IsGlobal() const;
- sal_Bool IsMath() const;
- sal_Bool IsWeb() const;
- sal_Bool HasModuleParam() const;
- sal_Bool WantsToLoadDocument() const;
+ sal_Bool IsMinimized() const;
+ sal_Bool IsInvisible() const;
+ sal_Bool IsNoRestore() const;
+ sal_Bool IsNoDefault() const;
+ sal_Bool IsBean() const;
+ sal_Bool IsServer() const;
+ sal_Bool IsHeadless() const;
+ sal_Bool IsQuickstart() const;
+ sal_Bool IsNoQuickstart() const;
+ sal_Bool IsTerminateAfterInit() const;
+ sal_Bool IsNoLogo() const;
+ sal_Bool IsNoLockcheck() const;
+ sal_Bool IsHelp() const;
+ sal_Bool IsHelpWriter() const;
+ sal_Bool IsHelpCalc() const;
+ sal_Bool IsHelpDraw() const;
+ sal_Bool IsHelpImpress() const;
+ sal_Bool IsHelpBase() const;
+ sal_Bool IsHelpMath() const;
+ sal_Bool IsHelpBasic() const;
+ sal_Bool IsWriter() const;
+ sal_Bool IsCalc() const;
+ sal_Bool IsDraw() const;
+ sal_Bool IsImpress() const;
+ sal_Bool IsBase() const;
+ sal_Bool IsGlobal() const;
+ sal_Bool IsMath() const;
+ sal_Bool IsWeb() const;
+ sal_Bool IsVersion() const;
+ sal_Bool HasModuleParam() const;
+ sal_Bool WantsToLoadDocument() const;
// Access to string parameters
- sal_Bool GetPortalConnectString( ::rtl::OUString& rPara) const;
- sal_Bool GetAcceptString( ::rtl::OUString& rPara) const;
- sal_Bool GetUnAcceptString( ::rtl::OUString& rPara) const;
- sal_Bool GetOpenList( ::rtl::OUString& rPara) const;
- sal_Bool GetViewList( ::rtl::OUString& rPara) const;
- sal_Bool GetStartList( ::rtl::OUString& rPara) const;
- sal_Bool GetForceOpenList( ::rtl::OUString& rPara) const;
- sal_Bool GetForceNewList( ::rtl::OUString& rPara) const;
- sal_Bool GetPrintList( ::rtl::OUString& rPara) const;
- sal_Bool GetPrintToList( ::rtl::OUString& rPara ) const;
- sal_Bool GetPrinterName( ::rtl::OUString& rPara ) const;
- sal_Bool GetLanguage( ::rtl::OUString& rPara ) const;
+ sal_Bool GetPortalConnectString( ::rtl::OUString& rPara) const;
+ sal_Bool GetAcceptString( ::rtl::OUString& rPara) const;
+ sal_Bool GetUnAcceptString( ::rtl::OUString& rPara) const;
+ sal_Bool GetOpenList( ::rtl::OUString& rPara) const;
+ sal_Bool GetViewList( ::rtl::OUString& rPara) const;
+ sal_Bool GetStartList( ::rtl::OUString& rPara) const;
+ sal_Bool GetForceOpenList( ::rtl::OUString& rPara) const;
+ sal_Bool GetForceNewList( ::rtl::OUString& rPara) const;
+ sal_Bool GetPrintList( ::rtl::OUString& rPara) const;
+ sal_Bool GetPrintToList( ::rtl::OUString& rPara ) const;
+ sal_Bool GetPrinterName( ::rtl::OUString& rPara ) const;
+ sal_Bool GetLanguage( ::rtl::OUString& rPara ) const;
+ sal_Bool GetInFilter( ::rtl::OUString& rPara ) const;
+ sal_Bool GetConversionList( ::rtl::OUString& rPara ) const;
+ sal_Bool GetConversionParams( ::rtl::OUString& rPara ) const;
+ sal_Bool GetConversionOut( ::rtl::OUString& rPara ) const;
// Special analyzed states (does not match directly to a command line parameter!)
sal_Bool IsPrinting() const;
@@ -190,10 +203,10 @@ class CommandLineArgs
CommandLineArgs( const CommandLineArgs& );
CommandLineArgs operator=( const CommandLineArgs& );
- sal_Bool InterpretCommandLineParameter( const ::rtl::OUString& );
- void ParseCommandLine_Impl( Supplier& supplier );
- void ResetParamValues();
- sal_Bool CheckGroupMembers( GroupParamId nGroup, BoolParam nExcludeMember ) const;
+ sal_Bool InterpretCommandLineParameter( const ::rtl::OUString&, ::rtl::OUString& );
+ void ParseCommandLine_Impl( Supplier& supplier );
+ void ResetParamValues();
+ sal_Bool CheckGroupMembers( GroupParamId nGroup, BoolParam nExcludeMember ) const;
void AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam );
void SetBoolParam_Impl( BoolParam eParam, sal_Bool bValue );
@@ -213,3 +226,5 @@ class CommandLineArgs
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx
index c4530e9ce61c..00754d91631e 100644..100755
--- a/desktop/source/app/cmdlinehelp.cxx
+++ b/desktop/source/app/cmdlinehelp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,42 +54,45 @@ namespace desktop
// __BOTTOM__
// [OK]
- const char *aCmdLineHelp_head =
+ const char *aCmdLineHelp_version =
"%PRODUCTNAME %PRODUCTVERSION %PRODUCTEXTENSION %BUILDID\n"\
- "\n"\
+ "\n";
+ const char *aCmdLineHelp_head =
"Usage: %CMDNAME [options] [documents...]\n"\
"\n"\
"Options:\n";
const char *aCmdLineHelp_left =
- "-minimized \n"\
- "-invisible \n"\
- "-norestore \n"\
- "-quickstart \n"\
- "-nologo \n"\
- "-nolockcheck \n"\
- "-nodefault \n"\
- "-headless \n"\
- "-help/-h/-? \n"\
- "-writer \n"\
- "-calc \n"\
- "-draw \n"\
- "-impress \n"\
- "-base \n"\
- "-math \n"\
- "-global \n"\
- "-web \n"\
+ "--minimized \n"\
+ "--invisible \n"\
+ "--norestore \n"\
+ "--quickstart \n"\
+ "--nologo \n"\
+ "--nolockcheck \n"\
+ "--nodefault \n"\
+ "--headless \n"\
+ "--help/-h/-? \n"\
+ "--version \n"\
+ "--writer \n"\
+ "--calc \n"\
+ "--draw \n"\
+ "--impress \n"\
+ "--base \n"\
+ "--math \n"\
+ "--global \n"\
+ "--web \n"\
"-o \n"\
"-n \n";
const char *aCmdLineHelp_right =
"keep startup bitmap minimized.\n"\
"no startup screen, no default document and no UI.\n"\
"suppress restart/restore after fatal errors.\n"\
- "starts the quickstart service (only available on windows and OS/2 platform)\n"\
+ "starts the quickstart service\n"\
"don't show startup screen.\n"\
"don't check for remote instances using the installation\n"\
"don't start with an empty document\n"\
"like invisible but no userinteraction at all.\n"\
"show this message and exit.\n"\
+ "display the version information.\n"\
"create new text document.\n"\
"create new spreadsheet document.\n"\
"create new drawing.\n"\
@@ -100,23 +104,36 @@ namespace desktop
"open documents regardless whether they are templates or not.\n"\
"always open documents as new files (use as template).\n";
const char *aCmdLineHelp_bottom =
- "-display <display>\n"\
+ "--display <display>\n"\
" Specify X-Display to use in Unix/X11 versions.\n"
"-p <documents...>\n"\
" print the specified documents on the default printer.\n"\
- "-pt <printer> <documents...>\n"\
+ "--pt <printer> <documents...>\n"\
" print the specified documents on the specified printer.\n"\
- "-view <documents...>\n"\
+ "--view <documents...>\n"\
" open the specified documents in viewer-(readonly-)mode.\n"\
- "-show <presentation>\n"\
+ "--show <presentation>\n"\
" open the specified presentation and start it immediately\n"\
- "-accept=<accept-string>\n"\
+ "--accept=<accept-string>\n"\
" Specify an UNO connect-string to create an UNO acceptor through which\n"\
" other programs can connect to access the API\n"\
- "-unaccept=<accept-string>\n"\
+ "--unaccept=<accept-string>\n"\
" Close an acceptor that was created with -accept=<accept-string>\n"\
" Use -unnaccept=all to close all open acceptors\n"\
- "Remaining arguments will be treated as filenames or URLs of documents to open.\n";
+ "--infilter=<filter>\n"\
+ " Force an input filter type if possible\n"\
+ " Eg. -infilter=\"Calc Office Open XML\"\n"\
+ "--convert-to output_file_extension[:output_filter_name] [-outdir ouput_dir] files\n"\
+ " Batch convert files.\n"\
+ " If -outdir is not specified then current working dir is used as output_dir.\n"\
+ " Eg. -convert-to pdf *.doc\n"\
+ " -convert-to pdf:writer_pdf_Export -outdir /home/user *.doc\n"\
+ "--print-to-file [-printer-name printer_name] [-outdir ouput_dir] files\n"\
+ " Batch print files to file.\n"\
+ " If -outdir is not specified then current working dir is used as output_dir.\n"\
+ " Eg. -print-to-file *.doc\n"\
+ " -print-to-file -printer-name nasty_lowres_printer -outdir /home/user *.doc\n"\
+ "\nRemaining arguments will be treated as filenames or URLs of documents to open.\n\n";
void ReplaceStringHookProc( UniString& rStr );
@@ -124,40 +141,62 @@ namespace desktop
{
// if you put variables in other chunks don't forget to call the replace routines
// for those chunks...
+ String aHelpMessage_version(aCmdLineHelp_version, RTL_TEXTENCODING_ASCII_US);
String aHelpMessage_head(aCmdLineHelp_head, RTL_TEXTENCODING_ASCII_US);
String aHelpMessage_left(aCmdLineHelp_left, RTL_TEXTENCODING_ASCII_US);
String aHelpMessage_right(aCmdLineHelp_right, RTL_TEXTENCODING_ASCII_US);
String aHelpMessage_bottom(aCmdLineHelp_bottom, RTL_TEXTENCODING_ASCII_US);
- ReplaceStringHookProc(aHelpMessage_head);
+ ReplaceStringHookProc(aHelpMessage_version);
::rtl::OUString aDefault;
String aVerId( ::utl::Bootstrap::getBuildIdData( aDefault ));
- aHelpMessage_head.SearchAndReplaceAscii( "%BUILDID", aVerId );
+ aHelpMessage_version.SearchAndReplaceAscii( "%BUILDID", aVerId );
aHelpMessage_head.SearchAndReplaceAscii( "%CMDNAME", String( "soffice", RTL_TEXTENCODING_ASCII_US) );
#ifdef UNX
// on unix use console for output
- fprintf(stderr, "%s\n", ByteString(aHelpMessage_head,
- RTL_TEXTENCODING_ASCII_US).GetBuffer());
+ fprintf(stdout, "%s%s",
+ ByteString(aHelpMessage_version, RTL_TEXTENCODING_ASCII_US).GetBuffer(),
+ ByteString(aHelpMessage_head, RTL_TEXTENCODING_ASCII_US).GetBuffer());
// merge left and right column
int n = aHelpMessage_left.GetTokenCount ('\n');
ByteString bsLeft(aHelpMessage_left, RTL_TEXTENCODING_ASCII_US);
ByteString bsRight(aHelpMessage_right, RTL_TEXTENCODING_ASCII_US);
for ( int i = 0; i < n; i++ )
{
- fprintf(stderr, "%s", bsLeft.GetToken(i, '\n').GetBuffer());
- fprintf(stderr, "%s\n", bsRight.GetToken(i, '\n').GetBuffer());
+ fprintf(stdout, "%s", bsLeft.GetToken(i, '\n').GetBuffer());
+ fprintf(stdout, "%s\n", bsRight.GetToken(i, '\n').GetBuffer());
}
- fprintf(stderr, "%s", ByteString(aHelpMessage_bottom,
+ fprintf(stdout, "%s", ByteString(aHelpMessage_bottom,
RTL_TEXTENCODING_ASCII_US).GetBuffer());
#else
// rest gets a dialog box
CmdlineHelpDialog aDlg;
- aDlg.m_ftHead.SetText(aHelpMessage_head);
+ String head = aHelpMessage_version;
+ head.Append(aHelpMessage_head);
+ aDlg.m_ftHead.SetText(head);
aDlg.m_ftLeft.SetText(aHelpMessage_left);
aDlg.m_ftRight.SetText(aHelpMessage_right);
aDlg.m_ftBottom.SetText(aHelpMessage_bottom);
aDlg.Execute();
#endif
}
+
+ void displayVersion()
+ {
+ String aVersionMsg(aCmdLineHelp_version, RTL_TEXTENCODING_ASCII_US);
+ ReplaceStringHookProc(aVersionMsg);
+ ::rtl::OUString aDefault;
+ String aVerId = ::utl::Bootstrap::getBuildIdData(aDefault);
+ aVersionMsg.SearchAndReplaceAscii("%BUILDID", aVerId);
+#ifdef UNX
+ fprintf(stdout, "%s", ByteString(aVersionMsg, RTL_TEXTENCODING_ASCII_US).GetBuffer());
+#else
+ // Just re-use the help dialog for now.
+ CmdlineHelpDialog aDlg;
+ aDlg.m_ftHead.SetText(aVersionMsg);
+ aDlg.Execute();
+#endif
+ }
+
#ifndef UNX
CmdlineHelpDialog::CmdlineHelpDialog (void)
: ModalDialog( NULL, DesktopResId( DLG_CMDLINEHELP ) )
@@ -171,3 +210,5 @@ namespace desktop
}
#endif
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/cmdlinehelp.hxx b/desktop/source/app/cmdlinehelp.hxx
index 4bca6e7e7d1a..5c92512ea1e9 100644..100755
--- a/desktop/source/app/cmdlinehelp.hxx
+++ b/desktop/source/app/cmdlinehelp.hxx
@@ -1,12 +1,12 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
namespace desktop
{
void displayCmdlineHelp( void );
+ void displayVersion();
#ifndef UNX
class CmdlineHelpDialog : public ModalDialog
{
@@ -21,3 +21,5 @@ namespace desktop
};
#endif
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/configinit.cxx b/desktop/source/app/configinit.cxx
index 0c354c3446c0..7a4bf00671b2 100644..100755
--- a/desktop/source/app/configinit.cxx
+++ b/desktop/source/app/configinit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -242,7 +243,7 @@ private:
uno::Any SAL_CALL ConfigurationErrorHandler::Context::getValueByName( OUString const & aName)
throw (uno::RuntimeException)
{
- if ( aName.equalsAscii( CONFIG_ERROR_HANDLER ) )
+ if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CONFIG_ERROR_HANDLER)) )
{
if ( !m_xHandler.is() )
m_xHandler = ConfigurationErrorHandler::getDefaultInteractionHandler();
@@ -301,3 +302,4 @@ ConfigurationErrorHandler::InteractionHandler ConfigurationErrorHandler::getDefa
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/configinit.hxx b/desktop/source/app/configinit.hxx
index 68df86656bea..24fb01881396 100644..100755
--- a/desktop/source/app/configinit.hxx
+++ b/desktop/source/app/configinit.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef _DESKTOP_CONFIGINIT_HXX_
#define _DESKTOP_CONFIGINIT_HXX_
@@ -69,3 +70,5 @@ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
//-----------------------------------------------------------------------------
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/copyright_ascii_ooo.c b/desktop/source/app/copyright_ascii_ooo.c
index 7439547f62b4..3984a81f26e5 100644..100755
--- a/desktop/source/app/copyright_ascii_ooo.c
+++ b/desktop/source/app/copyright_ascii_ooo.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* copyright text to see as text in the soffice binary
@@ -8,3 +9,4 @@ extern const char copyright_text_1[];
const char copyright_text_1[] = "Copyright © 2000, 2010 Oracle and/or its affiliates, All rights reserved.";
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/copyright_ascii_sun.c b/desktop/source/app/copyright_ascii_sun.c
index c7de54e98fba..c7d6e7e3c08d 100644..100755
--- a/desktop/source/app/copyright_ascii_sun.c
+++ b/desktop/source/app/copyright_ascii_sun.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* copyright text to see as text in the soffice binary
@@ -6,3 +7,4 @@
const char copyright_text_1[] = "Copyright © 2000, 2010 Oracle and/or its affiliates, All rights reserved.";
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/desktop.hrc b/desktop/source/app/desktop.hrc
index 9c68d7b9fd2d..9c68d7b9fd2d 100644..100755
--- a/desktop/source/app/desktop.hrc
+++ b/desktop/source/app/desktop.hrc
diff --git a/desktop/source/app/desktop.src b/desktop/source/app/desktop.src
index 98ee68685917..98ee68685917 100644..100755
--- a/desktop/source/app/desktop.src
+++ b/desktop/source/app/desktop.src
diff --git a/desktop/source/app/desktopcontext.cxx b/desktop/source/app/desktopcontext.cxx
index e516b5eadd46..2a8ed7ef628c 100644..100755
--- a/desktop/source/app/desktopcontext.cxx
+++ b/desktop/source/app/desktopcontext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,10 +33,11 @@
#include <vcl/svapp.hxx>
#include <svtools/javainteractionhandler.hxx>
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::task;
+using ::rtl::OUString;
+
namespace desktop
{
@@ -48,7 +50,7 @@ Any SAL_CALL DesktopContext::getValueByName( const OUString& Name) throw (Runtim
{
Any retVal;
- if ( 0 == Name.compareToAscii( JAVA_INTERACTION_HANDLER_NAME ))
+ if (Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(JAVA_INTERACTION_HANDLER_NAME)))
{
retVal = makeAny( Reference< XInteractionHandler >( new svt::JavaInteractionHandler()) );
}
@@ -61,3 +63,5 @@ Any SAL_CALL DesktopContext::getValueByName( const OUString& Name) throw (Runtim
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/desktopcontext.hxx b/desktop/source/app/desktopcontext.hxx
index 88948e753af5..b68a73cd9cf9 100644..100755
--- a/desktop/source/app/desktopcontext.hxx
+++ b/desktop/source/app/desktopcontext.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@ namespace desktop
}
#endif // _DESKTOP_DESKTOPCONTEXT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/desktopresid.cxx b/desktop/source/app/desktopresid.cxx
index 4aad5ef98036..ac8799a95a23 100644..100755
--- a/desktop/source/app/desktopresid.cxx
+++ b/desktop/source/app/desktopresid.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,5 @@ DesktopResId::DesktopResId( sal_uInt16 nId ) :
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/desktopresid.hxx b/desktop/source/app/desktopresid.hxx
index 767d5fb7849d..14d45a493f0c 100644..100755
--- a/desktop/source/app/desktopresid.hxx
+++ b/desktop/source/app/desktopresid.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,5 @@ class DesktopResId : public ResId
}
#endif // _DESKTOP_RESID_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index db7f3c45964f..501fdc19bfd5 100644..100755
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +29,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+#include <sfx2/docfile.hxx>
+#include <sfx2/docfilt.hxx>
+#include <sfx2/fcontnr.hxx>
+#include "osl/file.hxx"
+#include <svl/fstathelper.hxx>
+
#include "dispatchwatcher.hxx"
#include <rtl/ustring.hxx>
#include <tools/string.hxx>
@@ -48,13 +55,15 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/document/MacroExecMode.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
+#include <com/sun/star/frame/XStorable.hpp>
#include <tools/urlobj.hxx>
#include <comphelper/mediadescriptor.hxx>
#include <vector>
+#include <osl/thread.hxx>
-using namespace ::rtl;
+using ::rtl::OUString;
using namespace ::osl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
@@ -80,6 +89,32 @@ struct DispatchHolder
Reference< XDispatch > xDispatch;
};
+static String impl_GetFilterFromExt( OUString aUrl, SfxFilterFlags nFlags,
+ String aAppl )
+{
+ String aFilter;
+ SfxMedium* pMedium = new SfxMedium( aUrl,
+ STREAM_STD_READ, FALSE );
+ const SfxFilter *pSfxFilter = NULL;
+ SfxFilterMatcher aMatcher;
+ if( nFlags == SFX_FILTER_EXPORT )
+ aMatcher = SfxFilterMatcher( aAppl );
+ aMatcher.GuessFilterIgnoringContent( *pMedium, &pSfxFilter, nFlags, 0 );
+ if( pSfxFilter )
+ aFilter = ( nFlags == SFX_FILTER_EXPORT ) ? pSfxFilter->GetFilterName() :
+ pSfxFilter->GetServiceName();
+
+ delete pMedium;
+ return aFilter;
+}
+static OUString impl_GuessFilter( OUString aUrlIn, OUString aUrlOut )
+{
+ /* aAppl can also be set to Factory like scalc, swriter... */
+ String aAppl;
+ aAppl = impl_GetFilterFromExt( aUrlIn, SFX_FILTER_IMPORT, aAppl );
+ return impl_GetFilterFromExt( aUrlOut, SFX_FILTER_EXPORT, aAppl );
+}
+
Mutex* DispatchWatcher::pWatcherMutex = NULL;
Mutex& DispatchWatcher::GetMutex()
@@ -138,10 +173,11 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
DispatchList::const_iterator p;
std::vector< DispatchHolder > aDispatches;
::rtl::OUString aAsTemplateArg( RTL_CONSTASCII_USTRINGPARAM( "AsTemplate"));
+ sal_Bool bSetInputFilter = sal_False;
+ ::rtl::OUString aForcedInputFilter;
- for ( p = aDispatchRequestsList.begin(); p != aDispatchRequestsList.end(); p++ )
+ for ( p = aDispatchRequestsList.begin(); p != aDispatchRequestsList.end(); ++p )
{
- String aPrinterName;
const DispatchRequest& aDispatchRequest = *p;
// create parameter array
@@ -149,40 +185,53 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
if ( aDispatchRequest.aPreselectedFactory.getLength() )
nCount++;
+ // Set Input Filter
+ if ( aDispatchRequest.aRequestType == REQUEST_INFILTER )
+ {
+ bSetInputFilter = sal_True;
+ aForcedInputFilter = aDispatchRequest.aURL;
+ OfficeIPCThread::RequestsCompleted( 1 );
+ continue;
+ }
+
// we need more properties for a print/print to request
if ( aDispatchRequest.aRequestType == REQUEST_PRINT ||
- aDispatchRequest.aRequestType == REQUEST_PRINTTO )
+ aDispatchRequest.aRequestType == REQUEST_PRINTTO ||
+ aDispatchRequest.aRequestType == REQUEST_BATCHPRINT ||
+ aDispatchRequest.aRequestType == REQUEST_CONVERSION)
nCount++;
Sequence < PropertyValue > aArgs( nCount );
// mark request as user interaction from outside
- aArgs[0].Name = ::rtl::OUString::createFromAscii("Referer");
- aArgs[0].Value <<= ::rtl::OUString::createFromAscii("private:OpenEvent");
+ aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer"));
+ aArgs[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:OpenEvent"));
if ( aDispatchRequest.aRequestType == REQUEST_PRINT ||
- aDispatchRequest.aRequestType == REQUEST_PRINTTO )
+ aDispatchRequest.aRequestType == REQUEST_PRINTTO ||
+ aDispatchRequest.aRequestType == REQUEST_BATCHPRINT ||
+ aDispatchRequest.aRequestType == REQUEST_CONVERSION)
{
- aArgs[1].Name = ::rtl::OUString::createFromAscii("ReadOnly");
- aArgs[2].Name = ::rtl::OUString::createFromAscii("OpenNewView");
- aArgs[3].Name = ::rtl::OUString::createFromAscii("Hidden");
- aArgs[4].Name = ::rtl::OUString::createFromAscii("Silent");
+ aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
+ aArgs[2].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OpenNewView"));
+ aArgs[3].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
+ aArgs[4].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Silent"));
}
else
{
Reference < com::sun::star::task::XInteractionHandler > xInteraction(
- ::comphelper::getProcessServiceFactory()->createInstance( OUString::createFromAscii("com.sun.star.task.InteractionHandler") ),
+ ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.task.InteractionHandler")) ),
com::sun::star::uno::UNO_QUERY );
- aArgs[1].Name = OUString::createFromAscii( "InteractionHandler" );
+ aArgs[1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" ));
aArgs[1].Value <<= xInteraction;
sal_Int16 nMacroExecMode = ::com::sun::star::document::MacroExecMode::USE_CONFIG;
- aArgs[2].Name = OUString::createFromAscii( "MacroExecutionMode" );
+ aArgs[2].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( "MacroExecutionMode" ));
aArgs[2].Value <<= nMacroExecMode;
sal_Int16 nUpdateDoc = ::com::sun::star::document::UpdateDocMode::ACCORDING_TO_CONFIG;
- aArgs[3].Name = OUString::createFromAscii( "UpdateDocMode" );
+ aArgs[3].Name = OUString(RTL_CONSTASCII_USTRINGPARAM( "UpdateDocMode" ));
aArgs[3].Value <<= nUpdateDoc;
}
@@ -196,7 +245,9 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
::rtl::OUString aTarget( RTL_CONSTASCII_USTRINGPARAM("_default") );
if ( aDispatchRequest.aRequestType == REQUEST_PRINT ||
- aDispatchRequest.aRequestType == REQUEST_PRINTTO )
+ aDispatchRequest.aRequestType == REQUEST_PRINTTO ||
+ aDispatchRequest.aRequestType == REQUEST_BATCHPRINT ||
+ aDispatchRequest.aRequestType == REQUEST_CONVERSION)
{
// documents opened for printing are opened readonly because they must be opened as a new document and this
// document could be open already
@@ -214,7 +265,6 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
// hidden documents should never be put into open tasks
aTarget = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") );
}
-
// load the document ... if they are loadable!
// Otherwise try to dispatch it ...
Reference < XPrintable > xDoc;
@@ -278,7 +328,7 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
// Otherwise it would be possible to have an office running without an open
// window!!
Sequence < PropertyValue > aArgs2(1);
- aArgs2[0].Name = ::rtl::OUString::createFromAscii("SynchronMode");
+ aArgs2[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SynchronMode"));
aArgs2[0].Value <<= sal_True;
Reference < XNotifyingDispatch > xDisp( xDispatcher, UNO_QUERY );
if ( xDisp.is() )
@@ -288,8 +338,8 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
}
catch ( ::com::sun::star::uno::Exception& )
{
- OUString aMsg = OUString::createFromAscii(
- "Desktop::OpenDefault() IllegalArgumentException while calling XNotifyingDispatch: ");
+ OUString aMsg = OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Desktop::OpenDefault() IllegalArgumentException while calling XNotifyingDispatch: "));
OSL_ENSURE( sal_False, OUStringToOString(aMsg, RTL_TEXTENCODING_ASCII_US).getStr());
}
}
@@ -318,7 +368,7 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
if(aDispatchRequest.aRequestType == REQUEST_VIEW) {
sal_Int32 nIndex = aArgs.getLength();
aArgs.realloc(nIndex+1);
- aArgs[nIndex].Name = OUString::createFromAscii("ReadOnly");
+ aArgs[nIndex].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
aArgs[nIndex].Value <<= sal_True;
}
@@ -326,28 +376,35 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
if(aDispatchRequest.aRequestType == REQUEST_START) {
sal_Int32 nIndex = aArgs.getLength();
aArgs.realloc(nIndex+1);
- aArgs[nIndex].Name = OUString::createFromAscii("StartPresentation");
+ aArgs[nIndex].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("StartPresentation"));
aArgs[nIndex].Value <<= sal_True;
}
- // This is a synchron loading of a component so we don't have to deal with our statusChanged listener mechanism.
+ // Force input filter, if possible
+ if( bSetInputFilter )
+ {
+ sal_Int32 nIndex = aArgs.getLength();
+ aArgs.realloc(nIndex+1);
+ aArgs[nIndex].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName"));
+ aArgs[nIndex].Value <<= aForcedInputFilter;
+ }
+ // This is a synchron loading of a component so we don't have to deal with our statusChanged listener mechanism.
try
{
xDoc = Reference < XPrintable >( ::comphelper::SynchronousDispatch::dispatch( xDesktop, aName, aTarget, 0, aArgs ), UNO_QUERY );
- //xDoc = Reference < XPrintable >( xDesktop->loadComponentFromURL( aName, aTarget, 0, aArgs ), UNO_QUERY );
}
catch ( ::com::sun::star::lang::IllegalArgumentException& iae)
{
- OUString aMsg = OUString::createFromAscii(
- "Dispatchwatcher IllegalArgumentException while calling loadComponentFromURL: ")
+ OUString aMsg = OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Dispatchwatcher IllegalArgumentException while calling loadComponentFromURL: "))
+ iae.Message;
OSL_ENSURE( sal_False, OUStringToOString(aMsg, RTL_TEXTENCODING_ASCII_US).getStr());
}
catch (com::sun::star::io::IOException& ioe)
{
- OUString aMsg = OUString::createFromAscii(
- "Dispatchwatcher IOException while calling loadComponentFromURL: ")
+ OUString aMsg = OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Dispatchwatcher IOException while calling loadComponentFromURL: "))
+ ioe.Message;
OSL_ENSURE( sal_False, OUStringToOString(aMsg, RTL_TEXTENCODING_ASCII_US).getStr());
}
@@ -361,24 +418,132 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
OfficeIPCThread::RequestsCompleted( 1 );
}
else if ( aDispatchRequest.aRequestType == REQUEST_PRINT ||
- aDispatchRequest.aRequestType == REQUEST_PRINTTO )
+ aDispatchRequest.aRequestType == REQUEST_PRINTTO ||
+ aDispatchRequest.aRequestType == REQUEST_BATCHPRINT ||
+ aDispatchRequest.aRequestType == REQUEST_CONVERSION )
{
if ( xDoc.is() )
{
- if ( aDispatchRequest.aRequestType == REQUEST_PRINTTO )
- {
- // create the printer
+ if ( aDispatchRequest.aRequestType == REQUEST_CONVERSION ) {
+ Reference< XStorable > xStorable( xDoc, UNO_QUERY );
+ if ( xStorable.is() ) {
+ rtl::OUString aParam = aDispatchRequest.aPrinterName;
+ sal_Int32 nPathIndex = aParam.lastIndexOfAsciiL( ";", 1 );
+ sal_Int32 nFilterIndex = aParam.indexOfAsciiL( ":", 1 );
+ if( nPathIndex < nFilterIndex )
+ nFilterIndex = -1;
+ rtl::OUString aFilterOut=aParam.copy( nPathIndex+1 );
+ rtl::OUString aFilter;
+ rtl::OUString aFilterExt;
+ sal_Bool bGuess = sal_False;
+
+ if( nFilterIndex >= 0 )
+ {
+ aFilter = aParam.copy( nFilterIndex+1, nPathIndex-nFilterIndex-1 );
+ aFilterExt = aParam.copy( 0, nFilterIndex );
+ }
+ else
+ {
+ // Guess
+ bGuess = sal_True;
+ aFilterExt = aParam.copy( 0, nPathIndex );
+ }
+ INetURLObject aOutFilename( aObj );
+ aOutFilename.SetExtension( aFilterExt );
+ FileBase::getFileURLFromSystemPath( aFilterOut, aFilterOut );
+ rtl::OUString aOutFile = aFilterOut+
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/" ))+
+ aOutFilename.getName();
+
+ if ( bGuess )
+ {
+ aFilter = impl_GuessFilter( aName, aOutFile );
+ }
+
+ Sequence<PropertyValue> conversionProperties( 2 );
+ conversionProperties[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Overwrite" ));
+ conversionProperties[0].Value <<= sal_True;
+
+ conversionProperties[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilterName" ));
+ conversionProperties[1].Value <<= aFilter;
+
+ rtl::OUString aTempName;
+ FileBase::getSystemPathFromFileURL( aName, aTempName );
+ rtl::OString aSource8 = ::rtl::OUStringToOString ( aTempName, RTL_TEXTENCODING_UTF8 );
+ FileBase::getSystemPathFromFileURL( aOutFile, aTempName );
+ rtl::OString aTargetURL8 = ::rtl::OUStringToOString(aTempName, RTL_TEXTENCODING_UTF8 );
+ printf("convert %s -> %s using %s\n", aSource8.getStr(), aTargetURL8.getStr(),
+ ::rtl::OUStringToOString( aFilter, RTL_TEXTENCODING_UTF8 ).getStr());
+ if( FStatHelper::IsDocument(aOutFile) )
+ printf("Overwriting: %s\n",::rtl::OUStringToOString( aTempName, RTL_TEXTENCODING_UTF8 ).getStr() );
+ try
+ {
+ xStorable->storeToURL( aOutFile, conversionProperties );
+ }
+ catch ( Exception& )
+ {
+ fprintf( stderr, "Error: Please reverify input parameters...\n" );
+ }
+ }
+ } else if ( aDispatchRequest.aRequestType == REQUEST_BATCHPRINT ) {
+ rtl::OUString aParam = aDispatchRequest.aPrinterName;
+ sal_Int32 nPathIndex = aParam.lastIndexOfAsciiL( ";", 1 );
+
+ rtl::OUString aFilterOut;
+ rtl::OUString aPrinterName;
+ if( nPathIndex != -1 )
+ aFilterOut=aParam.copy( nPathIndex+1 );
+ if( nPathIndex != 0 )
+ aPrinterName=aParam.copy( 0, nPathIndex );
+
+ INetURLObject aOutFilename( aObj );
+ aOutFilename.SetExtension( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ps")) );
+ FileBase::getFileURLFromSystemPath( aFilterOut, aFilterOut );
+ rtl::OUString aOutFile = aFilterOut+
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/" ))+
+ aOutFilename.getName();
+
+ rtl::OUString aTempName;
+ FileBase::getSystemPathFromFileURL( aName, aTempName );
+ rtl::OString aSource8 = ::rtl::OUStringToOString ( aTempName, RTL_TEXTENCODING_UTF8 );
+ FileBase::getSystemPathFromFileURL( aOutFile, aTempName );
+ rtl::OString aTargetURL8 = ::rtl::OUStringToOString(aTempName, RTL_TEXTENCODING_UTF8 );
+ printf("print %s -> %s using %s\n", aSource8.getStr(), aTargetURL8.getStr(),
+ aPrinterName.getLength() ?
+ ::rtl::OUStringToOString( aPrinterName, RTL_TEXTENCODING_UTF8 ).getStr() : "<default_printer>");
+
+ // create the custom printer, if given
+ Sequence < PropertyValue > aPrinterArgs( 1 );
+ if( aPrinterName.getLength() )
+ {
+ aPrinterArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"));
+ aPrinterArgs[0].Value <<= aPrinterName;
+ xDoc->setPrinter( aPrinterArgs );
+ }
+
+ // print ( also without user interaction )
+ aPrinterArgs.realloc(2);
+ aPrinterArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FileName"));
+ aPrinterArgs[0].Value <<= aOutFile;
+ aPrinterArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wait"));
+ aPrinterArgs[1].Value <<= ( sal_Bool ) sal_True;
+ xDoc->print( aPrinterArgs );
+ } else {
+ if ( aDispatchRequest.aRequestType == REQUEST_PRINTTO )
+ {
+ // create the printer
+ Sequence < PropertyValue > aPrinterArgs( 1 );
+ aPrinterArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"));
+ aPrinterArgs[0].Value <<= ::rtl::OUString( aDispatchRequest.aPrinterName );
+ xDoc->setPrinter( aPrinterArgs );
+ }
+
+ // print ( also without user interaction )
Sequence < PropertyValue > aPrinterArgs( 1 );
- aPrinterArgs[0].Name = ::rtl::OUString::createFromAscii("Name");
- aPrinterArgs[0].Value <<= ::rtl::OUString( aDispatchRequest.aPrinterName );
- xDoc->setPrinter( aPrinterArgs );
+ aPrinterArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wait"));
+ aPrinterArgs[0].Value <<= ( sal_Bool ) sal_True;
+ xDoc->print( aPrinterArgs );
}
-
- // print ( also without user interaction )
- Sequence < PropertyValue > aPrinterArgs( 1 );
- aPrinterArgs[0].Name = ::rtl::OUString::createFromAscii("Wait");
- aPrinterArgs[0].Value <<= ( sal_Bool ) sal_True;
- xDoc->print( aPrinterArgs );
}
else
{
@@ -412,9 +577,9 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
{
// Execute all asynchronous dispatches now after we placed them into our request container!
Sequence < PropertyValue > aArgs( 2 );
- aArgs[0].Name = ::rtl::OUString::createFromAscii("Referer");
- aArgs[0].Value <<= ::rtl::OUString::createFromAscii("private:OpenEvent");
- aArgs[1].Name = ::rtl::OUString::createFromAscii("SynchronMode");
+ aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Referer"));
+ aArgs[0].Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:OpenEvent"));
+ aArgs[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SynchronMode"));
aArgs[1].Value <<= sal_True;
for ( sal_uInt32 n = 0; n < aDispatches.size(); n++ )
@@ -445,7 +610,6 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
// We have to check if we have an open task otherwise we have to shutdown the office.
Reference< XFramesSupplier > xTasksSupplier( xDesktop, UNO_QUERY );
aGuard.clear();
-
Reference< XElementAccess > xList( xTasksSupplier->getFrames(), UNO_QUERY );
if ( !xList->hasElements() )
@@ -473,18 +637,6 @@ void SAL_CALL DispatchWatcher::dispatchFinished( const DispatchResultEvent& ) th
sal_Int16 nCount = --m_nRequestCount;
aGuard.clear();
OfficeIPCThread::RequestsCompleted( 1 );
-/*
- // Find request in our hash map and remove it as a pending request
- DispatchWatcherHashMap::iterator pDispatchEntry = m_aRequestContainer.find( rEvent.FeatureURL.Complete ) ;
- if ( pDispatchEntry != m_aRequestContainer.end() )
- {
- m_aRequestContainer.erase( pDispatchEntry );
- aGuard.clear();
- OfficeIPCThread::RequestsCompleted( 1 );
- }
- else
- aGuard.clear();
-*/
if ( !nCount && !OfficeIPCThread::AreRequestsPending() )
{
// We have to check if we have an open task otherwise we have to shutdown the office.
@@ -512,3 +664,4 @@ void SAL_CALL DispatchWatcher::dispatchFinished( const DispatchResultEvent& ) th
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/dispatchwatcher.hxx b/desktop/source/app/dispatchwatcher.hxx
index 2b3f1ab54680..0fde60da603f 100644..100755
--- a/desktop/source/app/dispatchwatcher.hxx
+++ b/desktop/source/app/dispatchwatcher.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,7 @@
#include <com/sun/star/frame/XDispatchResultListener.hpp>
#include "officeipcthread.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <vector>
namespace desktop
@@ -55,7 +56,7 @@ struct OUStringHashCode
}
};
-class DispatchWatcherHashMap : public ::std::hash_map< ::rtl::OUString, sal_Int32, OUStringHashCode, ::std::equal_to< ::rtl::OUString > >
+class DispatchWatcherHashMap : public ::boost::unordered_map< ::rtl::OUString, sal_Int32, OUStringHashCode, ::std::equal_to< ::rtl::OUString > >
{
public:
inline void free()
@@ -75,7 +76,10 @@ class DispatchWatcher : public ::cppu::WeakImplHelper1< ::com::sun::star::frame:
REQUEST_PRINT,
REQUEST_PRINTTO,
REQUEST_FORCEOPEN,
- REQUEST_FORCENEW
+ REQUEST_FORCENEW,
+ REQUEST_CONVERSION,
+ REQUEST_INFILTER,
+ REQUEST_BATCHPRINT
};
struct DispatchRequest
@@ -86,7 +90,7 @@ class DispatchWatcher : public ::cppu::WeakImplHelper1< ::com::sun::star::frame:
RequestType aRequestType;
rtl::OUString aURL;
boost::optional< rtl::OUString > aCwdUrl;
- rtl::OUString aPrinterName;
+ rtl::OUString aPrinterName; // also conversion params
rtl::OUString aPreselectedFactory;
};
@@ -122,3 +126,5 @@ class DispatchWatcher : public ::cppu::WeakImplHelper1< ::com::sun::star::frame:
}
#endif // _DESKTOP_DISPATCHWATCHER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/exports.dxp b/desktop/source/app/exports.dxp
index f0e1c69934bc..f0e1c69934bc 100644..100755
--- a/desktop/source/app/exports.dxp
+++ b/desktop/source/app/exports.dxp
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
index 9df8d82a37ff..d70703103967 100644..100755
--- a/desktop/source/app/langselect.cxx
+++ b/desktop/source/app/langselect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -53,13 +54,16 @@
#include <osl/process.h>
#include <osl/file.hxx>
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::container;
using namespace com::sun::star::beans;
using namespace com::sun::star::util;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+using ::rtl::OString;
+
namespace desktop {
static char const SOFFICE_BOOTSTRAP[] = "Bootstrap";
@@ -69,7 +73,7 @@ sal_Bool LanguageSelection::bFoundLanguage = sal_False;
OUString LanguageSelection::aFoundLanguage;
LanguageSelection::LanguageSelectionStatus LanguageSelection::m_eStatus = LS_STATUS_OK;
-const OUString LanguageSelection::usFallbackLanguage = OUString::createFromAscii("en-US");
+const OUString LanguageSelection::usFallbackLanguage(RTL_CONSTASCII_USTRINGPARAM("en-US"));
static sal_Bool existsURL( OUString const& sURL )
{
@@ -125,7 +129,7 @@ Locale LanguageSelection::IsoStringToLocale(const OUString& str)
bool LanguageSelection::prepareLanguage()
{
m_eStatus = LS_STATUS_OK;
- OUString sConfigSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider");
+ OUString sConfigSrvc = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"));
Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
Reference< XLocalizable > theConfigProvider;
try
@@ -146,7 +150,7 @@ bool LanguageSelection::prepareLanguage()
try
{
Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.System/L10N/", sal_False), UNO_QUERY_THROW);
- Any aWin16SysLocale = xProp->getPropertyValue(OUString::createFromAscii("SystemLocale"));
+ Any aWin16SysLocale = xProp->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("SystemLocale")));
::rtl::OUString sWin16SysLocale;
aWin16SysLocale >>= sWin16SysLocale;
if( sWin16SysLocale.getLength())
@@ -163,7 +167,7 @@ bool LanguageSelection::prepareLanguage()
OUString usLocale;
Reference< XPropertySet > xLocaleProp(getConfigAccess(
"org.openoffice.System/L10N", sal_True), UNO_QUERY_THROW);
- xLocaleProp->getPropertyValue(OUString::createFromAscii("Locale")) >>= usLocale;
+ xLocaleProp->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Locale"))) >>= usLocale;
setDefaultLanguage(usLocale);
}
catch (Exception&)
@@ -234,7 +238,7 @@ bool LanguageSelection::prepareLanguage()
if ( !bCmdLanguage )
{
// Store language only
- xProp->setPropertyValue(OUString::createFromAscii("ooLocale"), makeAny(aLocaleString));
+ xProp->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("ooLocale")), makeAny(aLocaleString));
Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
}
@@ -242,14 +246,14 @@ bool LanguageSelection::prepareLanguage()
{
// Store language only
Reference< XPropertySet > xProp2(getConfigAccess("org.openoffice.Office.Linguistic/General/", sal_True), UNO_QUERY_THROW);
- xProp2->setPropertyValue(OUString::createFromAscii("UILocale"), makeAny(aLocaleString));
+ xProp2->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale")), makeAny(aLocaleString));
Reference< XChangesBatch >(xProp2, UNO_QUERY_THROW)->commitChanges();
}
MsLangId::setConfiguredSystemUILanguage( MsLangId::convertLocaleToLanguage(loc) );
OUString sLocale;
- xProp->getPropertyValue(OUString::createFromAscii("ooSetupSystemLocale")) >>= sLocale;
+ xProp->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("ooSetupSystemLocale"))) >>= sLocale;
if ( sLocale.getLength() )
{
loc = LanguageSelection::IsoStringToLocale(sLocale);
@@ -370,12 +374,12 @@ Reference< XNameAccess > LanguageSelection::getConfigAccess(const sal_Char* pPat
{
Reference< XNameAccess > xNameAccess;
try{
- OUString sConfigSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider");
+ OUString sConfigSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"));
OUString sAccessSrvc;
if (bUpdate)
- sAccessSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess");
+ sAccessSrvc = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
else
- sAccessSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess");
+ sAccessSrvc = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess"));
OUString sConfigURL = OUString::createFromAscii(pPath);
@@ -415,9 +419,9 @@ Sequence< OUString > LanguageSelection::getInstalledLanguages()
static Sequence< OUString > _getFallbackLocales(const OUString& aIsoLang)
{
Sequence< OUString > seqFallbacks;
- if (aIsoLang.equalsAscii("zh-HK")) {
+ if (aIsoLang.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("zh-HK"))) {
seqFallbacks = Sequence< OUString >(1);
- seqFallbacks[0] = OUString::createFromAscii("zh-TW");
+ seqFallbacks[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("zh-TW"));
}
return seqFallbacks;
}
@@ -489,7 +493,7 @@ OUString LanguageSelection::getUserLanguage()
{
try
{
- xAccess->getByName(OUString::createFromAscii("UILocale")) >>= aUserLanguage;
+ xAccess->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale"))) >>= aUserLanguage;
}
catch ( NoSuchElementException const & )
{
@@ -513,7 +517,7 @@ OUString LanguageSelection::getSystemLanguage()
{
try
{
- xAccess->getByName(OUString::createFromAscii("UILocale")) >>= aUserLanguage;
+ xAccess->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale"))) >>= aUserLanguage;
}
catch ( NoSuchElementException const & )
{
@@ -535,7 +539,7 @@ void LanguageSelection::resetUserLanguage()
try
{
Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Office.Linguistic/General", sal_True), UNO_QUERY_THROW);
- xProp->setPropertyValue(OUString::createFromAscii("UILocale"), makeAny(OUString::createFromAscii("")));
+ xProp->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale")), makeAny(OUString()));
Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
}
catch ( PropertyVetoException& )
@@ -556,3 +560,5 @@ LanguageSelection::LanguageSelectionStatus LanguageSelection::getStatus()
}
} // namespace desktop
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/langselect.hxx b/desktop/source/app/langselect.hxx
index bdf3cd6364de..fdb229a47956 100644..100755
--- a/desktop/source/app/langselect.hxx
+++ b/desktop/source/app/langselect.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,3 +73,5 @@ private:
};
} //namespace desktop
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/lockfile.cxx b/desktop/source/app/lockfile.cxx
index 9cc447a6c56b..5e534f2b2107 100644..100755
--- a/desktop/source/app/lockfile.cxx
+++ b/desktop/source/app/lockfile.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,10 @@
#include <stdlib.h>
#include <time.h>
#ifdef WNT
-#include <tools/prewin.h>
-#include <windows.h>
-#include <tools/postwin.h>
+#include <prewin.h>
+#include <postwin.h>
+#else
+#include <unistd.h>
#endif
#include <sal/types.h>
#include <osl/file.hxx>
@@ -50,25 +52,38 @@ using namespace ::rtl;
using namespace ::utl;
-namespace desktop {
+static rtl::OString impl_getHostname()
+{
+ rtl::OString aHost;
+#ifdef WNT
+ /*
+ prevent windows from connecting to the net to get it's own
+ hostname by using the netbios name
+ */
+ sal_Int32 sz = MAX_COMPUTERNAME_LENGTH + 1;
+ char* szHost = new char[sz];
+ if (GetComputerName(szHost, (LPDWORD)&sz))
+ aHost = OString(szHost);
+ else
+ aHost = OString("UNKNOWN");
+ delete[] szHost;
+#else
+ /* Don't do dns lookup on Linux either */
+ sal_Char pHostName[1024];
+
+ if ( gethostname( pHostName, sizeof( pHostName ) - 1 ) == 0 )
+ {
+ pHostName[sizeof( pHostName ) - 1] = '\0';
+ aHost = OString( pHostName );
+ }
+ else
+ aHost = OString("UNKNOWN");
+#endif
+
+ return aHost;
+}
- // initialize static members...
- // lock suffix
- const OUString Lockfile::Suffix()
- { return OUString::createFromAscii( "/.lock" ); }
- // values for datafile
- const ByteString Lockfile::Group()
- { return ByteString( "Lockdata" ); }
- const ByteString Lockfile::Userkey()
- { return ByteString( "User" ); }
- const ByteString Lockfile::Hostkey()
- { return ByteString( "Host" ); }
- const ByteString Lockfile::Stampkey()
- { return ByteString( "Stamp" ); }
- const ByteString Lockfile::Timekey()
- { return ByteString( "Time" ); }
- const ByteString Lockfile::IPCkey()
- { return ByteString( "IPCServer" ); }
+namespace desktop {
Lockfile::Lockfile( bool bIPCserver )
:m_bIPCserver(bIPCserver)
@@ -78,7 +93,7 @@ namespace desktop {
// build the file-url to use for the lock
OUString aUserPath;
utl::Bootstrap::locateUserInstallation( aUserPath );
- m_aLockname = aUserPath + Suffix();
+ m_aLockname = aUserPath + LOCKFILE_SUFFIX;
// generate ID
const int nIdBytes = 16;
@@ -105,7 +120,7 @@ namespace desktop {
// try to create file
File aFile(m_aLockname);
- if (aFile.open( OpenFlag_Create ) == File::E_EXIST) {
+ if (aFile.open( osl_File_OpenFlag_Create ) == File::E_EXIST) {
m_bIsLocked = sal_True;
} else {
// new lock created
@@ -125,7 +140,7 @@ namespace desktop {
// remove file and create new
File::remove( m_aLockname );
File aFile(m_aLockname);
- aFile.open( OpenFlag_Create );
+ aFile.open( osl_File_OpenFlag_Create );
aFile.close( );
syncToFile( );
m_bRemove = sal_True;
@@ -148,38 +163,22 @@ namespace desktop {
// to assume that it is a stale lockfile which can be overwritten
String aLockname = m_aLockname;
Config aConfig(aLockname);
- aConfig.SetGroup(Group());
- ByteString aIPCserver = aConfig.ReadKey( IPCkey() );
- if (! aIPCserver.EqualsIgnoreCaseAscii( "true" ))
+ aConfig.SetGroup(LOCKFILE_GROUP);
+ rtl::OString aIPCserver = aConfig.ReadKey( LOCKFILE_IPCKEY );
+ if (!aIPCserver.equalsIgnoreAsciiCase(rtl::OString("true")))
return false;
- ByteString aHost = aConfig.ReadKey( Hostkey() );
- ByteString aUser = aConfig.ReadKey( Userkey() );
+ rtl::OString aHost = aConfig.ReadKey( LOCKFILE_HOSTKEY );
+ rtl::OString aUser = aConfig.ReadKey( LOCKFILE_USERKEY );
+
// lockfile from same host?
- ByteString myHost;
-#ifdef WNT
- /*
- prevent windows from connecting to the net to get it's own
- hostname by using the netbios name
- */
- sal_Int32 sz = MAX_COMPUTERNAME_LENGTH + 1;
- char* szHost = new char[sz];
- if (GetComputerName(szHost, (LPDWORD)&sz))
- myHost = OString(szHost);
- else
- myHost = OString("UNKNOWN");
- delete[] szHost;
-#else
- oslSocketResult sRes;
- myHost = OUStringToOString(
- SocketAddr::getLocalHostname( &sRes ), RTL_TEXTENCODING_ASCII_US );
-#endif
+ rtl::OString myHost( impl_getHostname() );
if (aHost == myHost) {
// lockfile by same UID
OUString myUserName;
Security aSecurity;
aSecurity.getUserName( myUserName );
- ByteString myUser = OUStringToOString( myUserName, RTL_TEXTENCODING_ASCII_US );
+ rtl::OString myUser(rtl::OUStringToOString(myUserName, RTL_TEXTENCODING_ASCII_US));
if (aUser == myUser)
return sal_True;
}
@@ -190,42 +189,25 @@ namespace desktop {
{
String aLockname = m_aLockname;
Config aConfig(aLockname);
- aConfig.SetGroup(Group());
+ aConfig.SetGroup(LOCKFILE_GROUP);
// get information
- ByteString aHost;
-#ifdef WNT
- /*
- prevent windows from connecting to the net to get it's own
- hostname by using the netbios name
- */
- sal_Int32 sz = MAX_COMPUTERNAME_LENGTH + 1;
- char* szHost = new char[sz];
- if (GetComputerName(szHost, (LPDWORD)&sz))
- aHost = OString(szHost);
- else
- aHost = OString("UNKNOWN");
- delete[] szHost;
-#else
- oslSocketResult sRes;
- aHost = OUStringToOString(
- SocketAddr::getLocalHostname( &sRes ), RTL_TEXTENCODING_ASCII_US );
-#endif
+ rtl::OString aHost( impl_getHostname() );
OUString aUserName;
Security aSecurity;
aSecurity.getUserName( aUserName );
- ByteString aUser = OUStringToOString( aUserName, RTL_TEXTENCODING_ASCII_US );
- ByteString aTime = OUStringToOString( m_aDate, RTL_TEXTENCODING_ASCII_US );
- ByteString aStamp = OUStringToOString( m_aId, RTL_TEXTENCODING_ASCII_US );
+ rtl::OString aUser = OUStringToOString( aUserName, RTL_TEXTENCODING_ASCII_US );
+ rtl::OString aTime = OUStringToOString( m_aDate, RTL_TEXTENCODING_ASCII_US );
+ rtl::OString aStamp = OUStringToOString( m_aId, RTL_TEXTENCODING_ASCII_US );
// write information
- aConfig.WriteKey( Userkey(), aUser );
- aConfig.WriteKey( Hostkey(), aHost );
- aConfig.WriteKey( Stampkey(), aStamp );
- aConfig.WriteKey( Timekey(), aTime );
+ aConfig.WriteKey( LOCKFILE_USERKEY, aUser );
+ aConfig.WriteKey( LOCKFILE_HOSTKEY, aHost );
+ aConfig.WriteKey( LOCKFILE_STAMPKEY, aStamp );
+ aConfig.WriteKey( LOCKFILE_TIMEKEY, aTime );
aConfig.WriteKey(
- IPCkey(),
- m_bIPCserver ? ByteString("true") : ByteString("false") );
+ LOCKFILE_IPCKEY,
+ m_bIPCserver ? rtl::OString("true") : rtl::OString("false") );
aConfig.Flush( );
}
@@ -254,3 +236,4 @@ namespace desktop {
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/lockfile.hxx b/desktop/source/app/lockfile.hxx
index 248e44c52160..5444714ec88c 100644..100755
--- a/desktop/source/app/lockfile.hxx
+++ b/desktop/source/app/lockfile.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,6 +46,14 @@
class ByteString;
+#define LOCKFILE_SUFFIX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/.lock" ) )
+#define LOCKFILE_GROUP ByteString( "Lockdata" )
+#define LOCKFILE_USERKEY ByteString( "User" )
+#define LOCKFILE_HOSTKEY ByteString( "Host" )
+#define LOCKFILE_STAMPKEY ByteString( "Stamp" )
+#define LOCKFILE_TIMEKEY ByteString( "Time" )
+#define LOCKFILE_IPCKEY ByteString( "IPCServer" )
+
namespace desktop {
class Lockfile;
@@ -71,15 +80,6 @@ namespace desktop {
~Lockfile(void);
private:
- // data in lockfile
- static const ByteString Group();
- static const ByteString Userkey();
- static const ByteString Hostkey();
- static const ByteString Stampkey();
- static const ByteString Timekey();
- static const ByteString IPCkey();
- // lockfilename
- static const rtl::OUString Suffix();
bool m_bIPCserver;
// full qualified name (file://-url) of the lockfile
rtl::OUString m_aLockname;
@@ -97,3 +97,5 @@ namespace desktop {
};
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/lockfile2.cxx b/desktop/source/app/lockfile2.cxx
index c155d9e6a3cd..619102b70c2b 100644..100755
--- a/desktop/source/app/lockfile2.cxx
+++ b/desktop/source/app/lockfile2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,11 +43,11 @@ bool Lockfile_execWarning( Lockfile * that )
// read information from lock
String aLockname = that->m_aLockname;
Config aConfig(aLockname);
- aConfig.SetGroup(that->Group());
- ByteString aHost = aConfig.ReadKey( that->Hostkey() );
- ByteString aUser = aConfig.ReadKey( that->Userkey() );
- ByteString aStamp = aConfig.ReadKey( that->Stampkey() );
- ByteString aTime = aConfig.ReadKey( that->Timekey() );
+ aConfig.SetGroup( LOCKFILE_GROUP );
+ ByteString aHost = aConfig.ReadKey( LOCKFILE_HOSTKEY );
+ ByteString aUser = aConfig.ReadKey( LOCKFILE_USERKEY );
+ ByteString aStamp = aConfig.ReadKey( LOCKFILE_STAMPKEY );
+ ByteString aTime = aConfig.ReadKey( LOCKFILE_TIMEKEY );
// display warning and return response
QueryBox aBox( NULL, DesktopResId( QBX_USERDATALOCKED ) );
@@ -68,3 +69,4 @@ bool Lockfile_execWarning( Lockfile * that )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/main.c b/desktop/source/app/main.c
index dceaf1a3fba1..88610ba18ef9 100644..100755
--- a/desktop/source/app/main.c
+++ b/desktop/source/app/main.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,3 +35,5 @@
SAL_IMPLEMENT_MAIN() {
return soffice_main();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk
index 085d8520e7ad..e7c30a2ca70f 100644..100755
--- a/desktop/source/app/makefile.mk
+++ b/desktop/source/app/makefile.mk
@@ -53,6 +53,10 @@ CFLAGS+=-DGNOME_VFS_ENABLED
# DEPLOYMENTMISCLIB = -ldeploymentmisc$(DLLPOSTFIX)
# .ENDIF
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2" || "$(GUIBASE)"=="aqua" || "$(ENABLE_SYSTRAY_GTK)"=="TRUE"
+CFLAGS+=-DENABLE_QUICKSTART_APPLET
+.ENDIF
+
SHL1TARGET = sofficeapp
SHL1OBJS = \
$(SLO)$/app.obj \
@@ -91,7 +95,7 @@ SHL1STDLIBS = \
$(UCBHELPERLIB) \
$(UNOTOOLSLIB) \
$(VCLLIB) \
- $(VOSLIB)
+
SHL1VERSIONMAP = version.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index 5527b8ea2aea..6088ee383022 100644..100755
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#include "dispatchwatcher.hxx"
#include <memory>
#include <stdio.h>
-#include <vos/process.hxx>
+#include <osl/process.h>
#include <unotools/bootstrap.hxx>
#include <vcl/svapp.hxx>
#include <vcl/help.hxx>
@@ -48,17 +49,19 @@
#include <rtl/bootstrap.hxx>
#include <rtl/strbuf.hxx>
#include <comphelper/processfactory.hxx>
-#include "osl/file.hxx"
+#include <osl/file.hxx>
#include "rtl/process.h"
#include "tools/getprocessworkingdir.hxx"
-using namespace vos;
-using namespace rtl;
using namespace desktop;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::frame;
+using ::rtl::OString;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
const char *OfficeIPCThread::sc_aTerminationSequence = "InternalIPC::TerminateThread";
const int OfficeIPCThread::sc_nTSeqLength = 28;
const char *OfficeIPCThread::sc_aShowSequence = "-tofront";
@@ -219,14 +222,17 @@ bool addArgument(
}
OfficeIPCThread* OfficeIPCThread::pGlobalOfficeIPCThread = 0;
-namespace { struct Security : public rtl::Static<OSecurity, Security> {}; }
+ namespace { struct Security : public rtl::Static<osl::Security, Security> {}; }
::osl::Mutex* OfficeIPCThread::pOfficeIPCThreadMutex = 0;
-
+// Turns a string in aMsg such as file:///home/foo/.libreoffice/3
+// Into a hex string of well known length ff132a86...
String CreateMD5FromString( const OUString& aMsg )
{
- // PRE: aStr "file"
- // BACK: Str "ababab....0f" Hexcode String
+#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
+ fprintf (stderr, "create md5 frim '%s'\n",
+ (const sal_Char *)rtl::OUStringToOString (aMsg, RTL_TEXTENCODING_UTF8));
+#endif
rtlDigest handle = rtl_digest_create( rtl_Digest_AlgorithmMD5 );
if ( handle > 0 )
@@ -291,11 +297,11 @@ void ImplPostProcessDocumentsEvent( ProcessDocumentsRequest* pEvent )
Application::PostUserEvent( STATIC_LINK( NULL, ProcessEventsClass_Impl, ProcessDocumentsEvent ), pEvent );
}
-OSignalHandler::TSignalAction SAL_CALL SalMainPipeExchangeSignalHandler::signal(TSignalInfo *pInfo)
+oslSignalAction SAL_CALL SalMainPipeExchangeSignal_impl(void* /*pData*/, oslSignalInfo* pInfo)
{
if( pInfo->Signal == osl_Signal_Terminate )
OfficeIPCThread::DisableOfficeIPCThread();
- return (TAction_CallNextHandler);
+ return osl_Signal_ActCallNextHdl;
}
// ----------------------------------------------------------------------------
@@ -433,7 +439,6 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
::rtl::OUString aUserInstallPath;
::rtl::OUString aDummy;
- ::vos::OStartupInfo aInfo;
OfficeIPCThread* pThread = new OfficeIPCThread;
pThread->maPipeIdent = OUString( RTL_CONSTASCII_USTRINGPARAM( "SingleOfficeIPC_" ) );
@@ -457,7 +462,8 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
OUString aIniName;
- aInfo.getExecutableFile( aIniName );
+ osl_getExecutableFile( &aIniName.pData );
+
sal_uInt32 lastIndex = aIniName.lastIndexOf('/');
if ( lastIndex > 0 )
{
@@ -480,7 +486,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
OUString aUserInstallPathHashCode;
- if ( aPreloadData.equalsAscii( "1" ))
+ if ( aPreloadData.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "1" ) ))
{
sal_Char szBuffer[32];
sprintf( szBuffer, "%d", SUPD );
@@ -499,22 +505,22 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
PipeMode nPipeMode = PIPEMODE_DONTKNOW;
do
{
- OSecurity &rSecurity = Security::get();
+ osl::Security &rSecurity = Security::get();
// Try to create pipe
- if ( pThread->maPipe.create( pThread->maPipeIdent.getStr(), OPipe::TOption_Create, rSecurity ))
+ if ( pThread->maPipe.create( pThread->maPipeIdent.getStr(), osl_Pipe_CREATE, rSecurity ))
{
// Pipe created
nPipeMode = PIPEMODE_CREATED;
}
- else if( pThread->maPipe.create( pThread->maPipeIdent.getStr(), OPipe::TOption_Open, rSecurity )) // Creation not successfull, now we try to connect
+ else if( pThread->maPipe.create( pThread->maPipeIdent.getStr(), osl_Pipe_OPEN, rSecurity )) // Creation not successfull, now we try to connect
{
// Pipe connected to first office
nPipeMode = PIPEMODE_CONNECTED;
}
else
{
- OPipe::TPipeError eReason = pThread->maPipe.getError();
- if ((eReason == OPipe::E_ConnectionRefused) || (eReason == OPipe::E_invalidError))
+ oslPipeError eReason = pThread->maPipe.getError();
+ if ((eReason == osl_Pipe_E_ConnectionRefused) || (eReason == osl_Pipe_E_invalidError))
return IPC_STATUS_BOOTSTRAP_ERROR;
// Wait for second office to be ready
@@ -535,12 +541,11 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
else
{
// Seems another office is running. Pipe arguments to it and self terminate
- pThread->maStreamPipe = pThread->maPipe;
+ osl::StreamPipe aStreamPipe(pThread->maPipe.getHandle());
- sal_Bool bWaitBeforeClose = sal_False;
ByteString aArguments(RTL_CONSTASCII_STRINGPARAM(ARGUMENT_PREFIX));
rtl::OUString cwdUrl;
- if (!(tools::getProcessWorkingDir(&cwdUrl) &&
+ if (!(tools::getProcessWorkingDir(cwdUrl) &&
addArgument(&aArguments, '1', cwdUrl)))
{
aArguments += '0';
@@ -549,22 +554,18 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
for( sal_uInt32 i=0; i < nCount; i++ )
{
rtl_getAppCommandArg( i, &aDummy.pData );
- if( aDummy.indexOf('-',0) != 0 )
- {
- bWaitBeforeClose = sal_True;
- }
if (!addArgument(&aArguments, ',', aDummy)) {
return IPC_STATUS_BOOTSTRAP_ERROR;
}
}
- // finaly, write the string onto the pipe
- pThread->maStreamPipe.write( aArguments.GetBuffer(), aArguments.Len() );
- pThread->maStreamPipe.write( "\0", 1 );
+ // finally, write the string onto the pipe
+ aStreamPipe.write( aArguments.GetBuffer(), aArguments.Len() );
+ aStreamPipe.write( "\0", 1 );
// wait for confirmation #95361# #95425#
ByteString aToken(sc_aConfirmationSequence);
char *aReceiveBuffer = new char[aToken.Len()+1];
- int n = pThread->maStreamPipe.read( aReceiveBuffer, aToken.Len() );
+ int n = aStreamPipe.read( aReceiveBuffer, aToken.Len() );
aReceiveBuffer[n]='\0';
delete pThread;
@@ -593,15 +594,15 @@ void OfficeIPCThread::DisableOfficeIPCThread()
// send thread a termination message
// this is done so the subsequent join will not hang
// because the thread hangs in accept of pipe
- OPipe Pipe( pOfficeIPCThread->maPipeIdent, OPipe::TOption_Open, Security::get() );
+ osl::StreamPipe aPipe ( pOfficeIPCThread->maPipeIdent, osl_Pipe_OPEN, Security::get() );
//Pipe.send( TERMINATION_SEQUENCE, TERMINATION_LENGTH );
- if (Pipe.isValid())
+ if (aPipe.is())
{
- Pipe.send( sc_aTerminationSequence, sc_nTSeqLength+1 ); // also send 0-byte
+ aPipe.send( sc_aTerminationSequence, sc_nTSeqLength+1 ); // also send 0-byte
// close the pipe so that the streampipe on the other
// side produces EOF
- Pipe.close();
+ aPipe.close();
}
// release mutex to avoid deadlocks
@@ -656,11 +657,10 @@ void SAL_CALL OfficeIPCThread::run()
{
do
{
- OPipe::TPipeError
- nError = maPipe.accept( maStreamPipe );
+ oslPipeError nError = maPipe.accept( maStreamPipe );
- if( nError == OStreamPipe::E_None )
+ if( nError == osl_Pipe_E_None )
{
// #111143# and others:
@@ -726,14 +726,12 @@ void SAL_CALL OfficeIPCThread::run()
}
// handle request for acceptor
- sal_Bool bAcceptorRequest = sal_False;
OUString aAcceptString;
if ( aCmdLineArgs->GetAcceptString(aAcceptString) && Desktop::CheckOEM()) {
ApplicationEvent* pAppEvent =
new ApplicationEvent( aEmpty, aEmpty,
"ACCEPT", aAcceptString );
ImplPostForeignAppEvent( pAppEvent );
- bAcceptorRequest = sal_True;
}
// handle acceptor removal
OUString aUnAcceptString;
@@ -742,7 +740,6 @@ void SAL_CALL OfficeIPCThread::run()
new ApplicationEvent( aEmpty, aEmpty,
"UNACCEPT", aUnAcceptString );
ImplPostForeignAppEvent( pAppEvent );
- bAcceptorRequest = sal_True;
}
#ifndef UNX
@@ -904,9 +901,6 @@ void SAL_CALL OfficeIPCThread::run()
while (
(nResult = maStreamPipe.send(sc_aConfirmationSequence+nBytes, sc_nCSeqLength-nBytes))>0 &&
((nBytes += nResult) < sc_nCSeqLength) ) ;
- // now we can close, don't we?
- // maStreamPipe.close();
-
}
else
{
@@ -916,7 +910,7 @@ void SAL_CALL OfficeIPCThread::run()
TimeValue tval;
tval.Seconds = 1;
tval.Nanosec = 0;
- sleep( tval );
+ wait( tval );
}
} while( schedule() );
}
@@ -943,6 +937,62 @@ static void AddToDispatchList(
}
}
+static void AddConversionsToDispatchList(
+ DispatchWatcher::DispatchList& rDispatchList,
+ boost::optional< rtl::OUString > const & cwdUrl,
+ const OUString& rRequestList,
+ const OUString& rParam,
+ const OUString& rPrinterName,
+ const OUString& rFactory,
+ const OUString& rParamOut )
+{
+ DispatchWatcher::RequestType nType;
+ OUString aParam( rParam );
+
+ if( rParam.getLength() )
+ {
+ nType = DispatchWatcher::REQUEST_CONVERSION;
+ aParam = rParam;
+ }
+ else
+ {
+ nType = DispatchWatcher::REQUEST_BATCHPRINT;
+ aParam = rPrinterName;
+ }
+
+ OUString aOutDir( rParamOut.trim() );
+ ::rtl::OUString aPWD;
+ ::tools::getProcessWorkingDir( aPWD );
+
+ if( !::osl::FileBase::getAbsoluteFileURL( aPWD, rParamOut, aOutDir ) )
+ ::osl::FileBase::getSystemPathFromFileURL( aOutDir, aOutDir );
+
+ if( rParamOut.trim().getLength() )
+ {
+ aParam += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
+ aParam += aOutDir;
+ }
+ else
+ {
+ ::osl::FileBase::getSystemPathFromFileURL( aPWD, aPWD );
+ aParam += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ";" )) + aPWD;
+ }
+
+ if ( rRequestList.getLength() > 0 )
+ {
+ sal_Int32 nIndex = 0;
+ do
+ {
+ OUString aToken = rRequestList.getToken( 0, APPEVENT_PARAM_DELIMITER, nIndex );
+ if ( aToken.getLength() > 0 )
+ rDispatchList.push_back(
+ DispatchWatcher::DispatchRequest( nType, aToken, cwdUrl, aParam, rFactory ));
+ }
+ while ( nIndex >= 0 );
+ }
+}
+
+
sal_Bool OfficeIPCThread::ExecuteCmdLineRequests( ProcessDocumentsRequest& aRequest )
{
// protect the dispatch list
@@ -952,6 +1002,7 @@ sal_Bool OfficeIPCThread::ExecuteCmdLineRequests( ProcessDocumentsRequest& aRequ
rtl::OUString aEmpty;
// Create dispatch list for dispatch watcher
+ AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aInFilter, DispatchWatcher::REQUEST_INFILTER, aEmpty, aRequest.aModule );
AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aOpenList, DispatchWatcher::REQUEST_OPEN, aEmpty, aRequest.aModule );
AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aViewList, DispatchWatcher::REQUEST_VIEW, aEmpty, aRequest.aModule );
AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aStartList, DispatchWatcher::REQUEST_START, aEmpty, aRequest.aModule );
@@ -959,7 +1010,7 @@ sal_Bool OfficeIPCThread::ExecuteCmdLineRequests( ProcessDocumentsRequest& aRequ
AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aPrintToList, DispatchWatcher::REQUEST_PRINTTO, aRequest.aPrinterName, aRequest.aModule );
AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aForceOpenList, DispatchWatcher::REQUEST_FORCEOPEN, aEmpty, aRequest.aModule );
AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aForceNewList, DispatchWatcher::REQUEST_FORCENEW, aEmpty, aRequest.aModule );
-
+ AddConversionsToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aConversionList, aRequest.aConversionParams, aRequest.aPrinterName, aRequest.aModule, aRequest.aConversionOut );
sal_Bool bShutdown( sal_False );
if ( pGlobalOfficeIPCThread )
@@ -992,3 +1043,5 @@ sal_Bool OfficeIPCThread::ExecuteCmdLineRequests( ProcessDocumentsRequest& aRequ
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx
index 8f3ddffe8e0a..e50e46c280ea 100644..100755
--- a/desktop/source/app/officeipcthread.hxx
+++ b/desktop/source/app/officeipcthread.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,24 +31,19 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/frame/XTerminateListener.hpp>
-#include <vos/pipe.hxx>
-#include <vos/security.hxx>
-#include <vos/thread.hxx>
-#include <vos/signal.hxx>
+#include <osl/pipe.hxx>
+#include <osl/security.hxx>
+#include <osl/signal.h>
#include <rtl/ustring.hxx>
-#ifndef _CPPUHELPER_WEAKBASE2_HXX_
#include <cppuhelper/implbase2.hxx>
-#endif
#include <osl/conditn.hxx>
+#include <osl/thread.hxx>
#include "boost/optional.hpp"
namespace desktop
{
-class SalMainPipeExchangeSignalHandler : public vos::OSignalHandler
-{
- virtual TSignalAction SAL_CALL signal(TSignalInfo *pInfo);
-};
+oslSignalAction SAL_CALL SalMainPipeExchangeSignal_impl(void* /*pData*/, oslSignalInfo* pInfo);
// A request for the current office
// that was given by command line or by IPC pipe communication.
@@ -66,18 +62,22 @@ struct ProcessDocumentsRequest
::rtl::OUString aForceNewList; // Documents that should be forced to create a new document
::rtl::OUString aPrinterName; // The printer name that should be used for printing
::rtl::OUString aPrintToList; // Documents that should be printed on the given printer
+ ::rtl::OUString aConversionList;
+ ::rtl::OUString aConversionParams;
+ ::rtl::OUString aConversionOut;
+ ::rtl::OUString aInFilter;
::osl::Condition *pcProcessed; // pointer condition to be set when the request has been processed
};
class DispatchWatcher;
-class OfficeIPCThread : public vos::OThread
+class OfficeIPCThread : public osl::Thread
{
private:
static OfficeIPCThread* pGlobalOfficeIPCThread;
static ::osl::Mutex* pOfficeIPCThreadMutex;
- vos::OPipe maPipe;
- vos::OStreamPipe maStreamPipe;
+ osl::Pipe maPipe;
+ osl::StreamPipe maStreamPipe;
rtl::OUString maPipeIdent;
bool mbDowning;
bool mbRequestsEnabled;
@@ -163,3 +163,5 @@ class OfficeIPCThreadController : public ::cppu::WeakImplHelper2<
}
#endif // _DESKTOP_OFFICEIPCTHREAD_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/omutexmember.hxx b/desktop/source/app/omutexmember.hxx
index 1edb90fec8c6..175eae09fe93 100644..100755
--- a/desktop/source/app/omutexmember.hxx
+++ b/desktop/source/app/omutexmember.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -59,3 +60,5 @@ struct OMutexMember
};
#endif // #ifndef __FRAMEWORK_OMUTEXMEMBER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index ea4e2c7f3757..a4207ef97bfd 100644..100755
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,11 +30,13 @@
#include "precompiled_desktop.hxx"
#include "app.hxx"
+#include "cmdlineargs.hxx"
+#include "cmdlinehelp.hxx"
#include <rtl/logfile.hxx>
#include <tools/extendapplicationenvironment.hxx>
-sal_Bool SVMain();
+int SVMain();
// -=-= main() -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -46,7 +49,23 @@ extern "C" int soffice_main()
desktop::Desktop aDesktop;
// This string is used during initialization of the Gtk+ VCL module
aDesktop.SetAppName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("soffice")) );
- SVMain();
-
- return 0;
+ aDesktop.CreateProcessServiceFactory();
+#ifdef UNX
+ // handle --version and --help already here, otherwise they would be handled
+ // after VCL initialization that might fail if $DISPLAY is not set
+ desktop::CommandLineArgs* pCmdLineArgs = aDesktop.GetCommandLineArgs();
+ if ( pCmdLineArgs->IsHelp() )
+ {
+ desktop::displayCmdlineHelp();
+ return EXIT_SUCCESS;
+ }
+ else if ( pCmdLineArgs->IsVersion() )
+ {
+ desktop::displayVersion();
+ return EXIT_SUCCESS;
+ }
+#endif
+ return SVMain();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/sofficemain.h b/desktop/source/app/sofficemain.h
index 97775acd7016..539988834a02 100644..100755
--- a/desktop/source/app/sofficemain.h
+++ b/desktop/source/app/sofficemain.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,3 +42,5 @@ int soffice_main(void);
#endif
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx
index 546a6f0ad13c..bc7a1219cdaa 100644..100755
--- a/desktop/source/app/userinstall.cxx
+++ b/desktop/source/app/userinstall.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,18 +40,13 @@
#include <osl/mutex.hxx>
#include <osl/process.h>
#include <osl/diagnose.h>
-#include <vos/security.hxx>
-#include <vos/ref.hxx>
-#include <vos/process.hxx>
+#include <osl/security.hxx>
+#include <rtl/ref.hxx>
-#ifndef _TOOLS_RESMGR_HXX_
#include <tools/resmgr.hxx>
-#endif
#include <unotools/bootstrap.hxx>
#include <svl/languageoptions.hxx>
-#ifndef _SVTOOLS_SYSLOCALEOPTIONSOPTIONS_HXX
#include <unotools/syslocaleoptions.hxx>
-#endif
#include <comphelper/processfactory.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -67,7 +63,8 @@
#include "app.hxx"
-using namespace rtl;
+using rtl::OString;
+using rtl::OUString;
using namespace osl;
using namespace utl;
using namespace com::sun::star::container;
@@ -100,11 +97,6 @@ namespace desktop {
theMSF->createInstance(sConfigSrvc), UNO_QUERY_THROW);
// localize the provider to user selection
-// Reference< XLocalizable > localizable(theConfigProvider, UNO_QUERY_THROW);
-// LanguageType aUserLanguageType = LanguageSelection::getLanguageType();
-// Locale aLocale( MsLangId::convertLanguageToIsoString(aUserLanguageType));
-// localizable->setLocale(aLocale);
-
Reference< XLocalizable > localizable(theConfigProvider, UNO_QUERY_THROW);
OUString aUserLanguage = LanguageSelection::getLanguageString();
Locale aLocale = LanguageSelection::IsoStringToLocale(aUserLanguage);
@@ -112,8 +104,8 @@ namespace desktop {
Sequence< Any > theArgs(1);
NamedValue v;
- v.Name = OUString::createFromAscii("NodePath");
- v.Value = makeAny(OUString::createFromAscii("org.openoffice.Setup"));
+ v.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath"));
+ v.Value = makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup")));
theArgs[0] <<= v;
Reference< XHierarchicalNameAccess> hnacc(
theConfigProvider->createInstanceWithArguments(
@@ -205,7 +197,7 @@ namespace desktop {
rtl::OUString itemname = aFileStatus.getFileName();
// append trailing '/' if needed
if (newDstUnqPath.lastIndexOf(sal_Unicode('/')) != newDstUnqPath.getLength()-1)
- newDstUnqPath += rtl::OUString::createFromAscii("/");
+ newDstUnqPath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
newDstUnqPath += itemname;
// recursion
err = copy_recursive(newSrcUnqPath, newDstUnqPath);
@@ -246,6 +238,11 @@ namespace desktop {
FileBase::RC rc = Directory::createPath(aUserPath);
if ((rc != FileBase::E_None) && (rc != FileBase::E_EXIST)) return UserInstall::E_Creation;
+#ifdef UNIX
+ // set safer permissions for the user directory by default
+ File::setAttributes(aUserPath, Attribute_OwnWrite| Attribute_OwnRead| Attribute_OwnExe);
+#endif
+
// copy data from shared data directory of base installation
for (sal_Int32 i=0; pszSrcList[i]!=NULL && pszDstList[i]!=NULL; i++)
{
@@ -264,21 +261,19 @@ namespace desktop {
}
try
{
- OUString sConfigSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider");
- OUString sAccessSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess");
+ OUString sConfigSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"));
+ OUString sAccessSrvc(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess"));
// get configuration provider
Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory();
Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
theMSF->createInstance(sConfigSrvc), UNO_QUERY_THROW);
Sequence< Any > theArgs(1);
- NamedValue v(OUString::createFromAscii("NodePath"), makeAny(OUString::createFromAscii("org.openoffice.Setup")));
- //v.Name = OUString::createFromAscii("NodePath");
- //v.Value = makeAny(OUString::createFromAscii("org.openoffice.Setup"));
+ NamedValue v(OUString(RTL_CONSTASCII_USTRINGPARAM("NodePath")), makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup"))));
theArgs[0] <<= v;
Reference< XHierarchicalPropertySet> hpset(
theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
- hpset->setHierarchicalPropertyValue(OUString::createFromAscii("Office/ooSetupInstCompleted"), makeAny(sal_True));
+ hpset->setHierarchicalPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Office/ooSetupInstCompleted")), makeAny(sal_True));
Reference< XChangesBatch >(hpset, UNO_QUERY_THROW)->commitChanges();
}
catch ( PropertyVetoException& )
@@ -299,3 +294,4 @@ namespace desktop {
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/userinstall.hxx b/desktop/source/app/userinstall.hxx
index 8d6a51cd66be..6dcb5e91db41 100644..100755
--- a/desktop/source/app/userinstall.hxx
+++ b/desktop/source/app/userinstall.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,3 +51,5 @@ public:
static UserInstallError finalize();
};
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/version.map b/desktop/source/app/version.map
index 0ffffcd58635..0ffffcd58635 100644..100755
--- a/desktop/source/app/version.map
+++ b/desktop/source/app/version.map