summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/app.cxx255
-rw-r--r--desktop/source/app/appfirststart.cxx126
-rw-r--r--desktop/source/app/appinit.cxx53
-rw-r--r--desktop/source/app/appinit.hxx3
-rw-r--r--desktop/source/app/appsys.cxx2
-rw-r--r--desktop/source/app/appsys.hxx3
-rwxr-xr-xdesktop/source/app/check_ext_deps.cxx19
-rw-r--r--desktop/source/app/checkinstall.cxx3
-rw-r--r--desktop/source/app/checkinstall.hxx3
-rw-r--r--desktop/source/app/cmdlineargs.cxx218
-rw-r--r--desktop/source/app/cmdlineargs.hxx16
-rw-r--r--desktop/source/app/cmdlinehelp.cxx111
-rw-r--r--desktop/source/app/cmdlinehelp.hxx6
-rw-r--r--desktop/source/app/configinit.cxx4
-rw-r--r--desktop/source/app/configinit.hxx3
-rw-r--r--desktop/source/app/copyright_ascii_ooo.c2
-rw-r--r--desktop/source/app/copyright_ascii_sun.c2
-rw-r--r--desktop/source/app/desktopcontext.cxx5
-rw-r--r--desktop/source/app/desktopcontext.hxx3
-rw-r--r--desktop/source/app/desktopresid.cxx3
-rw-r--r--desktop/source/app/desktopresid.hxx3
-rw-r--r--desktop/source/app/dispatchwatcher.cxx269
-rw-r--r--desktop/source/app/dispatchwatcher.hxx10
-rw-r--r--desktop/source/app/langselect.cxx19
-rw-r--r--desktop/source/app/langselect.hxx3
-rw-r--r--desktop/source/app/lockfile.cxx130
-rw-r--r--desktop/source/app/lockfile.hxx20
-rw-r--r--desktop/source/app/lockfile2.cxx12
-rw-r--r--desktop/source/app/main.c3
-rw-r--r--desktop/source/app/makefile.mk2
-rw-r--r--desktop/source/app/officeipcthread.cxx148
-rw-r--r--desktop/source/app/officeipcthread.hxx28
-rw-r--r--desktop/source/app/omutexmember.hxx3
-rw-r--r--desktop/source/app/sofficemain.cxx27
-rw-r--r--desktop/source/app/sofficemain.h3
-rw-r--r--desktop/source/app/userinstall.cxx38
-rw-r--r--desktop/source/app/userinstall.hxx3
-rw-r--r--desktop/source/deployment/dp_log.cxx2
-rw-r--r--desktop/source/deployment/dp_persmap.cxx2
-rw-r--r--desktop/source/deployment/dp_services.cxx2
-rw-r--r--desktop/source/deployment/dp_xml.cxx1
-rw-r--r--desktop/source/deployment/gui/descedit.cxx2
-rw-r--r--desktop/source/deployment/gui/descedit.hxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui.h3
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui.hrc9
-rw-r--r--desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx3
-rw-r--r--desktop/source/deployment/gui/dp_gui_backend.src45
-rw-r--r--desktop/source/deployment/gui/dp_gui_dependencydialog.cxx3
-rw-r--r--desktop/source/deployment/gui/dp_gui_dependencydialog.hxx5
-rwxr-xr-x[-rw-r--r--]desktop/source/deployment/gui/dp_gui_dialog.src53
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_dialog2.cxx49
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.hxx3
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.src16
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx77
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx3
-rw-r--r--desktop/source/deployment/gui/dp_gui_service.cxx14
-rw-r--r--desktop/source/deployment/gui/dp_gui_shared.hxx3
-rw-r--r--desktop/source/deployment/gui/dp_gui_system.cxx59
-rw-r--r--desktop/source/deployment/gui/dp_gui_system.hxx37
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_theextmgr.cxx18
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_theextmgr.hxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_thread.cxx3
-rw-r--r--desktop/source/deployment/gui/dp_gui_thread.hxx3
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_updatedata.hxx3
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_updatedialog.cxx17
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_updatedialog.hxx8
-rwxr-xr-xdesktop/source/deployment/gui/dp_gui_updatedialog.src5
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx37
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx5
-rw-r--r--desktop/source/deployment/gui/license_dialog.cxx17
-rw-r--r--desktop/source/deployment/gui/license_dialog.hxx3
-rw-r--r--desktop/source/deployment/gui/makefile.mk1
-rw-r--r--desktop/source/deployment/inc/db.hxx40
-rw-r--r--desktop/source/deployment/inc/dp_dependencies.hxx3
-rw-r--r--desktop/source/deployment/inc/dp_descriptioninfoset.hxx3
-rw-r--r--desktop/source/deployment/inc/dp_identifier.hxx3
-rw-r--r--desktop/source/deployment/inc/dp_interact.h3
-rw-r--r--desktop/source/deployment/inc/dp_misc.h3
-rw-r--r--desktop/source/deployment/inc/dp_misc_api.hxx3
-rw-r--r--desktop/source/deployment/inc/dp_persmap.h3
-rw-r--r--desktop/source/deployment/inc/dp_platform.hxx5
-rw-r--r--desktop/source/deployment/inc/dp_resource.h3
-rw-r--r--desktop/source/deployment/inc/dp_ucb.h3
-rw-r--r--desktop/source/deployment/inc/dp_version.hxx3
-rw-r--r--desktop/source/deployment/inc/dp_xml.h3
-rw-r--r--desktop/source/deployment/manager/dp_activepackages.cxx3
-rw-r--r--desktop/source/deployment/manager/dp_activepackages.hxx3
-rw-r--r--desktop/source/deployment/manager/dp_informationprovider.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_manager.h2
-rw-r--r--desktop/source/deployment/manager/dp_managerfac.cxx2
-rw-r--r--desktop/source/deployment/misc/db.cxx2
-rw-r--r--desktop/source/deployment/misc/dp_dependencies.cxx18
-rw-r--r--desktop/source/deployment/misc/dp_descriptioninfoset.cxx3
-rw-r--r--desktop/source/deployment/misc/dp_identifier.cxx3
-rw-r--r--desktop/source/deployment/misc/dp_interact.cxx2
-rw-r--r--desktop/source/deployment/misc/dp_misc.cxx7
-rw-r--r--desktop/source/deployment/misc/dp_platform.cxx23
-rw-r--r--desktop/source/deployment/misc/dp_resource.cxx2
-rw-r--r--desktop/source/deployment/misc/dp_ucb.cxx3
-rw-r--r--desktop/source/deployment/misc/dp_version.cxx3
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx10
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx14
-rwxr-xr-xdesktop/source/deployment/registry/dp_backend.cxx15
-rw-r--r--desktop/source/deployment/registry/dp_registry.cxx2
-rw-r--r--desktop/source/deployment/registry/executable/dp_executable.cxx6
-rw-r--r--desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx.orig (renamed from desktop/source/migration/migration.hxx)54
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx26
-rwxr-xr-xdesktop/source/deployment/registry/inc/dp_backend.h11
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx7
-rw-r--r--desktop/source/deployment/registry/script/dp_lib_container.cxx8
-rw-r--r--desktop/source/deployment/registry/script/dp_lib_container.h20
-rw-r--r--desktop/source/deployment/registry/script/dp_script.cxx24
-rw-r--r--desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx2
-rw-r--r--desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx6
-rw-r--r--desktop/source/deployment/registry/sfwk/dp_parceldesc.hxx3
-rwxr-xr-xdesktop/source/deployment/registry/sfwk/dp_sfwk.cxx6
-rw-r--r--desktop/source/inc/exithelper.hxx3
-rw-r--r--desktop/source/migration/cfgfilter.hxx173
-rw-r--r--desktop/source/migration/makefile.mk11
-rw-r--r--desktop/source/migration/migration.cxx217
-rw-r--r--desktop/source/migration/migration_impl.hxx13
-rw-r--r--desktop/source/migration/services/autocorrmigration.cxx15
-rw-r--r--desktop/source/migration/services/autocorrmigration.hxx3
-rw-r--r--desktop/source/migration/services/basicmigration.cxx13
-rw-r--r--desktop/source/migration/services/basicmigration.hxx3
-rw-r--r--desktop/source/migration/services/cexports.cxx3
-rw-r--r--desktop/source/migration/services/jvmfwk.cxx14
-rw-r--r--desktop/source/migration/services/jvmfwk.hxx2
-rw-r--r--desktop/source/migration/services/misc.hxx3
-rw-r--r--desktop/source/migration/services/oo3extensionmigration.hxx1
-rw-r--r--[-rwxr-xr-x]desktop/source/migration/services/wordbookmigration.cxx5
-rw-r--r--[-rwxr-xr-x]desktop/source/migration/services/wordbookmigration.hxx3
-rw-r--r--desktop/source/offacc/acceptor.cxx20
-rw-r--r--desktop/source/offacc/acceptor.hxx2
-rw-r--r--desktop/source/pagein/file_image.h3
-rw-r--r--desktop/source/pagein/file_image_unx.c3
-rw-r--r--desktop/source/pagein/makefile.mk1
-rw-r--r--desktop/source/pagein/pagein.c3
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx2
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx2
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_main.c3
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_main.h3
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx3
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_shared.h1
-rw-r--r--desktop/source/so_comp/evaluation.cxx11
-rw-r--r--desktop/source/so_comp/evaluation.hxx3
-rw-r--r--desktop/source/so_comp/oemjob.cxx57
-rw-r--r--desktop/source/so_comp/oemjob.hxx3
-rw-r--r--desktop/source/so_comp/services.cxx20
-rw-r--r--desktop/source/splash/makefile.mk6
-rw-r--r--[-rwxr-xr-x]desktop/source/splash/services_spl.cxx26
-rw-r--r--desktop/source/splash/splash.cxx36
-rw-r--r--desktop/source/splash/splash.hxx10
155 files changed, 1746 insertions, 1404 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 69be935443..7b15ce27d2 100644
--- 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>
@@ -90,7 +91,6 @@
#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 +101,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 +116,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,6 +142,9 @@
#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>
@@ -168,17 +168,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,7 +190,7 @@ 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"));
@@ -221,15 +217,6 @@ ResMgr* Desktop::GetDesktopResManager()
// 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);
@@ -294,7 +281,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 +306,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 )
@@ -740,10 +726,25 @@ void Desktop::Init()
Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager();
if( rSMgr.is() )
{
- ::comphelper::setProcessServiceFactory( rSMgr );
+ ::rtl::OUString aUserLastSyncFilePathURL = getLastSyncFileURLFromUserInstallation();
+ ::rtl::OUString aPreregSyncFilePathURL = getLastSyncFileURLFromBrandInstallation();
+
+ if ( needsSynchronization( aPreregSyncFilePathURL, aUserLastSyncFilePathURL ))
+ {
+ rtl::OUString aUserPath = getUserBundledExtPathURL();
+ rtl::OUString aPreregBundledPath = getBrandSharePreregBundledPathURL();
+
+ // copy bundled folder to the user directory
+ osl::FileBase::RC rc = osl::Directory::createPath(aUserPath);
+ (void) rc;
+ copy_bundled_recursive( aPreregBundledPath, aUserPath, +1 );
+ }
}
- 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 +763,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 +780,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 );
}
}
@@ -814,7 +826,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 +840,7 @@ 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 +893,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 +905,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 +1211,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();
@@ -1286,12 +1284,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 +1317,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();
@@ -1561,12 +1557,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 +1583,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 +1595,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 +1611,12 @@ void Desktop::Main()
{
RegisterServices( xSMgr );
- //SetSplashScreenProgress(15);
+ SetSplashScreenProgress(25);
#ifndef UNX
if ( pCmdLineArgs->IsHelp() ) {
displayCmdlineHelp();
- return;
+ return EXIT_SUCCESS;
}
#endif
@@ -1629,7 +1626,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 +1638,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();
@@ -1680,7 +1679,7 @@ void Desktop::Main()
OUString aTitleString( aTitle );
bCheckOk = CheckInstallation( aTitleString );
if ( !bCheckOk )
- return;
+ return EXIT_FAILURE;
else
aTitle = aTitleString;
@@ -1778,7 +1777,6 @@ void Desktop::Main()
}
SetSplashScreenProgress(50);
-
// Backing Component
sal_Bool bCrashed = sal_False;
sal_Bool bExistsRecoveryData = sal_False;
@@ -1862,12 +1860,12 @@ 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;
}
SvtFontSubstConfig().Apply();
@@ -2111,9 +2109,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
@@ -2126,6 +2122,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 );
@@ -2174,23 +2172,8 @@ void Desktop::SystemSettingsChanging( AllSettings& rSettings, Window* )
hMouseSettings.SetFollow( aAppearanceCfg.IsMenuMouseFollow() ? (nFollow|MOUSE_FOLLOW_MENU) : (nFollow&~MOUSE_FOLLOW_MENU));
rSettings.SetMouseSettings(hMouseSettings);
- BOOL bUseImagesInMenus = hStyleSettings.GetUseImagesInMenus();
-
SvtMenuOptions aMenuOpt;
- nGet = aMenuOpt.GetMenuIconsState();
- switch ( nGet )
- {
- case 0:
- bUseImagesInMenus = FALSE;
- break;
- case 1:
- bUseImagesInMenus = TRUE;
- break;
- case 2:
- default:
- break;
- }
- hStyleSettings.SetUseImagesInMenus(bUseImagesInMenus);
+ hStyleSettings.SetUseImagesInMenus(aMenuOpt.GetMenuIconsState());
hStyleSettings.SetDragFullOptions( nDragFullOptions );
rSettings.SetStyleSettings ( hStyleSettings );
@@ -2227,7 +2210,6 @@ IMPL_LINK( Desktop, OpenClients_Impl, void*, EMPTYARG )
OfficeIPCThread::SetReady();
- // CloseStartupScreen();
CloseSplashScreen();
CheckFirstRun( );
EnableOleAutomation();
@@ -2260,7 +2242,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;
@@ -2517,7 +2499,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 >(
@@ -2528,7 +2510,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 >(
@@ -2539,7 +2521,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 >(
@@ -2550,7 +2532,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 >(
@@ -2561,7 +2543,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 >(
@@ -2571,7 +2553,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 >(
@@ -2582,7 +2564,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 >(
@@ -2593,7 +2575,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 >(
@@ -2604,7 +2586,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 >(
@@ -2676,9 +2658,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 )
{
@@ -2697,7 +2678,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() ||
@@ -2737,14 +2718,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());
}
@@ -2786,7 +2767,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());
}
@@ -2809,7 +2790,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());
}
@@ -2827,7 +2808,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());
}
@@ -2850,6 +2831,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 ||
@@ -2857,7 +2842,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;
@@ -2993,7 +2979,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.
@@ -3214,7 +3200,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;
@@ -3235,17 +3222,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);
}
}
@@ -3280,9 +3271,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&)
{
@@ -3293,8 +3284,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
@@ -3336,3 +3327,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 943f45de2b..8b7c7f16c1 100644
--- 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,67 +49,55 @@ 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()
+/* Local function - get access to the configuration */
+static Reference< XPropertySet > impl_getConfigurationAccess( const OUString& rPath )
{
- // 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 )
+ Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+
+ // get configuration provider
+ Reference< XMultiServiceFactory > xConfigProvider = Reference< XMultiServiceFactory >(
+ xFactory->createInstance( sConfigSrvc ), UNO_QUERY_THROW );
+
+ Sequence< Any > aArgs( 1 );
+ NamedValue aValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NodePath" ) ), makeAny( rPath ) );
+ aArgs[0] <<= aValue;
+ return Reference< XPropertySet >(
+ xConfigProvider->createInstanceWithArguments( sAccessSrvc, aArgs ), UNO_QUERY_THROW );
+}
+
+void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart )
+{
+ if ( bQuickStart )
{
- aLangString += OUString::createFromAscii("-");
- aLangString += aLocale.Country;
- if ( aLocale.Variant.getLength() != 0 )
+ try
+ {
+ Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
+
+ OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) );
+ Any aRestart = xPSet->getPropertyValue( sPropName );
+ sal_Bool bRestart = sal_False;
+ if ( ( aRestart >>= bRestart ) && bRestart )
+ {
+ xPSet->setPropertyValue( sPropName, makeAny( sal_False ) );
+ Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges();
+
+ 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 );
+ xQuickstart->initialize( aSeq );
+ }
+ }
+ catch( uno::Exception& )
{
- aLangString += OUString::createFromAscii("-");
- aLangString += aLocale.Variant;
+ // this is no critical operation so it should not prevent office from starting
}
}
-#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()
+void Desktop::SetRestartState()
{
// Don't show a license
return sal_False;
@@ -117,8 +106,10 @@ sal_Bool Desktop::LicenseNeedsAcceptance()
sal_Int32 nOpenSourceContext = 0;
try
{
- ::utl::ConfigManager::GetDirectConfigProperty(
- ::utl::ConfigManager::OPENSOURCECONTEXT ) >>= nOpenSourceContext;
+ Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) );
+ OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) );
+ xPSet->setPropertyValue( sPropName, makeAny( sal_True ) );
+ Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges();
}
catch( const ::com::sun::star::uno::Exception& ) {}
@@ -160,29 +151,8 @@ static sal_Bool impl_isFirstStart()
return sal_True;
} catch (const Exception&)
{
- return sal_True;
+ // this is no critical operation, ignore the exception
}
-}
-
-/* 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;
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 25798d913f..3ea394beec 100644
--- 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>
@@ -82,7 +83,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;
@@ -107,7 +107,7 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect)
}
rtl::OUString aPipe;
- vos::OSecurity().getUserIdent(aPipe);
+ osl::Security().getUserIdent(aPipe);
rtl::OUStringBuffer aPortal;
if (rPortalConnect.getLength() != 0)
@@ -118,14 +118,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 +145,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,19 +160,18 @@ 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) {
}
@@ -300,7 +277,7 @@ void Desktop::RegisterServices( Reference< XMultiServiceFactory >& xSMgr )
if ( !configureUcb( bServer, aPortalConnect ) )
{
DBG_ERROR( "Can't configure UCB" );
- throw com::sun::star::uno::Exception(rtl::OUString::createFromAscii("RegisterServices, configureUcb"), NULL);
+ throw com::sun::star::uno::Exception(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RegisterServices, configureUcb")), NULL);
}
CreateTemporaryDirectory();
@@ -328,7 +305,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 +459,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 2f3842b676..01aa78857b 100644
--- 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 0c26e694b5..61948550ca 100644
--- 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.
@@ -67,3 +68,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 309f67d308..2dad7b5d71 100644
--- 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 bb946c99e3..c03c498c79 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.
@@ -232,7 +233,7 @@ static sal_Int16 impl_showExtensionDialog( uno::Reference< uno::XComponentContex
uno::Reference< lang::XMultiComponentFactory > xServiceManager( xContext->getServiceManager() );
if( !xServiceManager.is() )
- throw uno::RuntimeException(
+ throw uno::RuntimeException(
UNISTRING( "impl_showExtensionDialog(): unable to obtain service manager from component context" ), uno::Reference< uno::XInterface > () );
xService = xServiceManager->createInstanceWithContext( sServiceName, xContext );
@@ -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
diff --git a/desktop/source/app/checkinstall.cxx b/desktop/source/app/checkinstall.cxx
index 7a0e61d1b0..ee5c96b8c7 100644
--- 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.
@@ -116,3 +117,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 ee33b69898..f37d5ee7ea 100644
--- 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 beb8423814..d1c8255b7b 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -57,7 +57,7 @@ public:
m_index(0)
{
rtl::OUString url;
- if (tools::getProcessWorkingDir(&url)) {
+ if (tools::getProcessWorkingDir(url)) {
m_cwdUrl.reset(url);
}
}
@@ -137,8 +137,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
@@ -163,7 +163,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));
@@ -175,12 +175,13 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
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;
@@ -253,7 +254,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bForceOpenEvent = false;
bDisplaySpec = false;
}
- else if ( aArgStr.EqualsIgnoreCaseAscii( "-display" ))
+ else if ( oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("print-to-file")))
{
// set display
bOpenEvent = false;
@@ -295,18 +296,43 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false;
bDisplaySpec = false;
}
- #endif
}
else
{
if ( bPrinterName && bPrintToEvent )
{
// first argument after "-pt" this must be the printer name
- AddStringListParam_Impl( CMD_STRINGPARAM_PRINTERNAME, aArgStr );
+ AddStringListParam_Impl( CMD_STRINGPARAM_PRINTERNAME, aArg );
bPrinterName = sal_False;
}
+ else if ( bConversionParamsEvent && bConversionEvent )
+ {
+ // first argument must be the the params
+ AddStringListParam_Impl( CMD_STRINGPARAM_CONVERSIONPARAMS, aArg );
+ bConversionParamsEvent = sal_False;
+ }
+ else if ( bBatchPrinterNameEvent && bBatchPrintEvent )
+ {
+ // first argument is the printer name
+ AddStringListParam_Impl( CMD_STRINGPARAM_PRINTERNAME, aArg );
+ bBatchPrinterNameEvent = sal_False;
+ }
+ else if ( (bConversionEvent || bBatchPrintEvent) && bConversionOutEvent )
+ {
+ AddStringListParam_Impl( CMD_STRINGPARAM_CONVERSIONOUT, aArg );
+ bConversionOutEvent = sal_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 )
{
@@ -349,6 +375,8 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
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,55 +402,60 @@ 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 );
@@ -434,70 +467,70 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
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( "quickstart=no" )))
+ {
+ SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_False );
+ }
+ 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( "-?" )))
{
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
@@ -513,21 +546,22 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
#endif
else if ( aArgStr.Copy(0, 8).EqualsIgnoreCaseAscii( "-accept=" ))
{
- 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 )
{
- 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 ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("portal,")))
+ {
+ AddStringListParam_Impl( CMD_STRINGPARAM_PORTAL, oArg.copy(RTL_CONSTASCII_LENGTH("portal,")) );
}
- else if ( aArgStr.Copy( 0, 7 ).EqualsIgnoreCaseAscii( "-userid" ))
+ else if ( oArg.matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("userid")))
{
if ( aArgStr.Len() > 8 )
{
@@ -535,14 +569,12 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
AddStringListParam_Impl( CMD_STRINGPARAM_USERDIR,
::rtl::Uri::decode( aUserDir.copy( 8 ), 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;
@@ -552,7 +584,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
AddStringListParam_Impl( CMD_STRINGPARAM_LANGUAGE, aArgStr.Copy( 10 ) );
return sal_True;
}
- 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 )
@@ -560,7 +592,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
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 )
@@ -568,7 +600,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
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 )
@@ -576,7 +608,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
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 )
@@ -584,7 +616,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
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 )
@@ -592,7 +624,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
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 )
@@ -600,7 +632,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
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 )
@@ -608,7 +640,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
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 )
@@ -616,8 +648,15 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
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 +691,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 );
@@ -708,14 +755,14 @@ sal_Bool CommandLineArgs::IsNoQuickstart() const
sal_Bool CommandLineArgs::IsTerminateAfterInit() const
{
- osl::MutexGuard aMutexGuard( m_aMutex );
- return m_aBoolParams[ CMD_BOOLPARAM_TERMINATEAFTERINIT ];
+ osl::MutexGuard aMutexGuard( m_aMutex );
+ return m_aBoolParams[ CMD_BOOLPARAM_NOQUICKSTART ];
}
-sal_Bool CommandLineArgs::IsNoFirstStartWizard() const
+sal_Bool CommandLineArgs::IsTerminateAfterInit() const
{
osl::MutexGuard aMutexGuard( m_aMutex );
- return m_aBoolParams[ CMD_BOOLPARAM_NOFIRSTSTARTWIZARD ];
+ return m_aBoolParams[ CMD_BOOLPARAM_TERMINATEAFTERINIT ];
}
sal_Bool CommandLineArgs::IsNoLogo() const
@@ -823,6 +870,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 );
@@ -923,7 +976,8 @@ sal_Bool CommandLineArgs::IsEmptyOrAcceptOnly() const
{
osl::MutexGuard aMutexGuard( m_aMutex );
- return m_eArgumentCount == NONE ||
+ 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 +989,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 6412c2a7f2..efd0cfcd68 100644
--- 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,
@@ -76,7 +77,8 @@ class CommandLineArgs
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 +92,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 +103,7 @@ class CommandLineArgs
enum GroupParamId
{
- CMD_GRPID_MODULE,
+ CMD_GRPID_MODULE = 0,
CMD_GRPID_COUNT
};
@@ -125,6 +131,8 @@ 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;
@@ -213,3 +221,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 8af72e63ec..6a09755a7b 100644
--- 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 ca6424c4d6..2036d64678 100644
--- 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 b5162158e0..4da030c453 100644
--- 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 cdcf5145ec..8254f41118 100644
--- 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 4224419e99..b35aa2cee9 100644
--- 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 f9950118e8..a94966855e 100644
--- 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/desktopcontext.cxx b/desktop/source/app/desktopcontext.cxx
index 27d81924f1..df33617937 100644
--- 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.
@@ -48,7 +49,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 +62,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 0339ea4841..f0ac41c87a 100644
--- 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 a4aa77cc31..347ee542a3 100644
--- 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( USHORT nId ) :
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/desktopresid.hxx b/desktop/source/app/desktopresid.hxx
index 2271145f71..689a0f11da 100644
--- 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 e6383e32bd..8d8fc9d6ed 100644
--- 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() )
@@ -470,21 +634,9 @@ throw(::com::sun::star::uno::RuntimeException)
void SAL_CALL DispatchWatcher::dispatchFinished( const DispatchResultEvent& ) throw( RuntimeException )
{
osl::ClearableMutexGuard aGuard( GetMutex() );
- sal_Int16 nCount = --m_nRequestCount;
+ 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 f7de7ae0df..6dc2d9362c 100644
--- 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.
@@ -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/langselect.cxx b/desktop/source/app/langselect.cxx
index bf6bb8cc6c..cf5dfcf0e4 100644
--- 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.
@@ -146,7 +147,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())
@@ -370,12 +371,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,7 +416,7 @@ 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");
}
@@ -489,7 +490,7 @@ OUString LanguageSelection::getUserLanguage()
{
try
{
- xAccess->getByName(OUString::createFromAscii("UILocale")) >>= aUserLanguage;
+ xAccess->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale"))) >>= aUserLanguage;
}
catch ( NoSuchElementException const & )
{
@@ -513,7 +514,7 @@ OUString LanguageSelection::getSystemLanguage()
{
try
{
- xAccess->getByName(OUString::createFromAscii("UILocale")) >>= aUserLanguage;
+ xAccess->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale"))) >>= aUserLanguage;
}
catch ( NoSuchElementException const & )
{
@@ -535,7 +536,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 +557,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 cc1400bc6a..6db4f5bc24 100644
--- 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 099412c133..79c8bca1c2 100644
--- 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.
@@ -33,6 +34,8 @@
#include <tools/prewin.h>
#include <windows.h>
#include <tools/postwin.h>
+#else
+#include <unistd.h>
#endif
#include <sal/types.h>
#include <osl/file.hxx>
@@ -50,25 +53,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 +94,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 +121,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 +141,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 +164,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 +190,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 +237,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 ad971cac00..0d286e13ca 100644
--- 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 fdeb99f630..9f61c563fd 100644
--- 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 2705326c3e..198e42a0ca 100644
--- 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 085d8520e7..c73f72e2f2 100644
--- a/desktop/source/app/makefile.mk
+++ b/desktop/source/app/makefile.mk
@@ -91,7 +91,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 5f7e4be8c7..bcf0bba78f 100644
--- 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,11 +49,10 @@
#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;
@@ -219,14 +219,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 +294,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 +436,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_" ) );
@@ -456,8 +458,9 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
// and connectPipe!!
OUString aIniName;
-
- aInfo.getExecutableFile( aIniName );
+
+ osl_getExecutableFile( &aIniName.pData );
+
sal_uInt32 lastIndex = aIniName.lastIndexOf('/');
if ( lastIndex > 0 )
{
@@ -469,18 +472,18 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
aIniName += OUString( RTL_CONSTASCII_USTRINGPARAM( "rc" ));
#endif
}
-
+
::rtl::Bootstrap aPerfTuneIniFile( aIniName );
-
+
OUString aDefault( RTL_CONSTASCII_USTRINGPARAM( "0" ));
OUString aPreloadData;
-
+
aPerfTuneIniFile.getFrom( OUString( RTL_CONSTASCII_USTRINGPARAM( "FastPipeCommunication" )), aPreloadData, aDefault );
OUString aUserInstallPathHashCode;
- if ( aPreloadData.equalsAscii( "1" ))
+ if ( aPreloadData.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "1" ) ))
{
sal_Char szBuffer[32];
sprintf( szBuffer, "%d", SUPD );
@@ -488,7 +491,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
}
else
aUserInstallPathHashCode = CreateMD5FromString( aDummy );
-
+
// Check result to create a hash code from the user install path
if ( aUserInstallPathHashCode.getLength() == 0 )
@@ -499,22 +502,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 +538,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 +551,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 );
+ 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 +591,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 +654,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 +723,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 +737,6 @@ void SAL_CALL OfficeIPCThread::run()
new ApplicationEvent( aEmpty, aEmpty,
"UNACCEPT", aUnAcceptString );
ImplPostForeignAppEvent( pAppEvent );
- bAcceptorRequest = sal_True;
}
#ifndef UNX
@@ -904,9 +898,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 +907,7 @@ void SAL_CALL OfficeIPCThread::run()
TimeValue tval;
tval.Seconds = 1;
tval.Nanosec = 0;
- sleep( tval );
+ wait( tval );
}
} while( schedule() );
}
@@ -943,6 +934,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 +999,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,14 +1007,14 @@ 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 )
{
if( ! pGlobalOfficeIPCThread->AreRequestsEnabled() )
return bShutdown;
-
+
pGlobalOfficeIPCThread->mnPendingRequests += aDispatchList.size();
if ( !pGlobalOfficeIPCThread->mpDispatchWatcher )
{
@@ -977,7 +1025,7 @@ sal_Bool OfficeIPCThread::ExecuteCmdLineRequests( ProcessDocumentsRequest& aRequ
// copy for execute
DispatchWatcher::DispatchList aTempList( aDispatchList );
aDispatchList.clear();
-
+
aGuard.clear();
// Execute dispatch requests
@@ -992,3 +1040,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 92a35a5ff7..f075aec313 100644
--- 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 30433c3ccd..4e33e1313d 100644
--- 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 7b615dcb6e..1e640c58ae 100644
--- 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>
-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 977043ef83..5b07bb4684 100644
--- 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 f72d13834e..d2a37ddf88 100644
--- 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,13 +40,10 @@
#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
@@ -67,7 +65,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 +99,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 +106,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 +199,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 +240,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 +263,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 +296,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 2f6ee193ef..67b4f0081a 100644
--- 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/deployment/dp_log.cxx b/desktop/source/deployment/dp_log.cxx
index 0f6a26ee88..bb58770c4c 100644
--- a/desktop/source/deployment/dp_log.cxx
+++ b/desktop/source/deployment/dp_log.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.
@@ -209,3 +210,4 @@ extern sdecl::ServiceDecl const serviceDecl(
} // namespace dp_log
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx
index dc4d8eeb5e..410bb01c1a 100644
--- a/desktop/source/deployment/dp_persmap.cxx
+++ b/desktop/source/deployment/dp_persmap.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.
@@ -251,3 +252,4 @@ t_string2string_map PersistentMap::getEntries() const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/dp_services.cxx b/desktop/source/deployment/dp_services.cxx
index db42a215e7..b9a8185b2d 100644
--- a/desktop/source/deployment/dp_services.cxx
+++ b/desktop/source/deployment/dp_services.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.
@@ -113,3 +114,4 @@ void * SAL_CALL component_getFactory(
} // extern "C"
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/dp_xml.cxx b/desktop/source/deployment/dp_xml.cxx
index a4d4de1873..52451e4683 100644
--- a/desktop/source/deployment/dp_xml.cxx
+++ b/desktop/source/deployment/dp_xml.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.
diff --git a/desktop/source/deployment/gui/descedit.cxx b/desktop/source/deployment/gui/descedit.cxx
index 4898aecc03..0291ce5802 100644
--- a/desktop/source/deployment/gui/descedit.cxx
+++ b/desktop/source/deployment/gui/descedit.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.
@@ -98,3 +99,4 @@ void DescriptionEdit::SetDescription( const String& rDescription )
UpdateScrollBar();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/descedit.hxx b/desktop/source/deployment/gui/descedit.hxx
index 6e98a1233a..27e36e14a0 100644
--- a/desktop/source/deployment/gui/descedit.hxx
+++ b/desktop/source/deployment/gui/descedit.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.
@@ -55,3 +56,4 @@ namespace dp_gui
#endif // INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_DESCEDIT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui.h b/desktop/source/deployment/gui/dp_gui.h
index 9d7152b4b5..043a86f1af 100644
--- a/desktop/source/deployment/gui/dp_gui.h
+++ b/desktop/source/deployment/gui/dp_gui.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.
@@ -96,3 +97,5 @@ private:
} // namespace dp_gui
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc
index 11699bd50e..9c54c17f70 100755
--- a/desktop/source/deployment/gui/dp_gui.hrc
+++ b/desktop/source/deployment/gui/dp_gui.hrc
@@ -35,7 +35,7 @@
#define RID_DLG_EXTENSION_MANAGER RID_DEPLOYMENT_GUI_START
#define RID_DLG_UPDATE_REQUIRED (RID_DEPLOYMENT_GUI_START + 11)
-#define RID_EM_BTN_CLOSE 10
+#define RID_EM_BTN_CLOSE 10
#define RID_EM_BTN_HELP 11
#define RID_EM_BTN_ADD 12
#define RID_EM_BTN_CHECK_UPDATES 13
@@ -57,7 +57,6 @@
#define FL_LICENSE 69
#define FI_LICENSE_ARROW1 60
#define FI_LICENSE_ARROW2 61
-#define IMG_LICENCE_ARROW_HC 62
#define BTN_LICENSE_ACCEPT 63
// local RIDs for "Download and Install" dialog
@@ -123,8 +122,8 @@
#define RID_DLG_UPDATE_BROWSERBASED 25
#define RID_DLG_UPDATE_PUBLISHER_LABEL 26
#define RID_DLG_UPDATE_PUBLISHER_LINK 27
-#define RID_DLG_UPDATE_RELEASENOTES_LABEL 28
-#define RID_DLG_UPDATE_RELEASENOTES_LINK 29
+#define RID_DLG_UPDATE_RELEASENOTES_LABEL 28
+#define RID_DLG_UPDATE_RELEASENOTES_LINK 29
#define RID_DLG_UPDATE_NOUPDATE 30
#define RID_DLG_UPDATE_VERSION 31
#define RID_DLG_UPDATE_IGNORE 32
@@ -138,9 +137,7 @@
#define RID_INFOBOX_UPDATE_SHARED_EXTENSION (RID_DEPLOYMENT_GUI_START + 21)
#define RID_IMG_WARNING (RID_DEPLOYMENT_GUI_START+56)
-#define RID_IMG_WARNING_HC (RID_DEPLOYMENT_GUI_START+57)
#define RID_IMG_LOCKED (RID_DEPLOYMENT_GUI_START+58)
-#define RID_IMG_LOCKED_HC (RID_DEPLOYMENT_GUI_START+59)
#define RID_IMG_EXTENSION (RID_DEPLOYMENT_GUI_START+60)
#define RID_IMG_EXTENSION_HC (RID_DEPLOYMENT_GUI_START+61)
#define RID_IMG_SHARED (RID_DEPLOYMENT_GUI_START+62)
diff --git a/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx b/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
index d560b3d5a9..c00123fb91 100644
--- a/desktop/source/deployment/gui/dp_gui_autoscrolledit.cxx
+++ b/desktop/source/deployment/gui/dp_gui_autoscrolledit.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.
@@ -72,3 +73,4 @@ void AutoScrollEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
} // namespace dp_gui
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx b/desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx
index 79efac6e4a..ddec1e81ae 100644
--- a/desktop/source/deployment/gui/dp_gui_autoscrolledit.hxx
+++ b/desktop/source/deployment/gui/dp_gui_autoscrolledit.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.
@@ -49,3 +50,5 @@ public:
} // namespace dp_gui
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_backend.src b/desktop/source/deployment/gui/dp_gui_backend.src
index 343d75df6a..b002bf2408 100644
--- a/desktop/source/deployment/gui/dp_gui_backend.src
+++ b/desktop/source/deployment/gui/dp_gui_backend.src
@@ -33,11 +33,6 @@ Image RID_IMG_DEF_PACKAGE_BUNDLE
ImageBitmap = Bitmap { File = "sx03256.bmp"; };
MASKCOLOR
};
-Image RID_IMG_DEF_PACKAGE_BUNDLE_HC
-{
- ImageBitmap = Bitmap { File = "sxh03256.bmp"; };
- MASKCOLOR
-};
// script, dialog:
Image RID_IMG_SCRIPTLIB
@@ -45,22 +40,12 @@ Image RID_IMG_SCRIPTLIB
ImageBitmap = Bitmap { File = "im30820.bmp"; };
MASKCOLOR
};
-Image RID_IMG_SCRIPTLIB_HC
-{
- ImageBitmap = Bitmap { File = "imh30820.bmp"; };
- MASKCOLOR
-};
Image RID_IMG_DIALOGLIB
{
ImageBitmap = Bitmap { File = "dialogfolder_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_DIALOGLIB_HC
-{
- ImageBitmap = Bitmap { File = "dialogfolder_16_h.bmp"; };
- MASKCOLOR
-};
// configuration:
Image RID_IMG_CONF_XML
@@ -68,11 +53,6 @@ Image RID_IMG_CONF_XML
ImageBitmap = Bitmap { File = "xml_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_CONF_XML_HC
-{
- ImageBitmap = Bitmap { File = "xml_16_h.bmp"; };
- MASKCOLOR
-};
// component, typelib:
Image RID_IMG_COMPONENT
@@ -80,52 +60,27 @@ Image RID_IMG_COMPONENT
ImageBitmap = Bitmap { File = "component_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_COMPONENT_HC
-{
- ImageBitmap = Bitmap { File = "component_16_h.bmp"; };
- MASKCOLOR
-};
Image RID_IMG_JAVA_COMPONENT
{
ImageBitmap = Bitmap { File = "javacomponent_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_JAVA_COMPONENT_HC
-{
- ImageBitmap = Bitmap { File = "javacomponent_16_h.bmp"; };
- MASKCOLOR
-};
Image RID_IMG_TYPELIB
{
ImageBitmap = Bitmap { File = "library_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_TYPELIB_HC
-{
- ImageBitmap = Bitmap { File = "library_16_h.bmp"; };
- MASKCOLOR
-};
Image RID_IMG_JAVA_TYPELIB
{
ImageBitmap = Bitmap { File = "javalibrary_16.bmp"; };
MASKCOLOR
};
-Image RID_IMG_JAVA_TYPELIB_HC
-{
- ImageBitmap = Bitmap { File = "javalibrary_16_h.bmp"; };
- MASKCOLOR
-};
Image RID_IMG_HELP
{
ImageBitmap = Bitmap { File = "commandimagelist/sc_helperdialog.bmp"; };
MASKCOLOR
};
-Image RID_IMG_HELP_HC
-{
- ImageBitmap = Bitmap { File = "commandimagelist/sch_helperdialog.bmp"; };
- MASKCOLOR
-};
diff --git a/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx b/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx
index 1f34c490ea..694f764d5e 100644
--- a/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dependencydialog.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.
@@ -84,3 +85,5 @@ void DependencyDialog::Resize() {
(m_list.GetSizePixel().Width() - m_ok.GetSizePixel().Width()) / 2),
m_list.GetPosPixel().Y() + m_list.GetSizePixel().Height() + n));
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_dependencydialog.hxx b/desktop/source/deployment/gui/dp_gui_dependencydialog.hxx
index 3d982cd250..72f8334d38 100644
--- a/desktop/source/deployment/gui/dp_gui_dependencydialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dependencydialog.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.
@@ -32,9 +33,7 @@
#include <vector>
#include "tools/gen.hxx"
-#ifndef _SV_BUTTON_HXX
#include "vcl/button.hxx"
-#endif
#include "vcl/dialog.hxx"
#include "vcl/fixed.hxx"
#include "vcl/lstbox.hxx"
@@ -66,3 +65,5 @@ private:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src
index e61994c475..91f9252dfc 100644..100755
--- a/desktop/source/deployment/gui/dp_gui_dialog.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog.src
@@ -4,7 +4,7 @@
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
- * OpenOffice.org - a multi-platform office productivity suite
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* This file is part of OpenOffice.org.
*
@@ -31,27 +31,33 @@ String RID_STR_ADD_PACKAGES
{
Text [ en-US ] = "Add Extension(s)";
};
+
String RID_CTX_ITEM_REMOVE
{
Text [ en-US ] = "~Remove";
};
+
String RID_CTX_ITEM_ENABLE
{
Text [ en-US ] = "~Enable";
};
+
String RID_CTX_ITEM_DISABLE
{
Text [ en-US ] = "~Disable";
};
+
String RID_CTX_ITEM_CHECK_UPDATE
{
Text [ en-US ] = "~Update...";
};
+
String RID_CTX_ITEM_OPTIONS
{
Text [ en-US ] = "~Options...";
};
+
String RID_STR_ADDING_PACKAGES
{
Text [ en-US ] = "Adding %EXTENSION_NAME";
@@ -128,7 +134,7 @@ String RID_STR_SHOW_LICENSE_CMD
// ---------------------------------------------------
// row 1 | multi line edit
// ---------------------------------------------------
-// row 2 | fixed text
+// row 2 | fixed text
// ---------------------------------------------------
// row 3 | img | fixed text | fixed text | button
// ----------------------------------------------------
@@ -136,7 +142,7 @@ String RID_STR_SHOW_LICENSE_CMD
// ---------------------------------------------------
// row 5 |fixed line
// ---------------------------------------------------
-// row 6 | | |button | button
+// row 6 | | |button | button
// ---------------------------------------------------
// | col 1 | col 2 | col3 | col4 | col5
@@ -183,7 +189,6 @@ ModalDialog RID_DLG_LICENSE
Moveable = TRUE;
Closeable = TRUE;
Sizeable = FALSE;
-// Hide = TRUE;
MultiLineEdit ML_LICENSE
{
@@ -194,7 +199,7 @@ ModalDialog RID_DLG_LICENSE
VScroll = TRUE;
ReadOnly = TRUE;
};
-
+
FixedText FT_LICENSE_HEADER
{
Pos = MAP_APPFONT(COL1_X, ROW2_Y);
@@ -202,14 +207,16 @@ ModalDialog RID_DLG_LICENSE
WordBreak = TRUE;
NoLabel = TRUE;
Text [ en-US ] = "Please follow these steps to proceed with the installation of the extension:";
- };
+ };
+
FixedText FT_LICENSE_BODY_1
{
Pos = MAP_APPFONT(COL2_X, ROW3_Y);
Size = MAP_APPFONT( COL2_WIDTH, ROW3_HEIGHT );
NoLabel = TRUE;
Text [ en-US ] = "1.";
- };
+ };
+
//spans col3 + col4
FixedText FT_LICENSE_BODY_1_TXT
{
@@ -218,14 +225,16 @@ ModalDialog RID_DLG_LICENSE
WordBreak = TRUE;
NoLabel = TRUE;
Text [ en-US ] = "Read the complete License Agreement. Use the scroll bar or the \'Scroll Down\' button in this dialog to view the entire license text.";
- };
+ };
+
FixedText FT_LICENSE_BODY_2
{
Pos = MAP_APPFONT(COL2_X, ROW4_Y);
Size = MAP_APPFONT(COL2_WIDTH, ROW4_HEIGHT);
NoLabel = TRUE;
Text [ en-US ] = "2.";
- };
+ };
+
FixedText FT_LICENSE_BODY_2_TXT
{
Pos = MAP_APPFONT(COL3_X, ROW4_Y);
@@ -233,8 +242,9 @@ ModalDialog RID_DLG_LICENSE
WordBreak = TRUE;
NoLabel = TRUE;
Text [ en-US ] = "Accept the License Agreement for the extension by pressing the \'Accept\' button.";
-
- };
+
+ };
+
PushButton PB_LICENSE_DOWN
{
HelpID = "desktop:PushButton:RID_DLG_LICENSE:PB_LICENSE_DOWN";
@@ -242,14 +252,15 @@ ModalDialog RID_DLG_LICENSE
Pos = MAP_APPFONT(COL5_X , ROW3_Y) ;
Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT) ;
Text [ en-US ] = "~Scroll Down";
-
+
};
+
FixedLine FL_LICENSE
{
Pos = MAP_APPFONT ( 0, ROW5_Y) ;
Size = MAP_APPFONT ( LIC_DLG_WIDTH, ROW5_HEIGHT ) ;
};
-
+
FixedImage FI_LICENSE_ARROW1
{
Pos = MAP_APPFONT (COL1_X, ROW3_Y) ;
@@ -260,7 +271,7 @@ ModalDialog RID_DLG_LICENSE
MASKCOLOR
};
};
-
+
FixedImage FI_LICENSE_ARROW2
{
Pos = MAP_APPFONT (COL1_X, ROW4_Y) ;
@@ -271,13 +282,7 @@ ModalDialog RID_DLG_LICENSE
MASKCOLOR
};
};
-
- Image IMG_LICENCE_ARROW_HC
- {
- ImageBitmap = Bitmap { File = "sch06300.png"; };
- MASKCOLOR
- };
-
+
OKButton BTN_LICENSE_ACCEPT
{
Pos = MAP_APPFONT(COL4_X, ROW6_Y);
@@ -287,7 +292,7 @@ ModalDialog RID_DLG_LICENSE
DefButton = TRUE;
Text [ en-US ] = "Accept";
};
-
+
CancelButton BTN_LICENSE_DECLINE
{
Pos = MAP_APPFONT(COL5_X, ROW6_Y);
@@ -295,8 +300,6 @@ ModalDialog RID_DLG_LICENSE
Text [ en-US ] = "Decline" ;
TabStop = TRUE;
};
-
-};
ModalDialog RID_DLG_SHOW_LICENSE
{
@@ -375,7 +378,7 @@ WARNINGBOX RID_WARNINGBOX_DISABLE_SHARED_EXTENSION
"Click \'Cancel\' to stop disabling the extension.";
};
-
+
String RID_STR_UNSUPPORTED_PLATFORM
{
Text [ en-US ] = "The extension \'%Name\' does not work on this computer.";
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 41ccc69693..aba7732054 100755
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.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.
@@ -50,7 +51,7 @@
#include "vcl/scrbar.hxx"
#include "vcl/svapp.hxx"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include "svtools/extensionlistbox.hxx"
@@ -102,7 +103,7 @@ namespace dp_gui {
struct StrAllFiles : public rtl::StaticWithInit< const OUString, StrAllFiles >
{
const OUString operator () () {
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
::std::auto_ptr< ResMgr > const resmgr( ResMgr::CreateResMgr( "fps_office" ) );
OSL_ASSERT( resmgr.get() != 0 );
String ret( ResId( STR_FILTERNAME_ALL, *resmgr.get() ) );
@@ -368,12 +369,21 @@ bool ExtBoxWithBtns_Impl::HandleTabKey( bool bReverse )
// -----------------------------------------------------------------------
MENU_COMMAND ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const long nPos )
{
- if ( nPos >= (long) getItemCount() )
- return CMD_NONE;
+ if ( ( nPos >= 0 ) && ( nPos < (long) getItemCount() ) )
+ {
+ if ( ! GetEntryData( nPos )->m_bLocked )
+ {
+ PopupMenu aPopup;
- PopupMenu aPopup;
+ aPopup.InsertItem( CMD_UPDATE, DialogHelper::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) );
- aPopup.InsertItem( CMD_UPDATE, DialogHelper::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) );
+ if ( GetEntryData( nPos )->m_bUser )
+ {
+ if ( GetEntryData( nPos )->m_eState == REGISTERED )
+ aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) );
+ else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE )
+ aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) );
+ }
if ( ! GetEntryData( nPos )->m_bLocked )
{
@@ -425,6 +435,7 @@ void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt )
}
else if ( rMEvt.IsLeft() )
{
+ const SolarMutexGuard aGuard;
if ( rMEvt.IsMod1() && HasActive() )
selectEntry( EXTENSION_LISTBOX_ENTRY_NOTFOUND ); // Selecting an not existing entry will deselect the current one
else
@@ -570,7 +581,7 @@ DialogHelper::~DialogHelper()
//------------------------------------------------------------------------------
ResId DialogHelper::getResId( USHORT nId )
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
return ResId( nId, *DeploymentGuiResMgr::get() );
}
@@ -579,7 +590,7 @@ String DialogHelper::getResourceString( USHORT id )
{
// init with non-acquired solar mutex:
BrandName::get();
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
String ret( ResId( id, *DeploymentGuiResMgr::get() ) );
if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) {
ret.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
@@ -604,7 +615,7 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::
{
if ( !bHadWarning && IsSharedPkgMgr( xPackage ) )
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
WarningBox aInfoBox( pParent, getResId( nResID ) );
String aMsgText = aInfoBox.GetMessText();
aMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
@@ -638,7 +649,7 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle
{
uno::Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
ErrorBox aErrorBox( NULL, WB_OK, msg );
aErrorBox.SetText( sTitle );
aErrorBox.Execute();
@@ -648,7 +659,7 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle
//------------------------------------------------------------------------------
bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
WarningBox aInfo( m_pVCLWindow, getResId( RID_WARNINGBOX_INSTALL_EXTENSION ) );
String sText( aInfo.GetMessText() );
@@ -661,7 +672,7 @@ bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const
//------------------------------------------------------------------------------
bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
QueryBox aQuery( m_pVCLWindow, getResId( RID_QUERYBOX_INSTALL_FOR_ALL ) );
String sMsgText = aQuery.GetMessText();
@@ -778,6 +789,7 @@ void ExtMgrDialog::setGetExtensionsURL( const ::rtl::OUString &rURL )
long ExtMgrDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage,
bool bLicenseMissing )
{
+ const SolarMutexGuard aGuard;
m_aUpdateBtn.Enable( true );
return m_pExtensionBox->addEntry( xPackage, bLicenseMissing );
}
@@ -791,14 +803,14 @@ void ExtMgrDialog::prepareChecking()
//------------------------------------------------------------------------------
void ExtMgrDialog::checkEntries()
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
m_pExtensionBox->checkEntries();
}
//------------------------------------------------------------------------------
bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
WarningBox aInfo( const_cast< ExtMgrDialog* >(this), getResId( RID_WARNINGBOX_REMOVE_EXTENSION ) );
String sText( aInfo.GetMessText() );
@@ -1049,6 +1061,7 @@ void ExtMgrDialog::updateProgress( const OUString &rText,
//------------------------------------------------------------------------------
void ExtMgrDialog::updatePackageInfo( const uno::Reference< deployment::XPackage > &xPackage )
{
+ const SolarMutexGuard aGuard;
m_pExtensionBox->updateEntry( xPackage );
}
@@ -1167,7 +1180,7 @@ void ExtMgrDialog::Resize()
Rectangle aNativeControlRegion, aNativeContentRegion;
if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString(),
- aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
+ aNativeControlRegion, aNativeContentRegion ) != FALSE )
{
nProgressHeight = aNativeControlRegion.GetHeight();
}
@@ -1349,7 +1362,7 @@ void UpdateRequiredDialog::prepareChecking()
//------------------------------------------------------------------------------
void UpdateRequiredDialog::checkEntries()
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
m_pExtensionBox->checkEntries();
if ( ! hasActiveEntries() )
@@ -1462,6 +1475,7 @@ void UpdateRequiredDialog::updatePackageInfo( const uno::Reference< deployment::
// We will remove all updated packages with satisfied dependencies, but
// we will show all disabled entries so the user sees the result
// of the 'disable all' button
+ const SolarMutexGuard aGuard;
if ( isEnabled( xPackage ) && checkDependencies( xPackage ) )
m_pExtensionBox->removeEntry( xPackage );
else
@@ -1610,7 +1624,7 @@ void UpdateRequiredDialog::Resize()
Rectangle aNativeControlRegion, aNativeContentRegion;
if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString(),
- aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
+ aNativeControlRegion, aNativeContentRegion ) != FALSE )
{
nProgressHeight = aNativeControlRegion.GetHeight();
}
@@ -1826,3 +1840,4 @@ SelectedPackage::~SelectedPackage() {}
} //namespace dp_gui
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index 50878d8778..8b5d0ba37c 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.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.
@@ -279,3 +280,5 @@ public:
} // namespace dp_gui
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.src b/desktop/source/deployment/gui/dp_gui_dialog2.src
index daeb5d0125..813bbd58d4 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.src
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.src
@@ -162,17 +162,12 @@ Image RID_IMG_WARNING
ImageBitmap = Bitmap { File = "caution_16.png"; };
};
-Image RID_IMG_WARNING_HC
-{
- ImageBitmap = Bitmap { File = "caution_16_h.png"; };
-};
-
Image RID_IMG_LOCKED
{
ImageBitmap = Bitmap { File = "lock_16.png"; };
};
-Image RID_IMG_LOCKED_HC
+Image RID_IMG_SHARED
{
ImageBitmap = Bitmap { File = "lock_16_h.png"; };
};
@@ -192,11 +187,6 @@ Image RID_IMG_EXTENSION
ImageBitmap = Bitmap { File = "extension_32.png"; };
};
-Image RID_IMG_EXTENSION_HC
-{
- ImageBitmap = Bitmap { File = "extension_32_h.png"; };
-};
-
QueryBox RID_QUERYBOX_INSTALL_FOR_ALL
{
Buttons = WB_YES_NO_CANCEL;
@@ -209,7 +199,7 @@ QueryBox RID_QUERYBOX_INSTALL_FOR_ALL
// ---------------------------------------------------
// row 1 | multi line edit
// ---------------------------------------------------
-// row 2 | fixed text
+// row 2 | fixed text
// ---------------------------------------------------
// row 3 | img | fixed text | fixed text | button
// ----------------------------------------------------
@@ -217,7 +207,7 @@ QueryBox RID_QUERYBOX_INSTALL_FOR_ALL
// ---------------------------------------------------
// row 5 |fixed line
// ---------------------------------------------------
-// row 6 | | |button | button
+// row 6 | | |button | button
// ---------------------------------------------------
// | col 1 | col 2 | col3 | col4 | col5
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index ea983c5a7f..2bada9f02c 100755
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.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.
@@ -25,6 +26,8 @@
*
************************************************************************/
+#define _WIN32_WINNT 0x0500
+
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
@@ -165,7 +168,7 @@ public:
m_bWarnUser( false )
{}
- Dialog * activeDialog() { return m_pDialogHelper->getWindow(); }
+ Dialog * activeDialog() { return m_pDialogHelper ? m_pDialogHelper->getWindow() : NULL; }
void setTitle( const OUString& rNewTitle ) { m_sTitle = rNewTitle; }
void startProgress();
@@ -258,6 +261,8 @@ private:
virtual void execute();
virtual void SAL_CALL onTerminated();
+ void _insert(const TExtensionCmd& rExtCmd);
+
void _addExtension( ::rtl::Reference< ProgressCmdEnv > &rCmdEnv,
const OUString &rPackageURL,
const OUString &rRepository,
@@ -427,7 +432,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
dp_misc::Dependencies::getErrorText( depExc.UnsatisfiedDependencies[i]) );
}
{
- vos::OGuard guard(Application::GetSolarMutex());
+ SolarMutexGuard guard;
short n = DependencyDialog( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, deps ).Execute();
// Distinguish between closing the dialog and programatically
// canceling the dialog (headless VCL):
@@ -471,7 +476,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
bool bEqualNames = verExc.NewDisplayName.equals(
verExc.Deployed->getDisplayName());
{
- vos::OGuard guard(Application::GetSolarMutex());
+ SolarMutexGuard guard;
WarningBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get()));
String s;
if (bEqualNames)
@@ -512,7 +517,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
{
if ( m_pDialogHelper )
{
- vos::OGuard guard(Application::GetSolarMutex());
+ SolarMutexGuard guard;
approve = m_pDialogHelper->installExtensionWarn( instExc.displayName );
}
@@ -523,7 +528,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
}
else if (request >>= platExc)
{
- vos::OGuard guard( Application::GetSolarMutex() );
+ SolarMutexGuard guard;
String sMsg( ResId( RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get() ) );
sMsg.SearchAndReplaceAllAscii( "%Name", platExc.package->getDisplayName() );
ErrorBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, WB_OK, sMsg );
@@ -597,7 +602,7 @@ void ProgressCmdEnv::update_( uno::Any const & rStatus )
if ( text.getLength() == 0 )
text = ::comphelper::anyToString( rStatus ); // fallback
- const ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ const SolarMutexGuard aGuard;
const ::std::auto_ptr< ErrorBox > aBox( new ErrorBox( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, WB_OK, text ) );
aBox->Execute();
}
@@ -645,12 +650,6 @@ void ExtensionCmdQueue::Thread::addExtension( const ::rtl::OUString &rExtensionU
const ::rtl::OUString &rRepository,
const bool bWarnUser )
{
- ::osl::MutexGuard aGuard( m_mutex );
-
- //If someone called stop then we do not add the extension -> game over!
- if ( m_bStopped )
- return;
-
if ( rExtensionURL.getLength() )
{
TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::ADD, rExtensionURL, rRepository, bWarnUser ) );
@@ -693,9 +692,13 @@ void ExtensionCmdQueue::Thread::acceptLicense( const uno::Reference< deployment:
{
TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::ACCEPT_LICENSE, rPackage ) );
- m_queue.push( pEntry );
- m_eInput = START;
- m_wakeup.set();
+//------------------------------------------------------------------------------
+void ExtensionCmdQueue::Thread::acceptLicense( const uno::Reference< deployment::XPackage > &rPackage )
+{
+ if ( rPackage.is() )
+ {
+ TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::ACCEPT_LICENSE, rPackage ) );
+ _insert( pEntry );
}
}
@@ -703,20 +706,12 @@ void ExtensionCmdQueue::Thread::acceptLicense( const uno::Reference< deployment:
void ExtensionCmdQueue::Thread::enableExtension( const uno::Reference< deployment::XPackage > &rPackage,
const bool bEnable )
{
- ::osl::MutexGuard aGuard( m_mutex );
-
- //If someone called stop then we do not remove the extension -> game over!
- if ( m_bStopped )
- return;
-
if ( rPackage.is() )
{
TExtensionCmd pEntry( new ExtensionCmd( bEnable ? ExtensionCmd::ENABLE :
ExtensionCmd::DISABLE,
rPackage ) );
- m_queue.push( pEntry );
- m_eInput = START;
- m_wakeup.set();
+ _insert( pEntry );
}
}
@@ -724,16 +719,8 @@ void ExtensionCmdQueue::Thread::enableExtension( const uno::Reference< deploymen
void ExtensionCmdQueue::Thread::checkForUpdates(
const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
{
- ::osl::MutexGuard aGuard( m_mutex );
-
- //If someone called stop then we do not update the extension -> game over!
- if ( m_bStopped )
- return;
-
TExtensionCmd pEntry( new ExtensionCmd( ExtensionCmd::CHECK_FOR_UPDATES, vExtensionList ) );
- m_queue.push( pEntry );
- m_eInput = START;
- m_wakeup.set();
+ _insert( pEntry );
}
//------------------------------------------------------------------------------
@@ -888,7 +875,7 @@ void ExtensionCmdQueue::Thread::execute()
if (msg.getLength() == 0) // fallback for debugging purposes
msg = ::comphelper::anyToString(exc);
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
::std::auto_ptr<ErrorBox> box(
new ErrorBox( currentCmdEnv->activeDialog(), WB_OK, msg ) );
if ( m_pDialogHelper )
@@ -1002,7 +989,7 @@ void ExtensionCmdQueue::Thread::_checkForUpdates(
UpdateDialog* pUpdateDialog;
std::vector< UpdateData > vData;
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
pUpdateDialog = new UpdateDialog( m_xContext, m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, vExtensionList, &vData );
@@ -1010,13 +997,13 @@ void ExtensionCmdQueue::Thread::_checkForUpdates(
if ( ( pUpdateDialog->Execute() == RET_OK ) && !vData.empty() )
{
- // If there is at least one directly downloadable dialog then we
+ // If there is at least one directly downloadable extension then we
// open the install dialog.
::std::vector< UpdateData > dataDownload;
int countWebsiteDownload = 0;
typedef std::vector< dp_gui::UpdateData >::const_iterator cit;
- for ( cit i = vData.begin(); i < vData.end(); i++ )
+ for ( cit i = vData.begin(); i < vData.end(); ++i )
{
if ( i->sWebsiteURL.getLength() > 0 )
countWebsiteDownload ++;
@@ -1036,7 +1023,7 @@ void ExtensionCmdQueue::Thread::_checkForUpdates(
//Now start the webbrowser and navigate to the websites where we get the updates
if ( RET_OK == nDialogResult )
{
- for ( cit i = vData.begin(); i < vData.end(); i++ )
+ for ( cit i = vData.begin(); i < vData.end(); ++i )
{
if ( m_pDialogHelper && ( i->sWebsiteURL.getLength() > 0 ) )
m_pDialogHelper->openWebBrowser( i->sWebsiteURL, m_pDialogHelper->getWindow()->GetText() );
@@ -1122,6 +1109,19 @@ void ExtensionCmdQueue::Thread::onTerminated()
m_bTerminated = true;
}
+void ExtensionCmdQueue::Thread::_insert(const TExtensionCmd& rExtCmd)
+{
+ ::osl::MutexGuard aGuard( m_mutex );
+
+ // If someone called stop then we do not process the command -> game over!
+ if ( m_bStopped )
+ return;
+
+ m_queue.push( rExtCmd );
+ m_eInput = START;
+ m_wakeup.set();
+}
+
//------------------------------------------------------------------------------
OUString ExtensionCmdQueue::Thread::searchAndReplaceAll( const OUString &rSource,
const OUString &rWhat,
@@ -1210,3 +1210,4 @@ void handleInteractionRequest( const uno::Reference< uno::XComponentContext > &
} //namespace dp_gui
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
index 90eb0dab07..8794c51132 100755
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.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.
@@ -109,3 +110,5 @@ void handleInteractionRequest( const ::com::sun::star::uno::Reference< ::com::su
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index b8daa7668d..b1ec3a43df 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.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.
@@ -65,7 +66,7 @@ public:
virtual ~MyApp();
// Application
- virtual void Main();
+ virtual int Main();
};
//______________________________________________________________________________
@@ -79,8 +80,9 @@ MyApp::MyApp()
}
//______________________________________________________________________________
-void MyApp::Main()
+int MyApp::Main()
{
+ return EXIT_SUCCESS;
}
//##############################################################################
@@ -206,7 +208,7 @@ void ServiceImpl::setDialogTitle( OUString const & title )
{
if ( dp_gui::TheExtensionManager::s_ExtMgr.is() )
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
::rtl::Reference< ::dp_gui::TheExtensionManager > dialog(
::dp_gui::TheExtensionManager::get( m_xComponentContext,
m_parent ? *m_parent : Reference<awt::XWindow>(),
@@ -234,7 +236,7 @@ void ServiceImpl::startExecuteModal(
}
catch (Exception & exc) {
if (bAppUp) {
- const vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
std::auto_ptr<ErrorBox> box(
new ErrorBox( Application::GetActiveTopWindow(),
WB_OK, exc.Message ) );
@@ -278,7 +280,7 @@ void ServiceImpl::startExecuteModal(
}
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
::rtl::Reference< ::dp_gui::TheExtensionManager > myExtMgr(
::dp_gui::TheExtensionManager::get(
m_xComponentContext,
@@ -366,3 +368,5 @@ void * SAL_CALL component_getFactory(
}
} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_shared.hxx b/desktop/source/deployment/gui/dp_gui_shared.hxx
index 40f5bc9d6f..af3a0bd5b9 100644
--- a/desktop/source/deployment/gui/dp_gui_shared.hxx
+++ b/desktop/source/deployment/gui/dp_gui_shared.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.
@@ -60,3 +61,5 @@ public:
} // namespace dp_gui
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_system.cxx b/desktop/source/deployment/gui/dp_gui_system.cxx
deleted file mode 100644
index bc11a4b12b..0000000000
--- a/desktop/source/deployment/gui/dp_gui_system.cxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_desktop.hxx"
-
-#include "dp_gui_system.hxx"
-#ifdef WNT
-#define WIN32_LEAN_AND_MEAN
-#ifdef _MSC_VER
-#pragma warning(push,1) /* disable warnings within system headers */
-#endif
-#include <windows.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-#endif
-
-namespace dp_gui {
-
-//We cannot distinguish Vista and 2008 Server
-bool isVista()
-{
-#ifdef WNT
- OSVERSIONINFO osvi;
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&osvi);
- return osvi.dwMajorVersion >= 6;
-#else
- return false;
-#endif
-}
-
-} //namespace dp_gui
diff --git a/desktop/source/deployment/gui/dp_gui_system.hxx b/desktop/source/deployment/gui/dp_gui_system.hxx
deleted file mode 100644
index 40271e3870..0000000000
--- a/desktop/source/deployment/gui/dp_gui_system.hxx
+++ /dev/null
@@ -1,37 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_SYSTEM_HXX
-#define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_SYSTEM_HXX
-
-
-/// @HTML
-namespace dp_gui {
-bool isVista();
-
-}
-#endif
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 17d5e6af39..564580c520 100755
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.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.
@@ -31,7 +32,7 @@
#include "vcl/svapp.hxx"
#include "vcl/msgbox.hxx"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include "toolkit/helper/vclunohelper.hxx"
@@ -126,7 +127,7 @@ TheExtensionManager::~TheExtensionManager()
//------------------------------------------------------------------------------
void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
if ( bCreateUpdDlg )
{
@@ -151,7 +152,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
//------------------------------------------------------------------------------
void TheExtensionManager::Show()
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
getDialog()->Show();
}
@@ -159,7 +160,7 @@ void TheExtensionManager::Show()
//------------------------------------------------------------------------------
void TheExtensionManager::SetText( const ::rtl::OUString &rTitle )
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
getDialog()->SetText( rTitle );
}
@@ -167,7 +168,7 @@ void TheExtensionManager::SetText( const ::rtl::OUString &rTitle )
//------------------------------------------------------------------------------
void TheExtensionManager::ToTop( USHORT nFlags )
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
getDialog()->ToTop( nFlags );
}
@@ -278,7 +279,7 @@ void TheExtensionManager::terminateDialog()
{
if ( ! dp_misc::office_is_running() )
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
delete m_pExtMgrDialog;
m_pExtMgrDialog = NULL;
delete m_pUpdReqDialog;
@@ -445,7 +446,7 @@ void TheExtensionManager::disposing( lang::EventObject const & rEvt )
{
if ( dp_misc::office_is_running() )
{
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
delete m_pExtMgrDialog;
m_pExtMgrDialog = NULL;
delete m_pUpdReqDialog;
@@ -514,7 +515,7 @@ void TheExtensionManager::modified( ::lang::EventObject const & /*rEvt*/ )
::rtl::Reference<TheExtensionManager> that( new TheExtensionManager( pParent, xContext ) );
- const ::vos::OGuard guard( Application::GetSolarMutex() );
+ const SolarMutexGuard guard;
if ( ! s_ExtMgr.is() )
{
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
@@ -529,3 +530,4 @@ void TheExtensionManager::modified( ::lang::EventObject const & /*rEvt*/ )
} //namespace dp_gui
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index 4baa797d63..13ba06d0b3 100755
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.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.
@@ -129,3 +130,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_thread.cxx b/desktop/source/deployment/gui/dp_gui_thread.cxx
index 1f92d468d3..3bf0ff0d6c 100644
--- a/desktop/source/deployment/gui/dp_gui_thread.cxx
+++ b/desktop/source/deployment/gui/dp_gui_thread.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.
@@ -80,3 +81,5 @@ void Thread::run() {
void Thread::onTerminated() {
release();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_thread.hxx b/desktop/source/deployment/gui/dp_gui_thread.hxx
index 0b5a954b99..eb4fe43c94 100644
--- a/desktop/source/deployment/gui/dp_gui_thread.hxx
+++ b/desktop/source/deployment/gui/dp_gui_thread.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.
@@ -82,3 +83,5 @@ private:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_updatedata.hxx b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
index 651cd536e2..099fdcb8f5 100755
--- a/desktop/source/deployment/gui/dp_gui_updatedata.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedata.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.
@@ -89,3 +90,5 @@ struct UpdateData
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 6108766118..29b3a3491c 100755
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.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.
@@ -107,7 +108,7 @@
#include "vcl/image.hxx"
#include "vcl/msgbox.hxx"
#include "vcl/svapp.hxx"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include "comphelper/processfactory.hxx"
@@ -124,7 +125,6 @@
#include "dp_gui_updatedata.hxx"
#include "dp_gui_updatedialog.hxx"
#include "dp_gui_shared.hxx"
-#include "dp_gui_system.hxx"
class KeyEvent;
class MouseEvent;
@@ -318,7 +318,7 @@ UpdateDialog::Thread::Thread(
void UpdateDialog::Thread::stop() {
uno::Reference< task::XAbortChannel > abort;
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
abort = m_abort;
m_stop = true;
}
@@ -455,7 +455,7 @@ void UpdateDialog::Thread::handleGeneralError(uno::Any const & exception)
}
vos::OGuard g(Application::GetSolarMutex());
if (!m_stop) {
- m_dialog.addGeneralError(message);
+ m_dialog.checkingDone();
}
}
#endif
@@ -471,7 +471,7 @@ void UpdateDialog::Thread::handleSpecificError(
if (exception >>= e) {
data.message = e.Message;
}
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_stop) {
m_dialog.addSpecificError(data);
}
@@ -552,7 +552,7 @@ bool UpdateDialog::Thread::update(
}
ret = !m_stop;
} else {
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (!m_stop) {
m_dialog.addDisabledUpdate(du);
}
@@ -573,8 +573,7 @@ UpdateDialog::UpdateDialog(
m_update(this, DpGuiResId(RID_DLG_UPDATE_UPDATE)),
m_updates(
*this, DpGuiResId(RID_DLG_UPDATE_UPDATES),
- Image(DpGuiResId(RID_DLG_UPDATE_NORMALALERT)),
- Image(DpGuiResId(RID_DLG_UPDATE_HIGHCONTRASTALERT))),
+ Image(DpGuiResId(RID_DLG_UPDATE_NORMALALERT))),
m_all(this, DpGuiResId(RID_DLG_UPDATE_ALL)),
m_description(this, DpGuiResId(RID_DLG_UPDATE_DESCRIPTION)),
m_PublisherLabel(this, DpGuiResId(RID_DLG_UPDATE_PUBLISHER_LABEL)),
@@ -1510,3 +1509,5 @@ IMPL_LINK( UpdateDialog, hyperlink_clicked, svt::FixedHyperlink*, pHyperlink )
return 1;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
index e562c4e845..79c1831cfd 100755
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.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,9 +41,7 @@
#include "svx/checklbx.hxx"
#include "tools/link.hxx"
#include "tools/solar.h"
-#ifndef _SV_BUTTON_HXX
#include "vcl/button.hxx"
-#endif
#include "vcl/dialog.hxx"
#include "vcl/fixed.hxx"
#include <svtools/fixedhyper.hxx>
@@ -122,8 +121,7 @@ private:
public:
CheckListBox(
UpdateDialog & dialog, ResId const & resource,
- Image const & normalStaticImage,
- Image const & highContrastStaticImage);
+ Image const & normalStaticImage);
virtual ~CheckListBox();
@@ -230,3 +228,5 @@ private:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.src b/desktop/source/deployment/gui/dp_gui_updatedialog.src
index d926360643..3050213703 100755
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.src
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.src
@@ -216,11 +216,6 @@ ModalDialog RID_DLG_UPDATE {
File = "caution_12.png";
};
};
- Image RID_DLG_UPDATE_HIGHCONTRASTALERT {
- ImageBitmap = Bitmap {
- File = "caution_12_h.png";
- };
- };
String RID_DLG_UPDATE_ERROR {
Text[en-US] = "Error";
};
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
index 8f0a262bfc..8f26b574ac 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.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.
@@ -41,7 +42,7 @@
#include "vcl/dialog.hxx"
#include "vcl/msgbox.hxx"
#include "vcl/svapp.hxx"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include "vcl/dialog.hxx"
#include "cppuhelper/implbase3.hxx"
@@ -79,7 +80,7 @@
#include "dp_gui_extensioncmdqueue.hxx"
#include "ucbhelper/content.hxx"
#include "osl/mutex.hxx"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include "rtl/ref.hxx"
#include "com/sun/star/uno/Sequence.h"
#include "comphelper/anytostring.hxx"
@@ -187,7 +188,7 @@ UpdateInstallDialog::Thread::Thread(
void UpdateInstallDialog::Thread::stop() {
cssu::Reference< css::task::XAbortChannel > abort;
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
abort = m_abort;
m_stop = true;
}
@@ -216,7 +217,7 @@ void UpdateInstallDialog::Thread::execute()
{
//make sure m_dialog is still alive
- ::vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (! m_stop)
m_dialog.updateDone();
}
@@ -376,7 +377,7 @@ void UpdateInstallDialog::Thread::downloadExtensions()
sal_uInt16 count = 0;
typedef std::vector<UpdateData>::iterator It;
- for (It i = m_aVecUpdateData.begin(); i != m_aVecUpdateData.end(); i++)
+ for (It i = m_aVecUpdateData.begin(); i != m_aVecUpdateData.end(); ++i)
{
UpdateData & curData = *i;
@@ -388,7 +389,7 @@ void UpdateInstallDialog::Thread::downloadExtensions()
//update the name of the extension which is to be downloaded
{
- ::vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -422,7 +423,7 @@ void UpdateInstallDialog::Thread::downloadExtensions()
}
//update the progress and display download error
{
- ::vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -449,7 +450,7 @@ void UpdateInstallDialog::Thread::downloadExtensions()
}
catch (cssu::Exception & e)
{
- ::vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -460,7 +461,7 @@ void UpdateInstallDialog::Thread::installExtensions()
{
//Update the fix text in the dialog to "Installing extensions..."
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -470,11 +471,11 @@ void UpdateInstallDialog::Thread::installExtensions()
sal_uInt16 count = 0;
typedef std::vector<UpdateData>::iterator It;
- for (It i = m_aVecUpdateData.begin(); i != m_aVecUpdateData.end(); i++, count++)
+ for (It i = m_aVecUpdateData.begin(); i != m_aVecUpdateData.end(); ++i, ++count)
{
//update the name of the extension which is to be installed
{
- ::vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -498,7 +499,7 @@ void UpdateInstallDialog::Thread::installExtensions()
cssu::Reference< css::task::XAbortChannel > xAbortChannel(
curData.aInstalledPackage->createAbortChannel() );
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -554,7 +555,7 @@ void UpdateInstallDialog::Thread::installExtensions()
if (bLicenseDeclined)
{
- ::vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -563,7 +564,7 @@ void UpdateInstallDialog::Thread::installExtensions()
}
else if (!xExtension.is() || bError)
{
- ::vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -572,7 +573,7 @@ void UpdateInstallDialog::Thread::installExtensions()
}
}
{
- vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -599,7 +600,7 @@ void UpdateInstallDialog::Thread::removeTempDownloads()
void UpdateInstallDialog::Thread::download(OUString const & sDownloadURL, UpdateData & aUpdateData)
{
{
- ::vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -634,7 +635,7 @@ void UpdateInstallDialog::Thread::download(OUString const & sDownloadURL, Update
{
//the user may have cancelled the dialog because downloading took to long
{
- ::vos::OGuard g(Application::GetSolarMutex());
+ SolarMutexGuard g;
if (m_stop) {
return;
}
@@ -754,3 +755,5 @@ void UpdateCommandEnv::pop() throw (cssu::RuntimeException)
} //end namespace dp_gui
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
index 73041853d3..a23488bfbf 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.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.
@@ -29,9 +30,7 @@
#define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_GUI_DP_GUI_INSTALLDIALOG_HXX
#include "sal/config.h"
-#ifndef _SV_BUTTON_HXX
#include "vcl/button.hxx"
-#endif
#include "vcl/fixed.hxx"
#include "vcl/dialog.hxx"
#include "svtools/prgsbar.hxx"
@@ -142,3 +141,5 @@ private:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx
index c8c79dbdbc..da6d04a67e 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.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.
@@ -89,7 +90,7 @@ protected:
};
struct LicenseDialogImpl : public ModalDialog
-{
+{
cssu::Reference<cssu::XComponentContext> m_xComponentContext;
FixedText m_ftHead;
FixedText m_ftBody1;
@@ -101,7 +102,7 @@ struct LicenseDialogImpl : public ModalDialog
LicenseView m_mlLicense;
PushButton m_pbDown;
FixedLine m_flBottom;
-
+
OKButton m_acceptButton;
CancelButton m_declineButton;
@@ -120,7 +121,7 @@ struct LicenseDialogImpl : public ModalDialog
const ::rtl::OUString & sLicenseText);
virtual void Activate();
-
+
};
LicenseView::LicenseView( Window* pParent, const ResId& rResId )
@@ -214,13 +215,6 @@ LicenseDialogImpl::LicenseDialogImpl(
{
- if (GetSettings().GetStyleSettings().GetHighContrastMode())
- {
- // high contrast mode needs other images
- m_fiArrow1.SetImage(Image(DpGuiResId(IMG_LICENCE_ARROW_HC)));
- m_fiArrow2.SetImage(Image(DpGuiResId(IMG_LICENCE_ARROW_HC)));
- }
-
FreeResource();
m_acceptButton.SetUniqueId(UID_BTN_LICENSE_ACCEPT);
@@ -306,7 +300,7 @@ LicenseDialog::LicenseDialog( Sequence<Any> const& args,
//______________________________________________________________________________
void LicenseDialog::setTitle( OUString const & ) throw (RuntimeException)
{
-
+
}
//______________________________________________________________________________
@@ -328,3 +322,4 @@ sal_Int16 LicenseDialog::solar_execute()
} // namespace dp_gui
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/license_dialog.hxx b/desktop/source/deployment/gui/license_dialog.hxx
index 1f190298ff..7e7a8592e6 100644
--- a/desktop/source/deployment/gui/license_dialog.hxx
+++ b/desktop/source/deployment/gui/license_dialog.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.
@@ -69,3 +70,5 @@ public:
};
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/makefile.mk b/desktop/source/deployment/gui/makefile.mk
index fe3921bf50..5f73df487d 100644
--- a/desktop/source/deployment/gui/makefile.mk
+++ b/desktop/source/deployment/gui/makefile.mk
@@ -55,7 +55,6 @@ SLOFILES = \
$(SLO)$/dp_gui_updatedialog.obj \
$(SLO)$/dp_gui_updateinstalldialog.obj \
$(SLO)$/dp_gui_autoscrolledit.obj \
- $(SLO)$/dp_gui_system.obj \
$(SLO)$/dp_gui_extensioncmdqueue.obj \
$(SLO)$/descedit.obj
diff --git a/desktop/source/deployment/inc/db.hxx b/desktop/source/deployment/inc/db.hxx
index 414d3639d4..3fa3d22679 100644
--- a/desktop/source/deployment/inc/db.hxx
+++ b/desktop/source/deployment/inc/db.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.
@@ -27,6 +28,8 @@
#ifndef BERKELEYDBPROXY_DB_HXX_
#define BERKELEYDBPROXY_DB_HXX_
+#include <boost/noncopyable.hpp>
+
#ifdef SYSTEM_DB
#include <db.h>
#else
@@ -42,26 +45,12 @@ extern "C" {
typedef void (*db_free_fcn_type)(void *);
}
-
namespace berkeleydbproxy {
class DbEnv;
class Dbc;
class Dbt;
- namespace db_internal
- {
- class Noncopyable
- {
- // not implemented
- Noncopyable(const Noncopyable&);
- void operator=(const Noncopyable&);
- protected:
- Noncopyable() {}
- ~Noncopyable() {}
- };
- }
-
class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC DbException
{
rtl::OString what_;
@@ -77,7 +66,7 @@ namespace berkeleydbproxy {
};
- class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC DbEnv : db_internal::Noncopyable
+ class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC DbEnv : boost::noncopyable
{
friend class Db;
@@ -88,7 +77,7 @@ namespace berkeleydbproxy {
static char *strerror(int);
};
- class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Db : db_internal::Noncopyable
+ class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Db : boost::noncopyable
{
private:
DB* m_pDBP;
@@ -115,7 +104,7 @@ namespace berkeleydbproxy {
int cursor(DB_TXN *txnid, Dbc **cursorp, u_int32_t flags);
};
- class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Dbc : db_internal::Noncopyable
+ class DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Dbc : boost::noncopyable
{
friend class Db;
friend class Dbt;
@@ -155,19 +144,4 @@ namespace berkeleydbproxy {
}
#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_dependencies.hxx b/desktop/source/deployment/inc/dp_dependencies.hxx
index 67a92937a5..2e57c06275 100644
--- a/desktop/source/deployment/inc/dp_dependencies.hxx
+++ b/desktop/source/deployment/inc/dp_dependencies.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.
@@ -80,3 +81,5 @@ namespace Dependencies {
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
index debdae591f..78b824c87a 100644
--- a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
+++ b/desktop/source/deployment/inc/dp_descriptioninfoset.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.
@@ -297,3 +298,5 @@ DescriptionInfoset getDescriptionInfoset(::rtl::OUString const & sExtensionFolde
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_identifier.hxx b/desktop/source/deployment/inc/dp_identifier.hxx
index 18c75e0505..f7b6b1f120 100644
--- a/desktop/source/deployment/inc/dp_identifier.hxx
+++ b/desktop/source/deployment/inc/dp_identifier.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.
@@ -90,3 +91,5 @@ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::rtl::OUString generateLegacyIdentifier(
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_interact.h b/desktop/source/deployment/inc/dp_interact.h
index 6999e022b6..3aca761c2d 100644
--- a/desktop/source/deployment/inc/dp_interact.h
+++ b/desktop/source/deployment/inc/dp_interact.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.
@@ -148,3 +149,5 @@ public:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_misc.h b/desktop/source/deployment/inc/dp_misc.h
index b6b127579c..bbf6d5274b 100644
--- a/desktop/source/deployment/inc/dp_misc.h
+++ b/desktop/source/deployment/inc/dp_misc.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.
@@ -177,3 +178,5 @@ void syncRepositories(::com::sun::star::uno::Reference<
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_misc_api.hxx b/desktop/source/deployment/inc/dp_misc_api.hxx
index a1604df089..bc2cee1df2 100644
--- a/desktop/source/deployment/inc/dp_misc_api.hxx
+++ b/desktop/source/deployment/inc/dp_misc_api.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.
@@ -38,3 +39,5 @@
#endif
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_persmap.h b/desktop/source/deployment/inc/dp_persmap.h
index 5e3e1eaf70..b1597f3bb5 100644
--- a/desktop/source/deployment/inc/dp_persmap.h
+++ b/desktop/source/deployment/inc/dp_persmap.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.
@@ -63,3 +64,5 @@ public:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_platform.hxx b/desktop/source/deployment/inc/dp_platform.hxx
index 5ef5fe080d..f9773efa1a 100644
--- a/desktop/source/deployment/inc/dp_platform.hxx
+++ b/desktop/source/deployment/inc/dp_platform.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.
@@ -29,9 +30,7 @@
#define INCLUDED_DP_PLATFORM_HXX
-#ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_MISC_API_HXX
#include "dp_misc_api.hxx"
-#endif
#include "com/sun/star/uno/Sequence.hxx"
#include "rtl/ustring.hxx"
@@ -54,3 +53,5 @@ bool hasValidPlatform( ::com::sun::star::uno::Sequence< ::rtl::OUString > const
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_resource.h b/desktop/source/deployment/inc/dp_resource.h
index 03d28c4d87..96fd049207 100644
--- a/desktop/source/deployment/inc/dp_resource.h
+++ b/desktop/source/deployment/inc/dp_resource.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.
@@ -65,3 +66,5 @@ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_ucb.h b/desktop/source/deployment/inc/dp_ucb.h
index 1409b27d6a..c2fcdcd7e0 100644
--- a/desktop/source/deployment/inc/dp_ucb.h
+++ b/desktop/source/deployment/inc/dp_ucb.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.
@@ -89,3 +90,5 @@ bool readProperties( ::std::list< ::std::pair< ::rtl::OUString, ::rtl::OUString>
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_version.hxx b/desktop/source/deployment/inc/dp_version.hxx
index 8e364823a1..c3491a7451 100644
--- a/desktop/source/deployment/inc/dp_version.hxx
+++ b/desktop/source/deployment/inc/dp_version.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.
@@ -46,3 +47,5 @@ DESKTOP_DEPLOYMENTMISC_DLLPUBLIC Order compareVersions(
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_xml.h b/desktop/source/deployment/inc/dp_xml.h
index cad9e91bb5..376df332fb 100644
--- a/desktop/source/deployment/inc/dp_xml.h
+++ b/desktop/source/deployment/inc/dp_xml.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.
@@ -55,3 +56,5 @@ void xml_parse(
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/manager/dp_activepackages.cxx b/desktop/source/deployment/manager/dp_activepackages.cxx
index f5866cb41a..950e46174d 100644
--- a/desktop/source/deployment/manager/dp_activepackages.cxx
+++ b/desktop/source/deployment/manager/dp_activepackages.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.
@@ -204,3 +205,5 @@ void ActivePackages::erase(
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/manager/dp_activepackages.hxx b/desktop/source/deployment/manager/dp_activepackages.hxx
index be2c3a20e0..569e4b7852 100644
--- a/desktop/source/deployment/manager/dp_activepackages.hxx
+++ b/desktop/source/deployment/manager/dp_activepackages.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.
@@ -97,3 +98,5 @@ private:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx
index 48c88bccc1..ac9b17aedc 100644
--- a/desktop/source/deployment/manager/dp_informationprovider.cxx
+++ b/desktop/source/deployment/manager/dp_informationprovider.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.
@@ -368,3 +369,4 @@ bool singleton_entries(
} // namespace dp_info
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 48081fe7b7..645163edbb 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.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.
@@ -1694,3 +1695,4 @@ void PackageManagerImpl::CmdEnvWrapperImpl::pop() throw (RuntimeException)
} // namespace dp_manager
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/manager/dp_manager.h b/desktop/source/deployment/manager/dp_manager.h
index d99f41d42c..fa4a9078ac 100644
--- a/desktop/source/deployment/manager/dp_manager.h
+++ b/desktop/source/deployment/manager/dp_manager.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.
@@ -292,3 +293,4 @@ inline void PackageManagerImpl::logIntern( css::uno::Any const & status )
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/manager/dp_managerfac.cxx b/desktop/source/deployment/manager/dp_managerfac.cxx
index ec312621c7..ccbaadcb8a 100644
--- a/desktop/source/deployment/manager/dp_managerfac.cxx
+++ b/desktop/source/deployment/manager/dp_managerfac.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.
@@ -198,3 +199,4 @@ PackageManagerFactoryImpl::getPackageManager( OUString const & context )
} // namespace factory
} // namespace dp_manager
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/misc/db.cxx b/desktop/source/deployment/misc/db.cxx
index 3a559b8ae5..ce403181ab 100644
--- a/desktop/source/deployment/misc/db.cxx
+++ b/desktop/source/deployment/misc/db.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.
@@ -270,3 +271,4 @@ void db_internal::raise_error(int dberr, const char * where)
//----------------------------------------------------------------------------
} // namespace ecomp
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx
index 599826a957..b190783c40 100644
--- a/desktop/source/deployment/misc/dp_dependencies.cxx
+++ b/desktop/source/deployment/misc/dp_dependencies.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.
@@ -80,14 +81,14 @@ check(::dp_misc::DescriptionInfoset const & infoset) {
unsatisfied(n);
::sal_Int32 unsat = 0;
for (::sal_Int32 i = 0; i < n; ++i) {
- static char const minimalVersion[] = "OpenOffice.org-minimal-version";
+ static rtl::OUString const minimalVersion(
+ RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org-minimal-version"));
css::uno::Reference< css::xml::dom::XElement > e(
deps->item(i), css::uno::UNO_QUERY_THROW);
bool sat = false;
if (e->getNamespaceURI().equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM(xmlNamespace))
- && e->getTagName().equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM(minimalVersion)))
+ && (e->getTagName() == minimalVersion))
{
sat = satisfiesMinimalVersion(
e->getAttribute(
@@ -107,19 +108,16 @@ check(::dp_misc::DescriptionInfoset const & infoset) {
::dp_misc::compareVersions(
v,
e->getAttribute(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))))
- != ::dp_misc::GREATER;
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))));
} else if (e->hasAttributeNS(
::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(xmlNamespace)),
- ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(minimalVersion))))
+ minimalVersion))
{
sat = satisfiesMinimalVersion(
e->getAttributeNS(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(xmlNamespace)),
- ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(minimalVersion))));
+ minimalVersion));
}
if (!sat) {
unsatisfied[unsat++] = e;
@@ -169,3 +167,5 @@ check(::dp_misc::DescriptionInfoset const & infoset) {
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index e73aeb2780..0efc0ae091 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.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.
@@ -862,3 +863,5 @@ DescriptionInfoset::getChildWithDefaultLocale(css::uno::Reference< css::xml::dom
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/misc/dp_identifier.cxx b/desktop/source/deployment/misc/dp_identifier.cxx
index 4126a99cd5..f9fb809b51 100644
--- a/desktop/source/deployment/misc/dp_identifier.cxx
+++ b/desktop/source/deployment/misc/dp_identifier.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.
@@ -71,3 +72,5 @@ namespace dp_misc {
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/misc/dp_interact.cxx b/desktop/source/deployment/misc/dp_interact.cxx
index 89c2e9a06f..57cc3bf2e7 100644
--- a/desktop/source/deployment/misc/dp_interact.cxx
+++ b/desktop/source/deployment/misc/dp_interact.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.
@@ -183,3 +184,4 @@ void AbortChannel::sendAbort() throw (RuntimeException)
} // dp_misc
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index c988e6494b..7e6f9ddb0b 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.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,12 +54,10 @@
#include <comphelper/processfactory.hxx>
#ifdef WNT
-//#include "tools/prewin.h"
#define UNICODE
#define _UNICODE
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
-//#include "tools/postwin.h"
#endif
using namespace ::com::sun::star;
@@ -420,7 +419,7 @@ oslProcess raiseProcess(
case osl_Process_E_NotFound:
throw RuntimeException( OUSTR("image not found!"), 0 );
case osl_Process_E_TimedOut:
- throw RuntimeException( OUSTR("timout occured!"), 0 );
+ throw RuntimeException( OUSTR("timout occurred!"), 0 );
case osl_Process_E_NoPermission:
throw RuntimeException( OUSTR("permission denied!"), 0 );
case osl_Process_E_Unknown:
@@ -628,3 +627,5 @@ void syncRepositories(Reference<ucb::XCommandEnvironment> const & xCmdEnv)
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx
index 3c002a9b47..dff464b829 100644
--- a/desktop/source/deployment/misc/dp_platform.cxx
+++ b/desktop/source/deployment/misc/dp_platform.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.
@@ -62,11 +63,16 @@
#define PLATFORM_SOLARIS_X86 "solaris_x86"
#define PLATFORM_FREEBSD_X86 "freebsd_x86"
#define PLATFORM_FREEBSD_X86_64 "freebsd_x86_64"
+#define PLATFORM_NETBSD_X86 "netbsd_x86"
+#define PLATFORM_NETBSD_X86_64 "netbsd_x86_64"
#define PLATFORM_MACOSX_X86 "macosx_x86"
#define PLATFORM_MACOSX_PPC "macosx_powerpc"
#define PLATFORM_OS2_X86 "os2_x86"
+#define PLATFORM_OPENBSD_X86 "openbsd_x86"
+#define PLATFORM_OPENBSD_X86_64 "openbsd_x86_64"
+#define PLATFORM_AIX_POWERPC "aix_powerpc"
@@ -107,9 +113,7 @@ namespace
::rtl::OUStringBuffer buf;
buf.append( StrOperatingSystem::get() );
buf.append( static_cast<sal_Unicode>('_') );
- OUString arch( RTL_CONSTASCII_USTRINGPARAM("$_ARCH") );
- ::rtl::Bootstrap::expandMacros( arch );
- buf.append( arch );
+ buf.append( StrCPU::get() );
return buf.makeStringAndClear();
}
};
@@ -171,16 +175,26 @@ namespace
ret = checkOSandCPU(OUSTR("FreeBSD"), OUSTR("x86"));
else if (token.equals(OUSTR(PLATFORM_FREEBSD_X86_64)))
ret = checkOSandCPU(OUSTR("FreeBSD"), OUSTR("X86_64"));
+ else if (token.equals(OUSTR(PLATFORM_NETBSD_X86)))
+ ret = checkOSandCPU(OUSTR("NetBSD"), OUSTR("x86"));
+ else if (token.equals(OUSTR(PLATFORM_NETBSD_X86_64)))
+ ret = checkOSandCPU(OUSTR("NetBSD"), OUSTR("X86_64"));
else if (token.equals(OUSTR(PLATFORM_MACOSX_X86)))
ret = checkOSandCPU(OUSTR("MacOSX"), OUSTR("x86"));
else if (token.equals(OUSTR(PLATFORM_MACOSX_PPC)))
ret = checkOSandCPU(OUSTR("MacOSX"), OUSTR("PowerPC"));
else if (token.equals(OUSTR(PLATFORM_OS2_X86)))
ret = checkOSandCPU(OUSTR("OS2"), OUSTR("x86"));
+ else if (token.equals(OUSTR(PLATFORM_AIX_POWERPC)))
+ ret = checkOSandCPU(OUSTR("AIX"), OUSTR("PowerPC"));
+ else if (token.equals(OUSTR(PLATFORM_OPENBSD_X86)))
+ ret = checkOSandCPU(OUSTR("OpenBSD"), OUSTR("x86"));
+ else if (token.equals(OUSTR(PLATFORM_OPENBSD_X86_64)))
+ ret = checkOSandCPU(OUSTR("OpenBSD"), OUSTR("X86_64"));
else
{
OSL_ENSURE(0, "Extension Manager: The extension supports an unknown platform. "
- "Check the platform element in the descripion.xml");
+ "Check the platform element in the description.xml");
ret = false;
}
return ret;
@@ -230,3 +244,4 @@ bool hasValidPlatform( css::uno::Sequence<OUString> const & platformStrings)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx
index 4a82c7b2fa..eb92eabba3 100644
--- a/desktop/source/deployment/misc/dp_resource.cxx
+++ b/desktop/source/deployment/misc/dp_resource.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.
@@ -231,3 +232,4 @@ lang::Locale getOfficeLocale()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/misc/dp_ucb.cxx b/desktop/source/deployment/misc/dp_ucb.cxx
index 122cbb6ecf..170a403ddc 100644
--- a/desktop/source/deployment/misc/dp_ucb.cxx
+++ b/desktop/source/deployment/misc/dp_ucb.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.
@@ -318,3 +319,5 @@ bool readProperties( ::std::list< ::std::pair< ::rtl::OUString, ::rtl::OUString>
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/misc/dp_version.cxx b/desktop/source/deployment/misc/dp_version.cxx
index 563612c675..c999d32cc2 100644
--- a/desktop/source/deployment/misc/dp_version.cxx
+++ b/desktop/source/deployment/misc/dp_version.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.
@@ -72,3 +73,5 @@ namespace dp_misc {
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index e36ecacd2e..6909283550 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.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.
@@ -574,16 +575,14 @@ BackendImpl::BackendImpl(
getPlatformString(),
OUSTR("*" SAL_DLLEXTENSION),
getResourceString(RID_STR_DYN_COMPONENT),
- RID_IMG_COMPONENT,
- RID_IMG_COMPONENT_HC ) ),
+ RID_IMG_COMPONENT) ),
m_xJavaComponentTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.uno-component;"
"type=Java"),
OUSTR("*.jar"),
getResourceString(RID_STR_JAVA_COMPONENT),
- RID_IMG_JAVA_COMPONENT,
- RID_IMG_JAVA_COMPONENT_HC ) ),
+ RID_IMG_JAVA_COMPONENT) ),
m_xPythonComponentTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.uno-component;"
@@ -606,7 +605,7 @@ BackendImpl::BackendImpl(
"type=RDB"),
OUSTR("*.rdb"),
getResourceString(RID_STR_RDB_TYPELIB),
- RID_IMG_TYPELIB, RID_IMG_TYPELIB_HC ) ),
+ RID_IMG_TYPELIB ) ),
m_xJavaTypelibTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.uno-typelibrary;"
@@ -1845,3 +1844,4 @@ extern sdecl::ServiceDecl const serviceDecl(
} // namespace dp_registry
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 07cd063732..d160147c40 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.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.
@@ -193,13 +194,13 @@ BackendImpl::BackendImpl(
"vnd.sun.star.configuration-data"),
OUSTR("*.xcu"),
getResourceString(RID_STR_CONF_DATA),
- RID_IMG_CONF_XML, RID_IMG_CONF_XML_HC ) ),
+ RID_IMG_CONF_XML ) ),
m_xConfSchemaTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.configuration-schema"),
OUSTR("*.xcs"),
getResourceString(RID_STR_CONF_SCHEMA),
- RID_IMG_CONF_XML, RID_IMG_CONF_XML_HC ) ),
+ RID_IMG_CONF_XML ) ),
m_typeInfos( 2 )
{
m_typeInfos[ 0 ] = m_xConfDataTypeInfo;
@@ -706,7 +707,10 @@ void BackendImpl::PackageImpl::processPackage_(
OSL_ASSERT(data);
that->addToConfigmgrIni( m_isSchema, false, data->iniEntry, xCmdEnv );
}
- else
+ //No need for live-deployment for bundled extension, because OOo
+ //restarts after installation
+ if (that->m_eContext != CONTEXT_BUNDLED
+ && !startup)
{
ConfigurationBackendDb::Data data;
if (!m_isSchema)
@@ -742,6 +746,9 @@ void BackendImpl::PackageImpl::processPackage_(
data.iniEntry = dp_misc::makeRcTerm(url);
that->addDataToDb(getURL(), data);
}
+ that->addToConfigmgrIni( m_isSchema, url, xCmdEnv );
+ data.iniEntry = dp_misc::makeRcTerm(url);
+ that->addDataToDb(getURL(), data);
}
else // revoke
{
@@ -819,3 +826,4 @@ extern sdecl::ServiceDecl const serviceDecl(
} // namespace backend
} // namespace dp_registry
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 3062dd130c..3e447d33dc 100755
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.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.
@@ -638,7 +639,7 @@ beans::Optional< beans::Ambiguous<sal_Bool> > Package::isRegistered(
catch (Exception &) {
Any exc( ::cppu::getCaughtException() );
throw deployment::DeploymentException(
- OUSTR("unexpected exception occured!"),
+ OUSTR("unexpected exception occurred!"),
static_cast<OWeakObject *>(this), exc );
}
}
@@ -808,15 +809,23 @@ OUString Package::TypeInfo::getFileFilter() throw (RuntimeException)
}
//______________________________________________________________________________
-Any Package::TypeInfo::getIcon( sal_Bool highContrast, sal_Bool smallIcon )
+/**************************
+ * Get Icon
+ *
+ * @param highContrast NOTE: disabled the returning of high contrast icons.
+ * This bool is a noop now.
+ * @param smallIcon Return the small version of the icon
+ */
+Any Package::TypeInfo::getIcon( sal_Bool /*highContrast*/, sal_Bool smallIcon )
throw (RuntimeException)
{
if (! smallIcon)
return Any();
- const sal_uInt16 nIconId = (highContrast ? m_smallIcon_HC : m_smallIcon);
+ const sal_uInt16 nIconId = m_smallIcon;
return Any( &nIconId, getCppuType( static_cast<sal_uInt16 const *>(0) ) );
}
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx
index 6c9f5d231e..f60bc7a822 100644
--- a/desktop/source/deployment/registry/dp_registry.cxx
+++ b/desktop/source/deployment/registry/dp_registry.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.
@@ -574,3 +575,4 @@ Reference<deployment::XPackageRegistry> SAL_CALL create(
} // namespace dp_registry
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx
index 09bf296b79..54385830ae 100644
--- a/desktop/source/deployment/registry/executable/dp_executable.cxx
+++ b/desktop/source/deployment/registry/executable/dp_executable.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.
@@ -71,7 +72,6 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
bool getFileAttributes(sal_uInt64& out_Attributes);
bool isUrlTargetInExtension();
-
public:
inline ExecutablePackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
@@ -121,8 +121,7 @@ BackendImpl::BackendImpl(
OUSTR("application/vnd.sun.star.executable"),
OUSTR(""),
OUSTR("Executable"),
- RID_IMG_COMPONENT,
- RID_IMG_COMPONENT_HC ) )
+ RID_IMG_COMPONENT ) )
{
if (!transientMode())
{
@@ -343,3 +342,4 @@ extern sdecl::ServiceDecl const serviceDecl(
} // namespace dp_registry
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/migration.hxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx.orig
index 3ba0d8fd80..ddb3a29447 100644
--- a/desktop/source/migration/migration.hxx
+++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx.orig
@@ -25,22 +25,52 @@
*
************************************************************************/
-#ifndef _DESKTOP_MIGRATION_HXX_
-#define _DESKTOP_MIGRATION_HXX_
+#if ! defined INCLUDED_DP_EXECUTABLEBACKENDDB_HXX
+#define INCLUDED_DP_EXECUTABLEBACKENDDB_HXX
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
+#include "rtl/ustring.hxx"
+#include "dp_backenddb.hxx"
-namespace desktop {
+namespace css = ::com::sun::star;
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+}}}
+
+namespace dp_registry {
+namespace backend {
+namespace executable {
+
+/* The XML file stores the extensions which are currently registered.
+ They will be removed when they are revoked.
+ The format looks like this:
+
+<?xml version="1.0"?>
+ */
+class ExecutableBackendDb: public dp_registry::backend::RegisteredDb
+{
+protected:
+ virtual ::rtl::OUString getDbNSName();
+
+ virtual ::rtl::OUString getNSPrefix();
+
+ virtual ::rtl::OUString getRootElementName();
+
+ virtual ::rtl::OUString getKeyElementName();
-class Migration
-{
public:
- // starts the migration process
- static void doMigration();
- static void cancelMigration();
- static sal_Bool checkMigration();
- static rtl::OUString getOldVersionName();
+
+ ExecutableBackendDb( css::uno::Reference<css::uno::XComponentContext> const & xContext,
+ ::rtl::OUString const & url);
+
};
+
+
+
+}
+}
}
#endif
+
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index 02a2b9d80f..c7dbe773ea 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -1,10 +1,11 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
- * OpenOffice.org - a multi-platform office productivity suite
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* This file is part of OpenOffice.org.
*
@@ -115,7 +116,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
Reference< ucb::XSimpleFileAccess > getFileAccess( void );
Reference< ucb::XSimpleFileAccess > m_xSFA;
-
+
const Reference<deployment::XPackageTypeInfo> m_xHelpTypeInfo;
Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos;
std::auto_ptr<HelpBackendDb> m_backendDb;
@@ -123,7 +124,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
public:
BackendImpl( Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext );
-
+
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
@@ -142,7 +143,7 @@ BackendImpl::BackendImpl(
OUSTR("application/vnd.sun.star.help"),
rtl::OUString(),
getResourceString(RID_STR_HELP),
- RID_IMG_HELP, RID_IMG_HELP_HC ) ),
+ RID_IMG_HELP ) ),
m_typeInfos( 1 )
{
m_typeInfos[ 0 ] = m_xHelpTypeInfo;
@@ -190,7 +191,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
throw lang::IllegalArgumentException(
StrCannotDetectMediaType::get() + url,
static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
-
+
String type, subType;
INetContentTypeParameterList params;
if (INetContentTypes::parse( mediaType_, type, subType, &params ))
@@ -273,12 +274,12 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
{
BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
if (NULL == pBackend)
- {
+ {
//May throw a DisposedException
check();
//We should never get here...
throw RuntimeException(
- OUSTR("Failed to get the BackendImpl"),
+ OUSTR("Failed to get the BackendImpl"),
static_cast<OWeakObject*>(const_cast<PackageImpl *>(this)));
}
return pBackend;
@@ -635,7 +636,7 @@ void BackendImpl::implCollectXhpFiles( const rtl::OUString& aDir,
if( nLastDot != -1 )
{
rtl::OUString aExt = aURL.copy( nLastDot + 1 );
- if( aExt.equalsIgnoreAsciiCase( rtl::OUString::createFromAscii( "xhp" ) ) )
+ if( aExt.equalsIgnoreAsciiCase( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "xhp" )) ) )
o_rXhpFileVector.push_back( aURL );
}
}
@@ -649,17 +650,17 @@ Reference< ucb::XSimpleFileAccess > BackendImpl::getFileAccess( void )
Reference<XComponentContext> const & xContext = getComponentContext();
if( xContext.is() )
{
- m_xSFA = Reference< ucb::XSimpleFileAccess >(
+ m_xSFA = Reference< ucb::XSimpleFileAccess >(
xContext->getServiceManager()->createInstanceWithContext(
- rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" )),
xContext ), UNO_QUERY );
}
if( !m_xSFA.is() )
{
throw RuntimeException(
- ::rtl::OUString::createFromAscii(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"dp_registry::backend::help::BackendImpl::getFileAccess(), "
- "could not instatiate SimpleFileAccess." ),
+ "could not instatiate SimpleFileAccess." )),
Reference< XInterface >() );
}
}
@@ -679,3 +680,4 @@ extern sdecl::ServiceDecl const serviceDecl(
} // namespace backend
} // namespace dp_registry
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h
index 0de8cc43ee..a8299aa1db 100755
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.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.
@@ -55,8 +56,7 @@ namespace css = ::com::sun::star;
class PackageRegistryBackend;
-char const* const BACKEND_SERVICE_NAME =
-"com.sun.star.deployment.PackageRegistryBackend";
+#define BACKEND_SERVICE_NAME "com.sun.star.deployment.PackageRegistryBackend"
typedef ::cppu::WeakComponentImplHelper1<
css::deployment::XPackage > t_PackageBase;
@@ -121,16 +121,16 @@ public:
const ::rtl::OUString m_mediaType;
const ::rtl::OUString m_fileFilter;
const ::rtl::OUString m_shortDescr;
- const sal_uInt16 m_smallIcon, m_smallIcon_HC;
+ const sal_uInt16 m_smallIcon;
public:
virtual ~TypeInfo();
TypeInfo( ::rtl::OUString const & mediaType,
::rtl::OUString const & fileFilter,
::rtl::OUString const & shortDescr,
- sal_uInt16 smallIcon, sal_uInt16 smallIcon_HC )
+ sal_uInt16 smallIcon)
: m_mediaType(mediaType), m_fileFilter(fileFilter),
m_shortDescr(shortDescr),
- m_smallIcon(smallIcon), m_smallIcon_HC(smallIcon_HC)
+ m_smallIcon(smallIcon)
{}
// XPackageTypeInfo
virtual ::rtl::OUString SAL_CALL getMediaType()
@@ -398,3 +398,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 11514f342d..30c5923fc4 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.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.
@@ -306,8 +307,7 @@ BackendImpl::BackendImpl(
OUSTR("application/vnd.sun.star.package-bundle"),
OUSTR("*.oxt;*.uno.pkg"),
getResourceString(RID_STR_PACKAGE_BUNDLE),
- RID_IMG_DEF_PACKAGE_BUNDLE,
- RID_IMG_DEF_PACKAGE_BUNDLE_HC ) ),
+ RID_IMG_DEF_PACKAGE_BUNDLE ) ),
m_xLegacyBundleTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.legacy-package-bundle"),
@@ -352,7 +352,7 @@ Sequence<OUString> BackendImpl::getSupportedServiceNames()
throw (RuntimeException)
{
return comphelper::makeSequence(
- OUString::createFromAscii(BACKEND_SERVICE_NAME) );
+ OUString(RTL_CONSTASCII_USTRINGPARAM(BACKEND_SERVICE_NAME)) );
}
// XPackageRegistry
@@ -1693,3 +1693,4 @@ Reference<deployment::XPackageRegistry> create(
} // namespace backend
} // namespace dp_registry
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/script/dp_lib_container.cxx b/desktop/source/deployment/registry/script/dp_lib_container.cxx
index 9eeae38260..ccc2b29874 100644
--- a/desktop/source/deployment/registry/script/dp_lib_container.cxx
+++ b/desktop/source/deployment/registry/script/dp_lib_container.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,11 +29,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/ucb/XCommandEnvironment.hpp"
+
#include "dp_script.hrc"
#include "dp_resource.h"
#include "dp_xml.h"
#include "dp_lib_container.h"
+
+#include "rtl/ustring.hxx"
#include "ucbhelper/content.hxx"
+#include "xmlscript/xmllib_imexp.hxx"
using namespace ::dp_misc;
@@ -71,3 +78,4 @@ OUString LibraryContainer::get_libname(
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/script/dp_lib_container.h b/desktop/source/deployment/registry/script/dp_lib_container.h
index 3a3079755c..009846a3c0 100644
--- a/desktop/source/deployment/registry/script/dp_lib_container.h
+++ b/desktop/source/deployment/registry/script/dp_lib_container.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.
@@ -28,11 +29,20 @@
#if ! defined INCLUDED_DP_LIB_CONTAINER_H
#define INCLUDED_DP_LIB_CONTAINER_H
-#include "rtl/ustring.hxx"
-#include "xmlscript/xmllib_imexp.hxx"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "com/sun/star/ucb/XCommandEnvironment.hpp"
+#include <com/sun/star/uno/Reference.hxx>
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+ namespace ucb {
+ class XCommandEnvironment;
+ }
+}}}
+
+namespace rtl {
+ class OUString;
+}
namespace css = ::com::sun::star;
@@ -55,3 +65,5 @@ public:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx
index ab9a346b5a..afd0d179de 100644
--- a/desktop/source/deployment/registry/script/dp_script.cxx
+++ b/desktop/source/deployment/registry/script/dp_script.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.
@@ -61,7 +62,6 @@ namespace {
typedef ::cppu::ImplInheritanceHelper1<
::dp_registry::backend::PackageRegistryBackend, util::XUpdatable > t_helper;
-//==============================================================================
class BackendImpl : public t_helper
{
class PackageImpl : public ::dp_registry::backend::Package
@@ -83,7 +83,7 @@ class BackendImpl : public t_helper
bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
-
+
public:
PackageImpl(
::rtl::Reference<BackendImpl> const & myBackend,
@@ -162,13 +162,13 @@ BackendImpl::BackendImpl(
"vnd.sun.star.basic-library"),
OUString() /* no file filter */,
getResourceString(RID_STR_BASIC_LIB),
- RID_IMG_SCRIPTLIB, RID_IMG_SCRIPTLIB_HC ) ),
+ RID_IMG_SCRIPTLIB) ),
m_xDialogLibTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.dialog-library"),
OUString() /* no file filter */,
getResourceString(RID_STR_DIALOG_LIB),
- RID_IMG_DIALOGLIB, RID_IMG_DIALOGLIB_HC ) ),
+ RID_IMG_DIALOGLIB) ),
m_typeInfos( 2 )
{
m_typeInfos[ 0 ] = m_xBasicLibTypeInfo;
@@ -314,15 +314,13 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
}
return pBackend;
}
-//______________________________________________________________________________
+
beans::Optional< beans::Ambiguous<sal_Bool> >
BackendImpl::PackageImpl::isRegistered_(
- ::osl::ResettableMutexGuard &,
- ::rtl::Reference<AbortChannel> const &,
- Reference<XCommandEnvironment> const & xCmdEnv )
+ ::osl::ResettableMutexGuard & /* guard */,
+ ::rtl::Reference<AbortChannel> const & /* abortChannel */,
+ Reference<XCommandEnvironment> const & /* xCmdEnv */ )
{
- (void)xCmdEnv;
-
BackendImpl * that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
@@ -332,16 +330,13 @@ BackendImpl::PackageImpl::isRegistered_(
beans::Ambiguous<sal_Bool>( registered, false /* IsAmbiguous */ ) );
}
-//______________________________________________________________________________
void BackendImpl::PackageImpl::processPackage_(
- ::osl::ResettableMutexGuard &,
+ ::osl::ResettableMutexGuard & /* guard */,
bool doRegisterPackage,
bool startup,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
- (void)xCmdEnv;
-
BackendImpl * that = getMyBackend();
Reference< deployment::XPackage > xThisPackage( this );
@@ -502,3 +497,4 @@ extern sdecl::ServiceDecl const serviceDecl(
} // namespace backend
} // namespace dp_registry
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx
index e09e721b27..63015ab1e4 100644
--- a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx
+++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.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.
@@ -71,3 +72,4 @@ public:
}
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx b/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx
index 7db0952c81..4ac316e785 100644
--- a/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_parceldesc.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.
@@ -98,9 +99,9 @@ ParcelDescDocHandler::startElement( const OUString& aName,
aName + OUSTR("\n"));
if ( !skipIndex )
{
- if ( aName.equals( OUString::createFromAscii( "parcel" ) ) )
+ if ( aName.equals( OUString(RTL_CONSTASCII_USTRINGPARAM( "parcel" )) ) )
{
- m_sLang = xAttribs->getValueByName( OUString::createFromAscii( "language" ) );
+ m_sLang = xAttribs->getValueByName( OUString(RTL_CONSTASCII_USTRINGPARAM( "language" )) );
}
++skipIndex;
}
@@ -128,3 +129,4 @@ void SAL_CALL ParcelDescDocHandler::endElement( const OUString & aName )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/sfwk/dp_parceldesc.hxx b/desktop/source/deployment/registry/sfwk/dp_parceldesc.hxx
index d90a38f376..6d2dc52006 100644
--- a/desktop/source/deployment/registry/sfwk/dp_parceldesc.hxx
+++ b/desktop/source/deployment/registry/sfwk/dp_parceldesc.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.
@@ -87,3 +88,5 @@ public:
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
index 24302351fb..9f0e7730c0 100755
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.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.
@@ -178,7 +179,7 @@ BackendImpl::BackendImpl(
OUSTR("application/vnd.sun.star.framework-script"),
OUString() /* no file filter */,
OUSTR("Scripting Framework Script Library"),
- RID_IMG_SCRIPTLIB, RID_IMG_SCRIPTLIB_HC ) )
+ RID_IMG_SCRIPTLIB ) )
{
if (! transientMode())
{
@@ -274,7 +275,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.framework-script"))
{
- OUString lang = OUString::createFromAscii("Script");
+ OUString lang = OUString(RTL_CONSTASCII_USTRINGPARAM("Script"));
OUString sParcelDescURL = makeURL(
url, OUSTR("parcel-descriptor.xml") );
@@ -430,3 +431,4 @@ extern sdecl::ServiceDecl const serviceDecl(
} // namespace backend
} // namespace dp_registry
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/inc/exithelper.hxx b/desktop/source/inc/exithelper.hxx
index 1d3e8a99dc..441cc06a1b 100644
--- a/desktop/source/inc/exithelper.hxx
+++ b/desktop/source/inc/exithelper.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.
@@ -66,3 +67,5 @@ class ExitHelper
} // namespace desktop
#endif // #ifndef _DESKTOP_EXITHELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/cfgfilter.hxx b/desktop/source/migration/cfgfilter.hxx
deleted file mode 100644
index 7970ed7dbb..0000000000
--- a/desktop/source/migration/cfgfilter.hxx
+++ /dev/null
@@ -1,173 +0,0 @@
-#ifndef _DESKTOP_CFGFILTER_HXX_
-#define _DESKTOP_CFGFILTER_HXX_
-
-#include <stack>
-
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Type.hxx>
-
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/configuration/backend/TemplateIdentifier.hpp>
-
-
-#include "migration_impl.hxx"
-
-#define NS_CSS com::sun::star
-#define NS_UNO com::sun::star::uno
-
-
-namespace desktop {
-
-struct element
-{
- rtl::OUString name;
- rtl::OUString path;
- sal_Bool use;
-
-};
-
-typedef std::stack< element > element_stack;
-
-// XInitialization:
-// -> Source : XLayer
-// XLayer
-// XLayerHandler
-class CConfigFilter : public cppu::WeakImplHelper3<
- NS_CSS::configuration::backend::XLayer,
- NS_CSS::configuration::backend::XLayerHandler,
- NS_CSS::lang::XInitialization>
-{
-
-private:
- NS_UNO::Reference< NS_CSS::configuration::backend::XLayerHandler > m_xLayerHandler;
- NS_UNO::Reference< NS_CSS::configuration::backend::XLayer > m_xSourceLayer;
-
- rtl::OUString m_aCurrentComponent;
-
- const strings_v *m_pvInclude;
- const strings_v *m_pvExclude;
-
- element_stack m_elementStack;
-
- void pushElement(rtl::OUString aName, sal_Bool bUse = sal_True);
- void popElement();
- sal_Bool checkElement(rtl::OUString aName);
- sal_Bool checkCurrentElement();
-
-public:
- CConfigFilter(const strings_v* include, const strings_v* exclude);
-
- // XInitialization
- virtual void SAL_CALL initialize(const NS_UNO::Sequence< NS_UNO::Any >& seqArgs)
- throw (NS_UNO::Exception);
-
- // XLayer
- virtual void SAL_CALL readData(
- const NS_UNO::Reference< NS_CSS::configuration::backend::XLayerHandler >& layerHandler)
- throw (NS_CSS::lang::NullPointerException, NS_CSS::lang::WrappedTargetException,
- NS_CSS::configuration::backend::MalformedDataException);
-
- // XLayerHandler
- virtual void SAL_CALL startLayer()
- throw(::com::sun::star::lang::WrappedTargetException);
-
- virtual void SAL_CALL endLayer()
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL overrideNode(
- const rtl::OUString& aName,
- sal_Int16 aAttributes,
- sal_Bool bClear)
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL addOrReplaceNode(
- const rtl::OUString& aName,
- sal_Int16 aAttributes)
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL addOrReplaceNodeFromTemplate(
- const rtl::OUString& aName,
- const NS_CSS::configuration::backend::TemplateIdentifier& aTemplate,
- sal_Int16 aAttributes )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL endNode()
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL dropNode(
- const rtl::OUString& aName )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL overrideProperty(
- const rtl::OUString& aName,
- sal_Int16 aAttributes,
- const NS_UNO::Type& aType,
- sal_Bool bClear )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL setPropertyValue(
- const NS_UNO::Any& aValue )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL setPropertyValueForLocale(
- const NS_UNO::Any& aValue,
- const rtl::OUString& aLocale )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL endProperty()
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL addProperty(
- const rtl::OUString& aName,
- sal_Int16 aAttributes,
- const NS_UNO::Type& aType )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
- virtual void SAL_CALL addPropertyWithValue(
- const rtl::OUString& aName,
- sal_Int16 aAttributes,
- const NS_UNO::Any& aValue )
- throw(
- ::com::sun::star::configuration::backend::MalformedDataException,
- ::com::sun::star::lang::WrappedTargetException );
-
-};
-
-} // namespace desktop
-#undef NS_CSS
-#undef NS_UNO
-
-#endif
-
-
diff --git a/desktop/source/migration/makefile.mk b/desktop/source/migration/makefile.mk
index bc0cd9a62b..97eecf386b 100644
--- a/desktop/source/migration/makefile.mk
+++ b/desktop/source/migration/makefile.mk
@@ -42,18 +42,11 @@ RSCEXTINC=..$/app
# hacky - is no define
CDEFS+=-I..$/app
+CDEFS+=-I$(PRJ)/inc
SLOFILES = \
- $(SLO)$/migration.obj \
- $(SLO)$/wizard.obj \
- $(SLO)$/pages.obj \
- $(SLO)$/cfgfilter.obj
-
-SRS1NAME= wizard
-SRC1FILES= wizard.src
-
+ $(SLO)$/migration.obj
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
-
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 6396ef1091..6e6ae303ee 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.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,6 @@
#include "migration.hxx"
#include "migration_impl.hxx"
-#include "cfgfilter.hxx"
#include <unotools/textsearch.hxx>
#include <comphelper/processfactory.hxx>
@@ -193,25 +193,41 @@ static const ::rtl::OUString MENU_SUBMENU = ::rtl::OUString::createFromAscii("..
return sIdentifier;
}
-static MigrationImpl *pImpl = 0;
-static Mutex aMutex;
-static MigrationImpl *getImpl()
-{
- MutexGuard aGuard(aMutex);
- if (pImpl == 0)
- pImpl = new MigrationImpl(comphelper::getProcessServiceFactory());
- return pImpl;
-}
+static const ::rtl::OUString MENU_SEPERATOR(RTL_CONSTASCII_USTRINGPARAM(" | "));
+static const ::rtl::OUString MENU_SUBMENU(RTL_CONSTASCII_USTRINGPARAM("..."));
+static const ::rtl::OUString MIGRATION_STAMP_NAME(RTL_CONSTASCII_USTRINGPARAM("/MIGRATED"));
-static void releaseImpl()
+::rtl::OUString retrieveLabelFromCommand(const ::rtl::OUString& sCommand, const ::rtl::OUString& sModuleIdentifier)
{
- MutexGuard aGuard(aMutex);
- if (pImpl != 0)
+ ::rtl::OUString sLabel;
+
+ uno::Reference< container::XNameAccess > xUICommands;
+ uno::Reference< container::XNameAccess > xNameAccess( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.UICommandDescription")) ), uno::UNO_QUERY );
+ if ( xNameAccess.is() )
{
- delete pImpl;
- pImpl = 0;
+ uno::Any a = xNameAccess->getByName( sModuleIdentifier );
+ a >>= xUICommands;
}
-}
+ if (xUICommands.is())
+ {
+ if ( sCommand.getLength() > 0 )
+ {
+ rtl::OUString aStr;
+ ::uno::Sequence< beans::PropertyValue > aPropSeq;
+ try
+ {
+ uno::Any a( xUICommands->getByName( sCommand ));
+ if ( a >>= aPropSeq )
+ {
+ for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
+ {
+ if ( aPropSeq[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Label" ) ))
+ {
+ aPropSeq[i].Value >>= aStr;
+ break;
+ }
+ }
+ }
// static main entry point for the migration process
void Migration::doMigration()
@@ -225,37 +241,108 @@ void Migration::doMigration()
aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
OSL_ENSURE(sal_False, aMsg.getStr());
}
- OSL_ENSURE(bResult, "Migration has not been successfull");
- // shut down migration framework
- releaseImpl();
-}
-void Migration::cancelMigration()
-{
- releaseImpl();
+ return sLabel;
}
-sal_Bool Migration::checkMigration()
+::rtl::OUString mapModuleShortNameToIdentifier(const ::rtl::OUString& sShortName)
{
- return getImpl()->checkMigration();
+ ::rtl::OUString sIdentifier;
+
+ if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartModule"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("swriter"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("scalc"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdraw"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DrawingDocument"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("simpress"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.PresentationDocument"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("smath"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.formula.FormulaProperties"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("schart"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.ChartDocument"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BasicIDE"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.BasicIDE"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dbapp"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sglobal"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.GlobalDocument"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sweb"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.WebDocument"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("swxform"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xforms.XMLFormDocument"));
+
+ else if (sShortName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sbibliography"))))
+ sIdentifier = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Bibliography"));
+
+ return sIdentifier;
}
-OUString Migration::getOldVersionName()
+bool MigrationImpl::alreadyMigrated()
{
- return getImpl()->getOldVersionName();
+ rtl::OUString aStr = m_aInfo.userdata + MIGRATION_STAMP_NAME;
+ File aFile(aStr);
+ // create migration stamp, and/or check its existence
+ bool bRet = aFile.open (osl_File_OpenFlag_Write | osl_File_OpenFlag_Create | osl_File_OpenFlag_NoLock) == FileBase::E_EXIST;
+ OSL_TRACE( "File '%s' exists? %d\n",
+ rtl::OUStringToOString(aStr, RTL_TEXTENCODING_ASCII_US).getStr(),
+ bRet );
+ return bRet;
}
-OUString MigrationImpl::getOldVersionName()
+bool MigrationImpl::initializeMigration()
{
- return m_aInfo.productname;
+ bool bRet = false;
+
+ if (!checkMigrationCompleted()) {
+ readAvailableMigrations(m_vMigrationsAvailable);
+ sal_Int32 nIndex = findPreferedMigrationProcess(m_vMigrationsAvailable);
+ // m_aInfo is now set to the preferred migration source
+ if ( nIndex >= 0 ) {
+ if (alreadyMigrated())
+ return false;
+ m_vrMigrations = readMigrationSteps(m_vMigrationsAvailable[nIndex].name);
+ }
+
+ bRet = m_aInfo.userdata.getLength() > 0;
+ }
+
+ OSL_TRACE( "Migration %s\n", bRet ? "needed" : "not required" );
+
+ return bRet;
}
-sal_Bool MigrationImpl::checkMigration()
+void Migration::migrateSettingsIfNecessary()
{
- if (m_aInfo.userdata.getLength() > 0 && ! checkMigrationCompleted())
- return sal_True;
- else
- return sal_False;
+ MigrationImpl aImpl( comphelper::getProcessServiceFactory() );
+
+ if (! aImpl.initializeMigration() )
+ return;
+
+ sal_Bool bResult = sal_False;
+ try {
+ bResult = aImpl.doMigration();
+ } catch (Exception& e)
+ {
+ OString aMsg("doMigration() exception: ");
+ aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
+ OSL_ENSURE(sal_False, aMsg.getStr());
+ }
+ OSL_ENSURE(bResult, "Migration has not been successfull");
+ (void)bResult;
}
MigrationImpl::MigrationImpl(const uno::Reference< XMultiServiceFactory >& xFactory)
@@ -270,9 +357,9 @@ MigrationImpl::MigrationImpl(const uno::Reference< XMultiServiceFactory >& xFact
MigrationImpl::~MigrationImpl()
{
-
}
+// The main entry point for migrating settings
sal_Bool MigrationImpl::doMigration()
{
// compile file list for migration
@@ -370,7 +457,7 @@ sal_Bool MigrationImpl::doMigration()
void MigrationImpl::refresh()
{
uno::Reference< XRefreshable > xRefresh(m_xFactory->createInstance(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), uno::UNO_QUERY);
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))), uno::UNO_QUERY);
if (xRefresh.is())
xRefresh->refresh();
else
@@ -382,24 +469,33 @@ void MigrationImpl::setMigrationCompleted()
{
try {
uno::Reference< XPropertySet > aPropertySet(getConfigAccess("org.openoffice.Setup/Office", true), uno::UNO_QUERY_THROW);
- aPropertySet->setPropertyValue(OUString::createFromAscii("MigrationCompleted"), uno::makeAny(sal_True));
+ aPropertySet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("MigrationCompleted")), uno::makeAny(sal_True));
uno::Reference< XChangesBatch >(aPropertySet, uno::UNO_QUERY_THROW)->commitChanges();
} catch (...) {
// fail silently
}
}
-sal_Bool MigrationImpl::checkMigrationCompleted()
+bool MigrationImpl::checkMigrationCompleted()
{
sal_Bool bMigrationCompleted = sal_False;
try {
uno::Reference< XPropertySet > aPropertySet(
getConfigAccess("org.openoffice.Setup/Office"), uno::UNO_QUERY_THROW);
aPropertySet->getPropertyValue(
- OUString::createFromAscii("MigrationCompleted")) >>= bMigrationCompleted;
+ OUString(RTL_CONSTASCII_USTRINGPARAM("MigrationCompleted"))) >>= bMigrationCompleted;
+
+ if( !bMigrationCompleted && getenv("SAL_DISABLE_USERMIGRATION" ) )
+ {
+ // migration prevented - fake it's success
+ setMigrationCompleted();
+ bMigrationCompleted = sal_True;
+ }
} catch (Exception&) {
// just return false...
}
+ OSL_TRACE( "Migration %s", bMigrationCompleted ? "already completed" : "not done" );
+
return bMigrationCompleted;
}
@@ -484,21 +580,21 @@ migrations_vr MigrationImpl::readMigrationSteps(const ::rtl::OUString& rMigratio
}
// exluded files...
- if (tmpAccess->getByName(OUString::createFromAscii("ExcludedFiles")) >>= tmpSeq)
+ if (tmpAccess->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("ExcludedFiles"))) >>= tmpSeq)
{
for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
tmpStep.excludeFiles.push_back(tmpSeq[j]);
}
// included nodes...
- if (tmpAccess->getByName(OUString::createFromAscii("IncludedNodes")) >>= tmpSeq)
+ if (tmpAccess->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IncludedNodes"))) >>= tmpSeq)
{
for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
tmpStep.includeConfig.push_back(tmpSeq[j]);
}
// excluded nodes...
- if (tmpAccess->getByName(OUString::createFromAscii("ExcludedNodes")) >>= tmpSeq)
+ if (tmpAccess->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("ExcludedNodes"))) >>= tmpSeq)
{
for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
tmpStep.excludeConfig.push_back(tmpSeq[j]);
@@ -522,7 +618,7 @@ migrations_vr MigrationImpl::readMigrationSteps(const ::rtl::OUString& rMigratio
}
// generic service
- tmpAccess->getByName(OUString::createFromAscii("MigrationService")) >>= tmpStep.service;
+ tmpAccess->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("MigrationService"))) >>= tmpStep.service;
vrMigrations->push_back(tmpStep);
}
@@ -572,7 +668,7 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions)
aUserInst += ::rtl::OUString::createFromAscii("/");
#if defined UNX && ! defined MACOSX
// tribute to whoever had the "great" idea to use different names on Windows and Unix
- aUserInst += ::rtl::OUString::createFromAscii(".");
+ aUserInst += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
#endif
aUserInst += aProfileName;
try
@@ -633,9 +729,9 @@ strings_vr MigrationImpl::applyPatterns(const strings_v& vSet, const strings_v&
end = (xub_StrLen)(i_set->getLength());
if (ts.SearchFrwrd(*i_set, &start, &end))
vrResult->push_back(*i_set);
- i_set++;
+ ++i_set;
}
- i_pat++;
+ ++i_pat;
}
return vrResult;
}
@@ -672,7 +768,7 @@ strings_vr MigrationImpl::getAllFiles(const OUString& baseURL) const
{
vrSubResult = getAllFiles(*i);
vrResult->insert(vrResult->end(), vrSubResult->begin(), vrSubResult->end());
- i++;
+ ++i;
}
}
return vrResult;
@@ -700,9 +796,9 @@ strings_vr MigrationImpl::compileFileList()
{
vrInclude = applyPatterns(*vrFiles, i_migr->includeFiles);
vrExclude = applyPatterns(*vrFiles, i_migr->excludeFiles);
- substract(*vrInclude, *vrExclude);
+ subtract(*vrInclude, *vrExclude);
vrResult->insert(vrResult->end(), vrInclude->begin(), vrInclude->end());
- i_migr++;
+ ++i_migr;
}
return vrResult;
}
@@ -809,7 +905,7 @@ void MigrationImpl::copyConfig() {
}
// removes elements of vector 2 in vector 1
-void MigrationImpl::substract(strings_v& va, const strings_v& vb_c) const
+void MigrationImpl::subtract(strings_v& va, const strings_v& vb_c) const
{
strings_v vb(vb_c);
// ensure uniqueness of entries
@@ -836,9 +932,9 @@ void MigrationImpl::substract(strings_v& va, const strings_v& vb_c) const
break;
}
else
- i_in++;
+ ++i_in;
}
- i_ex++;
+ ++i_ex;
}
}
@@ -846,12 +942,12 @@ uno::Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPa
{
uno::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);
@@ -886,7 +982,6 @@ void MigrationImpl::copyFiles()
{
while (i_file != m_vrFileList->end())
{
-
// remove installation prefix from file
localName = i_file->copy(m_aInfo.userdata.getLength());
destName = userInstall + localName;
@@ -902,7 +997,7 @@ void MigrationImpl::copyFiles()
+ OUStringToOString(destName, RTL_TEXTENCODING_UTF8);
OSL_ENSURE(sal_False, msg.getStr());
}
- i_file++;
+ ++i_file;
}
}
else
@@ -916,10 +1011,10 @@ void MigrationImpl::runServices()
// Build argument array
uno::Sequence< uno::Any > seqArguments(3);
seqArguments[0] = uno::makeAny(NamedValue(
- OUString::createFromAscii("Productname"),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("Productname")),
uno::makeAny(m_aInfo.productname)));
seqArguments[1] = uno::makeAny(NamedValue(
- OUString::createFromAscii("UserData"),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("UserData")),
uno::makeAny(m_aInfo.userdata)));
@@ -966,7 +1061,7 @@ void MigrationImpl::runServices()
}
}
- i_mig++;
+ ++i_mig;
}
}
@@ -1363,3 +1458,5 @@ void NewVersionUIInfo::init(const ::std::vector< MigrationModuleInfo >& vModules
}
} // namespace desktop
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
index d9177abe40..d588f2f38a 100644
--- a/desktop/source/migration/migration_impl.hxx
+++ b/desktop/source/migration/migration_impl.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.
@@ -212,7 +213,7 @@ private:
strings_vr compileFileList();
// helpers
- void substract(strings_v& va, const strings_v& vb_c) const;
+ void subtract(strings_v& va, const strings_v& vb_c) const;
strings_vr getAllFiles(const rtl::OUString& baseURL) const;
strings_vr applyPatterns(const strings_v& vSet, const strings_v& vPatterns) const;
NS_UNO::Reference< NS_CSS::container::XNameAccess > getConfigAccess(const sal_Char* path, sal_Bool rw=sal_False);
@@ -234,19 +235,19 @@ private:
void refresh();
void setMigrationCompleted();
- sal_Bool checkMigrationCompleted();
-
+ bool checkMigrationCompleted();
+
public:
MigrationImpl(const NS_UNO::Reference< NS_CSS::lang::XMultiServiceFactory >&);
~MigrationImpl();
+ bool initializeMigration();
sal_Bool doMigration();
- sal_Bool checkMigration();
rtl::OUString getOldVersionName();
-
-
};
}
#undef NS_CSS
#undef NS_UNO
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/services/autocorrmigration.cxx b/desktop/source/migration/services/autocorrmigration.cxx
index 71818a6438..4b12969dbe 100644
--- a/desktop/source/migration/services/autocorrmigration.cxx
+++ b/desktop/source/migration/services/autocorrmigration.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.
@@ -153,7 +154,7 @@ namespace migration
{
return aResult;
}
- }
+ }
// -----------------------------------------------------------------------------
@@ -167,20 +168,20 @@ namespace migration
TStringVectorPtr aFileList = getFiles( m_sSourceDir );
TStringVector::const_iterator aI = aFileList->begin();
while ( aI != aFileList->end() )
- {
+ {
::rtl::OUString sSourceLocalName = aI->copy( m_sSourceDir.getLength() );
sal_Int32 nStart = sBaseName.getLength();
sal_Int32 nEnd = sSourceLocalName.lastIndexOf ( sSuffix );
::rtl::OUString sLanguageType = sSourceLocalName.copy( nStart, nEnd - nStart );
::rtl::OUString sIsoName = MsLangId::convertLanguageToIsoString( (LanguageType) sLanguageType.toInt32() );
::rtl::OUString sTargetLocalName = sBaseName;
- sTargetLocalName += ::rtl::OUString::createFromAscii( "_" );
+ sTargetLocalName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "_" ));
sTargetLocalName += sIsoName;
sTargetLocalName += sSuffix;
::rtl::OUString sTargetName = sTargetDir + sTargetLocalName;
INetURLObject aURL( sTargetName );
aURL.removeSegment();
- checkAndCreateDirectory( aURL );
+ checkAndCreateDirectory( aURL );
::osl::FileBase::RC aResult = ::osl::File::copy( *aI, sTargetName );
if ( aResult != ::osl::FileBase::E_None )
{
@@ -191,7 +192,7 @@ namespace migration
}
++aI;
}
- }
+ }
else
{
OSL_ENSURE( sal_False, "AutocorrectionMigration::copyFiles: no user installation!" );
@@ -241,7 +242,7 @@ namespace migration
{
beans::NamedValue aValue;
*pIter >>= aValue;
- if ( aValue.Name.equalsAscii( "UserData" ) )
+ if ( aValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UserData" ) ) )
{
if ( !(aValue.Value >>= m_sSourceDir) )
{
@@ -283,3 +284,5 @@ namespace migration
//.........................................................................
} // namespace migration
//.........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/services/autocorrmigration.hxx b/desktop/source/migration/services/autocorrmigration.hxx
index bfcdee737d..9a8aef32cd 100644
--- a/desktop/source/migration/services/autocorrmigration.hxx
+++ b/desktop/source/migration/services/autocorrmigration.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.
@@ -100,3 +101,5 @@ namespace migration
//.........................................................................
#endif // _DESKTOP_AUTOCORRMIGRATION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/services/basicmigration.cxx b/desktop/source/migration/services/basicmigration.cxx
index 0796b6f033..fa3fa81fa4 100644
--- a/desktop/source/migration/services/basicmigration.cxx
+++ b/desktop/source/migration/services/basicmigration.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.
@@ -150,7 +151,7 @@ namespace migration
{
return aResult;
}
- }
+ }
// -----------------------------------------------------------------------------
@@ -164,12 +165,12 @@ namespace migration
TStringVectorPtr aFileList = getFiles( m_sSourceDir );
TStringVector::const_iterator aI = aFileList->begin();
while ( aI != aFileList->end() )
- {
+ {
::rtl::OUString sLocalName = aI->copy( m_sSourceDir.getLength() );
::rtl::OUString sTargetName = sTargetDir + sLocalName;
INetURLObject aURL( sTargetName );
aURL.removeSegment();
- checkAndCreateDirectory( aURL );
+ checkAndCreateDirectory( aURL );
::osl::FileBase::RC aResult = ::osl::File::copy( *aI, sTargetName );
if ( aResult != ::osl::FileBase::E_None )
{
@@ -180,7 +181,7 @@ namespace migration
}
++aI;
}
- }
+ }
else
{
OSL_ENSURE( sal_False, "BasicMigration::copyFiles: no user installation!" );
@@ -230,7 +231,7 @@ namespace migration
{
beans::NamedValue aValue;
*pIter >>= aValue;
- if ( aValue.Name.equalsAscii( "UserData" ) )
+ if ( aValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UserData" ) ) )
{
if ( !(aValue.Value >>= m_sSourceDir) )
{
@@ -272,3 +273,5 @@ namespace migration
//.........................................................................
} // namespace migration
//.........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/services/basicmigration.hxx b/desktop/source/migration/services/basicmigration.hxx
index 47fca13077..131092748a 100644
--- a/desktop/source/migration/services/basicmigration.hxx
+++ b/desktop/source/migration/services/basicmigration.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.
@@ -100,3 +101,5 @@ namespace migration
//.........................................................................
#endif // _DESKTOP_BASICMIGRATION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/services/cexports.cxx b/desktop/source/migration/services/cexports.cxx
index 8424917d7a..072d4a59bd 100644
--- a/desktop/source/migration/services/cexports.cxx
+++ b/desktop/source/migration/services/cexports.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.
@@ -71,3 +72,5 @@ void * SAL_CALL component_getFactory(
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/services/jvmfwk.cxx b/desktop/source/migration/services/jvmfwk.cxx
index 3511108b3b..6978ce03b8 100644
--- a/desktop/source/migration/services/jvmfwk.cxx
+++ b/desktop/source/migration/services/jvmfwk.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.
@@ -276,7 +277,7 @@ void SAL_CALL JavaMigration::initialize( const css::uno::Sequence< css::uno::Any
for(;pIter != pEnd;++pIter)
{
*pIter >>= aValue;
- if (aValue.Name.equalsAscii("OldConfiguration"))
+ if (aValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OldConfiguration")))
{
sal_Bool bSuccess = aValue.Value >>= aOldConfigValues;
OSL_ENSURE(bSuccess == sal_True, "[Service implementation " IMPL_NAME
@@ -287,7 +288,7 @@ void SAL_CALL JavaMigration::initialize( const css::uno::Sequence< css::uno::Any
const css::beans::NamedValue* pEnd2 = pIter2 + aOldConfigValues.getLength();
for(;pIter2 != pEnd2;++pIter2)
{
- if ( pIter2->Name.equalsAscii("org.openoffice.Office.Java") )
+ if ( pIter2->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("org.openoffice.Office.Java")) )
{
pIter2->Value >>= m_xLayer;
break;
@@ -295,7 +296,7 @@ void SAL_CALL JavaMigration::initialize( const css::uno::Sequence< css::uno::Any
}
}
}
- else if (aValue.Name.equalsAscii("UserData"))
+ else if (aValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UserData")))
{
if ( !(aValue.Value >>= m_sUserDir) )
{
@@ -344,7 +345,7 @@ void JavaMigration::migrateJavarc()
{
OSL_ENSURE(0, "[Service implementation " IMPL_NAME
"] XJob::execute: jfw_setSelectedJRE failed.");
- fprintf(stderr, "\nCannot migrate Java. An error occured.\n");
+ fprintf(stderr, "\nCannot migrate Java. An error occurred.\n");
}
}
else if (err == JFW_E_FAILED_VERSION)
@@ -419,9 +420,9 @@ void SAL_CALL JavaMigration::overrideProperty(
MalformedDataException,
WrappedTargetException )
{
- if (aName.equalsAscii("Enable"))
+ if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Enable")))
m_aStack.push(TElementStack::value_type(aName,ENABLE_JAVA));
- else if (aName.equalsAscii("UserClassPath"))
+ else if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UserClassPath")))
m_aStack.push(TElementStack::value_type(aName, USER_CLASS_PATH));
}
// -----------------------------------------------------------------------------
@@ -527,3 +528,4 @@ void SAL_CALL JavaMigration::addOrReplaceNodeFromTemplate(
} //end namespace jfw
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/services/jvmfwk.hxx b/desktop/source/migration/services/jvmfwk.hxx
index dc81b60f53..96e459521d 100644
--- a/desktop/source/migration/services/jvmfwk.hxx
+++ b/desktop/source/migration/services/jvmfwk.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,4 @@ css::uno::Sequence< rtl::OUString > jvmfwk_getSupportedServiceNames();
} //end blind namespace
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/services/misc.hxx b/desktop/source/migration/services/misc.hxx
index 8fe846109c..a8f7babef9 100644
--- a/desktop/source/migration/services/misc.hxx
+++ b/desktop/source/migration/services/misc.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.
@@ -46,3 +47,5 @@ namespace migration
//.........................................................................
#endif // _DESKTOP_MISC_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx b/desktop/source/migration/services/oo3extensionmigration.hxx
index 721a1bd704..dae864710a 100644
--- a/desktop/source/migration/services/oo3extensionmigration.hxx
+++ b/desktop/source/migration/services/oo3extensionmigration.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.
diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx
index 54cfe9fb3f..4900c02755 100755..100644
--- a/desktop/source/migration/services/wordbookmigration.cxx
+++ b/desktop/source/migration/services/wordbookmigration.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.
@@ -278,7 +279,7 @@ bool IsUserWordbook( const ::rtl::OUString& rFile )
{
beans::NamedValue aValue;
*pIter >>= aValue;
- if ( aValue.Name.equalsAscii( "UserData" ) )
+ if ( aValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "UserData" ) ) )
{
if ( !(aValue.Value >>= m_sSourceDir) )
{
@@ -320,3 +321,5 @@ bool IsUserWordbook( const ::rtl::OUString& rFile )
//.........................................................................
} // namespace migration
//.........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/migration/services/wordbookmigration.hxx b/desktop/source/migration/services/wordbookmigration.hxx
index 3096beb3fe..8b04417dba 100755..100644
--- a/desktop/source/migration/services/wordbookmigration.hxx
+++ b/desktop/source/migration/services/wordbookmigration.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.
@@ -100,3 +101,5 @@ namespace migration
//.........................................................................
#endif // _DESKTOP_AUTOCORRMIGRATION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx
index 4275de98b8..71fd31fb20 100644
--- a/desktop/source/offacc/acceptor.cxx
+++ b/desktop/source/offacc/acceptor.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,14 +31,11 @@
#include "acceptor.hxx"
#include <unotools/bootstrap.hxx>
-#include <vos/process.hxx>
#include <tools/urlobj.hxx>
#include <tools/stream.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
-#ifndef _COM_SUN_STAR_UNO_XNAMEINGSERVICE_HPP_
#include <com/sun/star/uno/XNamingService.hpp>
-#endif
#include <cppuhelper/factory.hxx>
@@ -71,10 +69,10 @@ Acceptor::Acceptor( const Reference< XMultiServiceFactory >& rFactory )
{
m_rSMgr = rFactory;
m_rAcceptor = Reference< XAcceptor > (m_rSMgr->createInstance(
- rtl::OUString::createFromAscii( "com.sun.star.connection.Acceptor" )),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.connection.Acceptor" ))),
UNO_QUERY );
m_rBridgeFactory = Reference < XBridgeFactory > (m_rSMgr->createInstance(
- rtl::OUString::createFromAscii( "com.sun.star.bridge.BridgeFactory" )),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.bridge.BridgeFactory" ))),
UNO_QUERY );
// get component context
m_rContext = getComponentContext(m_rSMgr);
@@ -176,7 +174,7 @@ void SAL_CALL Acceptor::initialize( const Sequence<Any>& aArguments )
// "<connectString>;<protocol>"
sal_Int32 nIndex1 = m_aAcceptString.indexOf( (sal_Unicode) ';' );
if (nIndex1 < 0) throw IllegalArgumentException(
- OUString::createFromAscii("Invalid accept-string format"), m_rContext, 1);
+ OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid accept-string format")), m_rContext, 1);
m_aConnectString = m_aAcceptString.copy( 0 , nIndex1 ).trim();
nIndex1++;
sal_Int32 nIndex2 = m_aAcceptString.indexOf( (sal_Unicode) ';' , nIndex1 );
@@ -202,7 +200,7 @@ void SAL_CALL Acceptor::initialize( const Sequence<Any>& aArguments )
if (!bOk)
{
throw IllegalArgumentException(
- OUString::createFromAscii("invalid initialization"), m_rContext, 1);
+ OUString(RTL_CONSTASCII_USTRINGPARAM("invalid initialization")), m_rContext, 1);
}
}
@@ -277,14 +275,14 @@ Reference<XInterface> SAL_CALL AccInstanceProvider::getInstance (const OUString&
else if ( aName.compareToAscii("StarOffice.NamingService" ) == 0 )
{
Reference< XNamingService > rNamingService(
- m_rSMgr->createInstance( OUString::createFromAscii( "com.sun.star.uno.NamingService" )),
+ m_rSMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.uno.NamingService" ))),
UNO_QUERY );
if ( rNamingService.is() )
{
rNamingService->registerObject(
- OUString::createFromAscii( "StarOffice.ServiceManager" ), m_rSMgr );
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "StarOffice.ServiceManager" )), m_rSMgr );
rNamingService->registerObject(
- OUString::createFromAscii( "StarOffice.ComponentContext" ), getComponentContext( m_rSMgr ));
+ OUString(RTL_CONSTASCII_USTRINGPARAM( "StarOffice.ComponentContext" )), getComponentContext( m_rSMgr ));
rInstance = rNamingService;
}
}
@@ -348,3 +346,5 @@ component_getFactory(const sal_Char *pImplementationName, void *pServiceManager,
}
} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/offacc/acceptor.hxx b/desktop/source/offacc/acceptor.hxx
index eea88984d8..4096b3e63c 100644
--- a/desktop/source/offacc/acceptor.hxx
+++ b/desktop/source/offacc/acceptor.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.
@@ -127,3 +128,4 @@ public:
} //namespace desktop
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/pagein/file_image.h b/desktop/source/pagein/file_image.h
index dae9f39b65..4234140027 100644
--- a/desktop/source/pagein/file_image.h
+++ b/desktop/source/pagein/file_image.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.
@@ -76,3 +77,5 @@ int file_image_close (
#endif
#endif /* INCLUDED_ODEP_IMAGE_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/pagein/file_image_unx.c b/desktop/source/pagein/file_image_unx.c
index e4d62fe6ca..41d60e8035 100644
--- a/desktop/source/pagein/file_image_unx.c
+++ b/desktop/source/pagein/file_image_unx.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.
@@ -148,3 +149,5 @@ int file_image_close (file_image * image)
image->m_base = 0, image->m_size = 0;
return (0);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/pagein/makefile.mk b/desktop/source/pagein/makefile.mk
index 700f2922a5..6ea4bb7d29 100644
--- a/desktop/source/pagein/makefile.mk
+++ b/desktop/source/pagein/makefile.mk
@@ -72,6 +72,7 @@ UNODLLPOST=.uno$(DLLPOST)
DFTDLLPOST=$(DLLPOSTFIX)$(DLLPOST) # Default
URELIBPATH=..$/ure-link$/lib
+UREMISCPATH=..$/ure-link$/share$/misc
$(MISC)$/$(TARGET)-calc : makefile.mk
@echo Making: $@
diff --git a/desktop/source/pagein/pagein.c b/desktop/source/pagein/pagein.c
index 9b40013d3a..15623bfd8d 100644
--- a/desktop/source/pagein/pagein.c
+++ b/desktop/source/pagein/pagein.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.
@@ -147,3 +148,5 @@ int main (int argc, char **argv)
fprintf (stderr, "Total: %d files (%d bytes)\n", (int) nfiles, (int) nbytes);
return (0);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index 60b27a6901..e4b7100ce2 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_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.
@@ -709,3 +710,4 @@ extern "C" int unopkg_main()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index 785c79a759..73c9de61ad 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.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.
@@ -431,3 +432,4 @@ Reference< XCommandEnvironment > createCmdEnv(
}
} // unopkg
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/pkgchk/unopkg/unopkg_main.c b/desktop/source/pkgchk/unopkg/unopkg_main.c
index f1ffe5cd6e..1d5b31d03f 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_main.c
+++ b/desktop/source/pkgchk/unopkg/unopkg_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 unopkg_main();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/pkgchk/unopkg/unopkg_main.h b/desktop/source/pkgchk/unopkg/unopkg_main.h
index 2bdc4a2feb..694cc41558 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_main.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_main.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 unopkg_main(void);
#endif
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index 29b4ac34fd..6affa6347a 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.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.
@@ -194,7 +195,7 @@ struct ProcessWorkingDir : public rtl::StaticWithInit<
const OUString, ProcessWorkingDir> {
const OUString operator () () {
OUString workingDir;
- tools::getProcessWorkingDir(&workingDir);
+ tools::getProcessWorkingDir(workingDir);
return workingDir;
}
};
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 662245b329..7aca792955 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.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.
diff --git a/desktop/source/so_comp/evaluation.cxx b/desktop/source/so_comp/evaluation.cxx
index afeadb5f3c..c55b94596b 100644
--- a/desktop/source/so_comp/evaluation.cxx
+++ b/desktop/source/so_comp/evaluation.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.
@@ -66,7 +67,7 @@ const char* SOEvaluation::serviceName = "com.sun.star.office.Evaluation";
OUString SOEvaluation::GetImplementationName()
{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( implementationName));
+ return OUString::createFromAscii(implementationName);
}
Sequence< OUString > SOEvaluation::GetSupportedServiceNames()
@@ -144,13 +145,13 @@ rtl::OUString SAL_CALL SOEvaluation::getExactName( const rtl::OUString& rApproxi
for (int i=0; i<aSeq.getLength(); i++ )
{
NamedValue& rValue = aSeq[i];
- if ( rValue.Name.equalsAscii("expired") )
+ if ( rValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("expired")) )
rValue.Value >>= bExpired;
- else if (rValue.Name.equalsAscii("title") )
+ else if (rValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("title")) )
rValue.Value >>= aEval;
}
// append eval string to title
- aTitle += OUString::createFromAscii(" ") + aEval;
+ aTitle += OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) + aEval;
if ( bExpired )
throw RuntimeException();
}
@@ -203,3 +204,5 @@ throw ( RuntimeException )
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/so_comp/evaluation.hxx b/desktop/source/so_comp/evaluation.hxx
index 9ef4b71baa..a34cc65253 100644
--- a/desktop/source/so_comp/evaluation.hxx
+++ b/desktop/source/so_comp/evaluation.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.
@@ -90,3 +91,5 @@ public:
};
}
#endif // _SOCOMP_EVALUATION_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/so_comp/oemjob.cxx b/desktop/source/so_comp/oemjob.cxx
index 21b78b5923..64767d180d 100644
--- a/desktop/source/so_comp/oemjob.cxx
+++ b/desktop/source/so_comp/oemjob.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.
@@ -67,14 +68,14 @@ const char* OEMPreloadJob::serviceName = "com.sun.star.office.OEMPreloadJob";
OUString OEMPreloadJob::GetImplementationName()
{
- return OUString( RTL_CONSTASCII_USTRINGPARAM( implementationName));
+ return OUString::createFromAscii(implementationName);
}
Sequence< OUString > OEMPreloadJob::GetSupportedServiceNames()
{
sal_Int32 nSize = (sizeof( interfaces ) / sizeof( const char *)) - 1;
Sequence< OUString > aResult( nSize );
-
+
for( sal_Int32 i = 0; i < nSize; i++ )
aResult[i] = OUString::createFromAscii( interfaces[i] );
return aResult;
@@ -88,7 +89,7 @@ Reference< XInterface > SAL_CALL OEMPreloadJob::CreateInstance(
return (XComponent*) ( new OEMPreloadJob( rSMgr ) );
}
-OEMPreloadJob::OEMPreloadJob( const Reference< XMultiServiceFactory >& xFactory ) :
+OEMPreloadJob::OEMPreloadJob( const Reference< XMultiServiceFactory >& xFactory ) :
m_aListeners( m_aMutex ),
m_xServiceManager( xFactory )
{
@@ -117,24 +118,24 @@ void SAL_CALL OEMPreloadJob::removeEventListener( const Reference< XEventListene
}
// XServiceInfo
-::rtl::OUString SAL_CALL OEMPreloadJob::getImplementationName()
+::rtl::OUString SAL_CALL OEMPreloadJob::getImplementationName()
throw ( RuntimeException )
{
return OEMPreloadJob::GetImplementationName();
}
-sal_Bool SAL_CALL OEMPreloadJob::supportsService( const ::rtl::OUString& rServiceName )
+sal_Bool SAL_CALL OEMPreloadJob::supportsService( const ::rtl::OUString& rServiceName )
throw ( RuntimeException )
{
sal_Int32 nSize = sizeof( interfaces ) / sizeof( const char *);
-
+
for( sal_Int32 i = 0; i < nSize; i++ )
if ( rServiceName.equalsAscii( interfaces[i] ))
return sal_True;
return sal_False;
}
-Sequence< ::rtl::OUString > SAL_CALL OEMPreloadJob::getSupportedServiceNames()
+Sequence< ::rtl::OUString > SAL_CALL OEMPreloadJob::getSupportedServiceNames()
throw ( RuntimeException )
{
return OEMPreloadJob::GetSupportedServiceNames();
@@ -150,7 +151,7 @@ throw ( RuntimeException )
{
// create OEM preload service dialog
Reference <XExecutableDialog> xDialog( m_xServiceManager->createInstance(
- OUString::createFromAscii("org.openoffice.comp.preload.OEMPreloadWizard")),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.preload.OEMPreloadWizard"))),
UNO_QUERY );
if ( xDialog.is() ){
// execute OEM preload dialog and check return value
@@ -160,11 +161,11 @@ throw ( RuntimeException )
bCont = sal_True;
disableOEMPreloadFlag();
} else {
- // user declined...
+ // user declined...
// terminate.
/*
Reference< XDesktop > xDesktop( m_xServiceManager->createInstance(
- OUString::createFromAscii("com.sun.star.frame.Desktop")),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),
UNO_QUERY );
xDesktop->terminate();
*/
@@ -175,18 +176,18 @@ throw ( RuntimeException )
Reference<XModel> rModel;
Reference<XCloseable> rClose;
for (int i=0; i<args.getLength(); i++)
- {
- if (args[i].Name.equalsAscii("EnvType"))
+ {
+ if (args[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EnvType")))
args[i].Value >>= aEnvType;
- else if (args[i].Name.equalsAscii("Frame")) {
+ else if (args[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Frame"))) {
args[i].Value >>= rFrame;
rClose = Reference<XCloseable>(rFrame, UNO_QUERY);
}
- else if (args[i].Name.equalsAscii("Model")) {
+ else if (args[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Model"))) {
args[i].Value >>= rModel;
rClose = Reference<XCloseable>(rModel, UNO_QUERY);
- }
- }
+ }
+ }
if (rClose.is()) rClose->close(sal_True);
*/
bCont = sal_False;
@@ -195,10 +196,10 @@ throw ( RuntimeException )
} else {
// don't try again
bCont = sal_True;
- }
+ }
/*
- NamedValue nv;
- nv.Name = OUString::createFromAscii("Deactivate");
+ NamedValue nv;
+ nv.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Deactivate"));
nv.Value <<= bDeactivate;
Sequence<NamedValue> s(1);
s[0] = nv;
@@ -208,32 +209,30 @@ throw ( RuntimeException )
return r;
}
-
static sal_Bool existsURL( OUString const& _sURL )
{
using namespace osl;
DirectoryItem aDirItem;
-
+
if (_sURL.getLength() != 0)
return ( DirectoryItem::get( _sURL, aDirItem ) == DirectoryItem::E_None );
-
+
return sal_False;
}
-
// locate soffice.ini/.rc file
static OUString locateIniFile()
{
OUString aUserDataPath;
OUString aSofficeIniFileURL;
-
+
// Retrieve the default file URL for the soffice.ini/rc
Bootstrap().getIniName( aSofficeIniFileURL );
if ( utl::Bootstrap::locateUserData( aUserDataPath ) == utl::Bootstrap::PATH_EXISTS )
{
const char CONFIG_DIR[] = "/config";
-
+
sal_Int32 nIndex = aSofficeIniFileURL.lastIndexOf( '/');
if ( nIndex > 0 )
{
@@ -242,11 +241,11 @@ static OUString locateIniFile()
aBuffer.appendAscii( CONFIG_DIR );
aBuffer.append( aSofficeIniFileURL.copy( nIndex ));
aUserSofficeIniFileURL = aBuffer.makeStringAndClear();
-
+
if ( existsURL( aUserSofficeIniFileURL ))
return aUserSofficeIniFileURL;
}
- }
+ }
// Fallback try to use the soffice.ini/rc from program folder
return aSofficeIniFileURL;
}
@@ -269,7 +268,7 @@ void OEMPreloadJob::disableOEMPreloadFlag()
{
OUString aSofficeIniFileURL = locateIniFile();
if ( aSofficeIniFileURL.getLength() > 0 )
- {
+ {
Config aConfig(aSofficeIniFileURL);
aConfig.SetGroup( OEM_PRELOAD_SECTION );
aConfig.WriteKey( OEM_PRELOAD, STR_FALSE );
@@ -278,3 +277,5 @@ void OEMPreloadJob::disableOEMPreloadFlag()
}
} // namespace desktop
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/so_comp/oemjob.hxx b/desktop/source/so_comp/oemjob.hxx
index 973cae36df..26c1f0943d 100644
--- a/desktop/source/so_comp/oemjob.hxx
+++ b/desktop/source/so_comp/oemjob.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.
@@ -90,3 +91,5 @@ public:
}
#endif // _SOCOMP_OEMJOB_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/so_comp/services.cxx b/desktop/source/so_comp/services.cxx
index 8a5e561444..7bd2e60822 100644
--- a/desktop/source/so_comp/services.cxx
+++ b/desktop/source/so_comp/services.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.
@@ -58,7 +59,7 @@ static const char* pServices[] =
static const char* pImplementations[] =
{
SOEvaluation::implementationName,
- OEMPreloadJob::implementationName,
+ OEMPreloadJob::implementationName,
NULL
};
@@ -71,13 +72,12 @@ static const fProvider pInstanceProviders[] =
NULL
};
-
static const char** pSupportedServices[] =
{
SOEvaluation::interfaces,
OEMPreloadJob::interfaces,
NULL
-};
+};
static Sequence<OUString>
getSupportedServiceNames(int p) {
@@ -88,13 +88,13 @@ getSupportedServiceNames(int p) {
aSeq[i] = OUString::createFromAscii(names[i]);
}
return aSeq;
-}
+}
extern "C"
{
-void SAL_CALL
+void SAL_CALL
component_getImplementationEnvironment(
- const sal_Char** ppEnvironmentTypeName,
+ const sal_Char** ppEnvironmentTypeName,
uno_Environment**)
{
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
@@ -110,11 +110,11 @@ component_getFactory(
if ( pImplementationName && pServiceManager )
{
Reference< XSingleServiceFactory > xFactory;
- Reference< XMultiServiceFactory > xServiceManager(
+ Reference< XMultiServiceFactory > xServiceManager(
reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
-
+
// search implementation
- for (int i = 0; (pImplementations[i]!=NULL); i++) {
+ for (int i = 0; (pImplementations[i]!=NULL); i++) {
if ( strcmp(pImplementations[i], pImplementationName ) == 0 ) {
// found implementation
xFactory = Reference<XSingleServiceFactory>(cppu::createSingleFactory(
@@ -132,3 +132,5 @@ component_getFactory(
return NULL;
}
} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk
index b2e0736df1..a321f6d1da 100644
--- a/desktop/source/splash/makefile.mk
+++ b/desktop/source/splash/makefile.mk
@@ -40,15 +40,11 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
SLOFILES = $(SLO)$/splash.obj \
- $(SLO)$/firststart.obj \
$(SLO)$/services_spl.obj
SHL1DEPN= makefile.mk
SHL1OBJS= $(SLOFILES) \
- $(SLO)$/pages.obj \
- $(SLO)$/wizard.obj \
- $(SLO)$/migration.obj \
- $(SLO)$/cfgfilter.obj
+ $(SLO)$/migration.obj
SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
diff --git a/desktop/source/splash/services_spl.cxx b/desktop/source/splash/services_spl.cxx
index ff5469ac30..a60ca55d32 100755..100644
--- a/desktop/source/splash/services_spl.cxx
+++ b/desktop/source/splash/services_spl.cxx
@@ -1,10 +1,11 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
- * OpenOffice.org - a multi-platform office productivity suite
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* This file is part of OpenOffice.org.
*
@@ -35,8 +36,6 @@
#include <unotools/configmgr.hxx>
#include "splash.hxx"
-#include "firststart.hxx"
-
using namespace rtl;
using namespace ::com::sun::star::uno;
@@ -48,14 +47,12 @@ using namespace ::desktop;
static const char* pServices[] =
{
SplashScreen::serviceName,
- FirstStart::serviceName,
NULL
};
static const char* pImplementations[] =
{
SplashScreen::implementationName,
- FirstStart::implementationName,
NULL
};
@@ -64,17 +61,14 @@ typedef Reference<XInterface>(* fProvider)(const Reference<XMultiServiceFactory>
static const fProvider pInstanceProviders[] =
{
SplashScreen::getInstance,
- FirstStart::CreateInstance,
NULL
};
-
static const char** pSupportedServices[] =
{
SplashScreen::interfaces,
- FirstStart::interfaces,
NULL
-};
+};
static Sequence<OUString>
getSupportedServiceNames(int p) {
@@ -85,13 +79,13 @@ getSupportedServiceNames(int p) {
aSeq[i] = OUString::createFromAscii(names[i]);
}
return aSeq;
-}
+}
extern "C"
{
-void SAL_CALL
+void SAL_CALL
component_getImplementationEnvironment(
- const sal_Char** ppEnvironmentTypeName,
+ const sal_Char** ppEnvironmentTypeName,
uno_Environment**)
{
*ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
@@ -107,11 +101,11 @@ component_getFactory(
if ( pImplementationName && pServiceManager )
{
Reference< XSingleServiceFactory > xFactory;
- Reference< XMultiServiceFactory > xServiceManager(
+ Reference< XMultiServiceFactory > xServiceManager(
reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
-
+
// search implementation
- for (int i = 0; (pImplementations[i]!=NULL); i++) {
+ for (int i = 0; (pImplementations[i]!=NULL); i++) {
if ( strcmp(pImplementations[i], pImplementationName ) == 0 ) {
// found implementation
xFactory = Reference<XSingleServiceFactory>(cppu::createSingleFactory(
@@ -129,3 +123,5 @@ component_getFactory(
return NULL;
}
} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index db46035c4d..1e99d9bff8 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.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,11 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
-#include <introbmpnames.hxx>
#include "splash.hxx"
#include <stdio.h>
#include <unotools/bootstrap.hxx>
-#include <vos/process.hxx>
#include <tools/urlobj.hxx>
#include <tools/stream.hxx>
#include <sfx2/sfx.hrc>
@@ -42,7 +41,8 @@
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <rtl/bootstrap.hxx>
#include <rtl/logfile.hxx>
-#include <rtl/ustrbuf.hxx>
+#include <rtl/locale.hxx>
+#include <rtl/strbuf.hxx>
#include <rtl/math.hxx>
#include <vcl/graph.hxx>
#include <svtools/filter.hxx>
@@ -100,7 +100,7 @@ void SAL_CALL SplashScreen::start(const OUString&, sal_Int32 nRange)
_iMax = nRange;
if (_bVisible) {
_bProgressEnd = sal_False;
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
if ( _eBitmapMode == BM_FULLSCREEN )
ShowFullScreenMode( TRUE );
Show();
@@ -159,7 +159,7 @@ void SAL_CALL SplashScreen::setValue(sal_Int32 nValue)
RTL_LOGFILE_CONTEXT( aLog, "::SplashScreen::setValue (lo119109)" );
RTL_LOGFILE_CONTEXT_TRACE1( aLog, "value=%d", nValue );
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aSolarGuard;
if (_bVisible && !_bProgressEnd) {
if ( _eBitmapMode == BM_FULLSCREEN )
ShowFullScreenMode( TRUE );
@@ -183,7 +183,8 @@ SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::sta
aArguments[1] >>= _sAppName;
// start to determine bitmap and all other required value
- initBitmap();
+ if ( _bShowLogo )
+ SetScreenBitmap (_aIntroBmp);
Size aSize = _aIntroBmp.GetSizePixel();
SetOutputSizePixel( aSize );
_vdev.SetOutputSizePixel( aSize );
@@ -489,8 +490,9 @@ bool SplashScreen::findScreenBitmap(rtl::OUString const & path)
}
// create file name from screen resolution information
- OUStringBuffer aStrBuf( 128 );
- aStrBuf.appendAscii( "intro_" );
+ OStringBuffer aStrBuf( 128 );
+ OStringBuffer aResBuf( 32 );
+ aStrBuf.append( "intro_" );
if ( _sAppName.getLength() > 0 )
{
aStrBuf.append( _sAppName );
@@ -528,12 +530,13 @@ bool SplashScreen::findScreenBitmap(rtl::OUString const & path)
haveBitmap = loadBitmap( path, aBmpFileName );
}
}
- return haveBitmap;
-}
+ aResBuf.append( OString::valueOf( nWidth ));
+ aResBuf.append( "x" );
+ aResBuf.append( OString::valueOf( nHeight ));
-bool SplashScreen::findAppBitmap(rtl::OUString const & path)
-{
- bool haveBitmap = false;
+ aStrBuf.append( aResBuf.getStr() );
+ if (Application::LoadBrandBitmap (aStrBuf.makeStringAndClear(), rBitmap))
+ return;
if ( _sAppName.getLength() > 0 )
{
@@ -676,12 +679,7 @@ void SplashScreen::Paint( const Rectangle&)
_vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace));
_vdev.DrawText( Rectangle(_tlx, _tly+_barheight+5, _tlx+_barwidth, _tly+_barheight+5+20), _sProgressText, TEXT_DRAW_CENTER );
}
- Size aSize = GetOutputSizePixel();
- Size bSize = _vdev.GetOutputSizePixel();
- //_vdev.Flush();
- //_vdev.DrawOutDev(Point(), GetOutputSize(), Point(), GetOutputSize(), *((IntroWindow*)this) );
DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev.GetOutputSizePixel(), _vdev );
- //Flush();
}
@@ -713,3 +711,5 @@ const sal_Char *SplashScreen::implementationName = "com.sun.star.office.comp.Spl
const sal_Char *SplashScreen::supportedServiceNames[] = {"com.sun.star.office.SplashScreen", NULL};
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/splash/splash.hxx b/desktop/source/splash/splash.hxx
index 2090a64a82..c7c3ff5b52 100644
--- a/desktop/source/splash/splash.hxx
+++ b/desktop/source/splash/splash.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.
@@ -71,13 +72,8 @@ private:
DECL_LINK( AppEventListenerHdl, VclWindowEvent * );
virtual ~SplashScreen();
void loadConfig();
- void initBitmap();
void updateStatus();
- bool findScreenBitmap(rtl::OUString const & path);
- bool findAppBitmap(rtl::OUString const & path);
- bool findBitmap(rtl::OUString const & path);
- bool loadBitmap(
- rtl::OUString const & path, const rtl::OUString &rBmpFileName );
+ void SetScreenBitmap(BitmapEx &rBitmap);
void determineProgressRatioValues( double& rXRelPos, double& rYRelPos, double& rRelWidth, double& rRelHeight );
static SplashScreen *_pINSTANCE;
@@ -134,3 +130,5 @@ public:
};
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */