diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-11-22 14:30:32 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-11-22 14:30:32 +0100 |
commit | 9998fbf387db200dcd9a04bddb188662c2c37cda (patch) | |
tree | b9f2237920a36b1b30be3eef71e0c5638b649337 /desktop | |
parent | bdb218cb76554a31f551f6c9452defc77ff736f8 (diff) | |
parent | 94753953df87e4d761ff9fa30333dc02994f6d3f (diff) |
dba34b: merge after pulling DEV300.m94
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 127 | ||||
-rw-r--r-- | desktop/source/app/cmdlineargs.cxx | 281 | ||||
-rw-r--r-- | desktop/source/app/cmdlineargs.hxx | 129 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 54 | ||||
-rwxr-xr-x[-rw-r--r--] | desktop/source/deployment/registry/package/dp_package.cxx | 16 |
5 files changed, 299 insertions, 308 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 1b3eb1aa5a4a..a49cabc90bed 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -121,6 +121,7 @@ #include <osl/module.h> #include <osl/file.hxx> #include <osl/signal.h> +#include <osl/thread.hxx> #include <rtl/uuid.h> #include <rtl/uri.hxx> #include <unotools/pathoptions.hxx> @@ -347,10 +348,8 @@ CommandLineArgs* Desktop::GetCommandLineArgs() { ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); if ( !pArgs ) - { pArgs = new CommandLineArgs; } - } return pArgs; } @@ -785,7 +784,6 @@ BOOL Desktop::QueryExit() { RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" ); utl::ConfigManager::GetConfigManager()->StoreConfigItems(); - FlushConfiguration(); RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" ); } catch ( RuntimeException& ) @@ -817,6 +815,7 @@ BOOL Desktop::QueryExit() } else { + FlushConfiguration(); try { // it is no problem to call DisableOfficeIPCThread() more than once @@ -1552,7 +1551,7 @@ void Desktop::Main() Reference< ::com::sun::star::task::XRestartManager > xRestartManager; sal_Bool bRestartRequested( sal_False ); sal_Bool bUseSystemFileDialog(sal_True); - int nAcquireCount( 0 ); + int nAcquireCount( 0 ); Reference < css::document::XEventListener > xGlobalBroadcaster; try { @@ -1619,25 +1618,6 @@ void Desktop::Main() } String aTitle = pLabelResMgr ? String( ResId( RID_APPTITLE, *pLabelResMgr ) ) : String(); delete pLabelResMgr; -/* - // locale and UI locale in AppSettings are now retrieved from configuration or system directly via SvtSysLocale - // no reason to set while starting - // set UI language and locale - RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ set locale settings" ); - //LanguageSelection langselect; - OUString aUILocaleString = LanguageSelection::getLanguageString(); - Locale aUILocale = LanguageSelection::IsoStringToLocale(aUILocaleString); - LanguageType eLanguage = SvtSysLocale().GetLanguage(); - - // #i39040#, do not call anything between GetSettings and SetSettings that might have - // a side effect on the settings (like, eg, SvtSysLocaleOptions().GetLocaleLanguageType(), - // which changes the MiscSettings !!! ) - AllSettings aSettings( Application::GetSettings() ); - aSettings.SetUILocale( aUILocale ); - aSettings.SetLanguage( eLanguage ); - Application::SetSettings( aSettings ); - RTL_LOGFILE_CONTEXT_TRACE( aLog, "} set locale settings" ); -*/ // Check for StarOffice/Suite specific extensions runs also with OpenOffice installation sets OUString aTitleString( aTitle ); @@ -1657,12 +1637,9 @@ void Desktop::Main() #endif SetDisplayName( aTitle ); -// SetSplashScreenProgress(30); RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create SvtPathOptions and SvtLanguageOptions" ); pPathOptions.reset( new SvtPathOptions); -// SetSplashScreenProgress(40); -// pLanguageOptions = new SvtLanguageOptions(sal_True); -// SetSplashScreenProgress(45); + SetSplashScreenProgress(40); RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create SvtPathOptions and SvtLanguageOptions" ); // Check special env variable #111015# @@ -1744,6 +1721,7 @@ void Desktop::Main() } SetSplashScreenProgress(50); + // Backing Component sal_Bool bCrashed = sal_False; sal_Bool bExistsRecoveryData = sal_False; @@ -1773,43 +1751,37 @@ void Desktop::Main() if ( !bRestartRequested ) { - if ( - (pCmdLineArgs->IsEmptyOrAcceptOnly() ) && + if ((!pCmdLineArgs->WantsToLoadDocument() ) && (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) && (!bExistsRecoveryData ) && (!bExistsSessionData ) && - (!Application::AnyInput( INPUT_APPEVENT ) ) - ) + (!Application::AnyInput( INPUT_APPEVENT ) )) { - RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" ); - Reference< XFrame > xDesktopFrame( xSMgr->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); - if (xDesktopFrame.is()) - { - // SetSplashScreenProgress(60); - Reference< XFrame > xBackingFrame; - Reference< ::com::sun::star::awt::XWindow > xContainerWindow; - - xBackingFrame = xDesktopFrame->findFrame(OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0); - if (xBackingFrame.is()) - xContainerWindow = xBackingFrame->getContainerWindow(); - if (xContainerWindow.is()) - { - // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank" - // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior, - // otherwise documents loaded into this frame will later on miss functionality depending on the style. - Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); - OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" ); - pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT ); - - SetSplashScreenProgress(75); - Sequence< Any > lArgs(1); - lArgs[0] <<= xContainerWindow; - - Reference< XController > xBackingComp( - xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs), - UNO_QUERY); - // SetSplashScreenProgress(80); + RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" ); + Reference< XFrame > xDesktopFrame( xSMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); + if (xDesktopFrame.is()) + { + Reference< XFrame > xBackingFrame; + Reference< ::com::sun::star::awt::XWindow > xContainerWindow; + + xBackingFrame = xDesktopFrame->findFrame(OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0); + if (xBackingFrame.is()) + xContainerWindow = xBackingFrame->getContainerWindow(); + if (xContainerWindow.is()) + { + // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank" + // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior, + // otherwise documents loaded into this frame will later on miss functionality depending on the style. + Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); + OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" ); + pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT ); + + SetSplashScreenProgress(75); + Sequence< Any > lArgs(1); + lArgs[0] <<= xContainerWindow; + + Reference< XController > xBackingComp( + xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs), UNO_QUERY); if (xBackingComp.is()) { Reference< ::com::sun::star::awt::XWindow > xBackingWin(xBackingComp, UNO_QUERY); @@ -1840,16 +1812,6 @@ void Desktop::Main() FatalError( MakeStartupErrorMessage(e.Message) ); return; } - /* - catch ( ... ) - { - FatalError( MakeStartupErrorMessage( - OUString::createFromAscii( - "Unknown error during startup (Office wrapper service).\nInstallation could be damaged."))); - return; - } - */ -// SetSplashScreenProgress(55); SvtFontSubstConfig().Apply(); @@ -1858,7 +1820,6 @@ void Desktop::Main() aAppearanceCfg.SetApplicationDefaults( this ); SvtAccessibilityOptions aOptions; aOptions.SetVCLSettings(); -// SetSplashScreenProgress(60); if ( !bRestartRequested ) { @@ -1892,15 +1853,6 @@ void Desktop::Main() FatalError( MakeStartupErrorMessage(e.Message) ); return; } - /* - catch ( ... ) - { - FatalError( MakeStartupErrorMessage( - OUString::createFromAscii( - "Unknown error during startup (TD/Desktop service).\nInstallation could be damaged."))); - return; - } - */ // Post user event to startup first application component window // We have to send this OpenClients message short before execute() to @@ -2219,12 +2171,7 @@ IMPL_LINK( Desktop, OpenClients_Impl, void*, EMPTYARG ) // CloseStartupScreen(); CloseSplashScreen(); - CheckFirstRun( ); - - // allow ipc interaction -// OfficeIPCThread::SetReady(); - EnableOleAutomation(); if (getenv ("OOO_EXIT_POST_STARTUP")) @@ -2721,16 +2668,6 @@ void Desktop::OpenClients() if ( ! bAllowRecoveryAndSessionManagement ) { - /* - ::comphelper::ConfigurationHelper::writeDirectKey( - ::comphelper::getProcessServiceFactory(), - ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery"), - ::rtl::OUString::createFromAscii("AutoSave"), - ::rtl::OUString::createFromAscii("Enabled"), - ::com::sun::star::uno::makeAny(sal_False), - ::comphelper::ConfigurationHelper::E_STANDARD); - - */ try { Reference< XDispatch > xRecovery( diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 0625191ee2ea..14b4fd1d6ddc 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -142,15 +142,16 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) UNO_QUERY); // parse command line arguments - sal_Bool bPrintEvent = sal_False; - sal_Bool bOpenEvent = sal_True; - sal_Bool bViewEvent = sal_False; - sal_Bool bStartEvent = sal_False; - sal_Bool bPrintToEvent = sal_False; - sal_Bool bPrinterName = sal_False; - sal_Bool bForceOpenEvent = sal_False; - sal_Bool bForceNewEvent = sal_False; - sal_Bool bDisplaySpec = sal_False; + bool bOpenEvent(true); + bool bPrintEvent(false); + bool bViewEvent(false); + bool bStartEvent(false); + bool bPrintToEvent(false); + bool bPrinterName(false); + bool bForceOpenEvent(false); + bool bForceNewEvent(false); + bool bDisplaySpec(false); + bool bOpenDoc(false); m_eArgumentCount = NONE; @@ -169,8 +170,8 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) if (tmp.getLength() > 0) aArg = tmp; } - String aArgStr = aArg; + String aArgStr = aArg; if ( aArg.getLength() > 0 ) { m_eArgumentCount = m_eArgumentCount == NONE ? ONE : MANY; @@ -182,98 +183,98 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) if ( aArgStr.EqualsIgnoreCaseAscii( "-n" )) { // force new documents based on the following documents - bForceNewEvent = sal_True; - bOpenEvent = sal_False; - bForceOpenEvent = sal_False; - bPrintToEvent = sal_False; - bPrintEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_False; - bDisplaySpec = sal_False; - } + bForceNewEvent = true; + bOpenEvent = false; + bForceOpenEvent = false; + bPrintToEvent = false; + bPrintEvent = false; + bViewEvent = false; + bStartEvent = false; + bDisplaySpec = false; + } else if ( aArgStr.EqualsIgnoreCaseAscii( "-o" )) { - // force open documents regards if they are templates or not - bForceOpenEvent = sal_True; - bOpenEvent = sal_False; - bForceNewEvent = sal_False; - bPrintToEvent = sal_False; - bPrintEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_False; - bDisplaySpec = sal_False; - } + // force open documents regardless if they are templates or not + bForceOpenEvent = true; + bOpenEvent = false; + bForceNewEvent = false; + bPrintToEvent = false; + bPrintEvent = false; + bViewEvent = false; + bStartEvent = false; + bDisplaySpec = false; + } else if ( aArgStr.EqualsIgnoreCaseAscii( "-pt" )) { // Print to special printer - bPrintToEvent = sal_True; - bPrinterName = sal_True; - bPrintEvent = sal_False; - bOpenEvent = sal_False; - bForceNewEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_False; - bDisplaySpec = sal_False; - bForceOpenEvent = sal_False; - } - else if ( aArgStr.EqualsIgnoreCaseAscii( "-p" )) - { + bPrintToEvent = true; + bPrinterName = true; + bPrintEvent = false; + bOpenEvent = false; + bForceNewEvent = false; + bViewEvent = false; + bStartEvent = false; + bDisplaySpec = false; + bForceOpenEvent = false; + } + else if ( aArgStr.EqualsIgnoreCaseAscii( "-p" )) + { // Print to default printer - bPrintEvent = sal_True; - bPrintToEvent = sal_False; - bOpenEvent = sal_False; - bForceNewEvent = sal_False; - bForceOpenEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_False; - bDisplaySpec = sal_False; - } - else if ( aArgStr.EqualsIgnoreCaseAscii( "-view" )) - { + bPrintEvent = true; + bPrintToEvent = false; + bOpenEvent = false; + bForceNewEvent = false; + bForceOpenEvent = false; + bViewEvent = false; + bStartEvent = false; + bDisplaySpec = false; + } + else if ( aArgStr.EqualsIgnoreCaseAscii( "-view" )) + { // open in viewmode - bOpenEvent = sal_False; - bPrintEvent = sal_False; - bPrintToEvent = sal_False; - bForceNewEvent = sal_False; - bForceOpenEvent = sal_False; - bViewEvent = sal_True; - bStartEvent = sal_False; - bDisplaySpec = sal_False; - } + bOpenEvent = false; + bPrintEvent = false; + bPrintToEvent = false; + bForceNewEvent = false; + bForceOpenEvent = false; + bViewEvent = true; + bStartEvent = false; + bDisplaySpec = false; + } else if ( aArgStr.EqualsIgnoreCaseAscii( "-show" )) { // open in viewmode - bOpenEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_True; - bPrintEvent = sal_False; - bPrintToEvent = sal_False; - bForceNewEvent = sal_False; - bForceOpenEvent = sal_False; - bDisplaySpec = sal_False; + bOpenEvent = false; + bViewEvent = false; + bStartEvent = true; + bPrintEvent = false; + bPrintToEvent = false; + bForceNewEvent = false; + bForceOpenEvent = false; + bDisplaySpec = false; } else if ( aArgStr.EqualsIgnoreCaseAscii( "-display" )) { // set display - bOpenEvent = sal_False; - bPrintEvent = sal_False; - bForceOpenEvent = sal_False; - bPrintToEvent = sal_False; - bForceNewEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_False; - bDisplaySpec = sal_True; + bOpenEvent = false; + bPrintEvent = false; + bForceOpenEvent = false; + bPrintToEvent = false; + bForceNewEvent = false; + bViewEvent = false; + bStartEvent = false; + bDisplaySpec = true; } else if ( aArgStr.EqualsIgnoreCaseAscii( "-language" )) { - bOpenEvent = sal_False; - bPrintEvent = sal_False; - bForceOpenEvent = sal_False; - bPrintToEvent = sal_False; - bForceNewEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_False; - bDisplaySpec = sal_False; + bOpenEvent = false; + bPrintEvent = false; + bForceOpenEvent = false; + bPrintToEvent = false; + bForceNewEvent = false; + bViewEvent = false; + bStartEvent = false; + bDisplaySpec = false; } #ifdef MACOSX @@ -285,14 +286,14 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) else if ( aArgStr.CompareToAscii( "-psn", 4 ) == COMPARE_EQUAL ) { // finder argument from MacOSX - bOpenEvent = sal_False; - bPrintEvent = sal_False; - bForceOpenEvent = sal_False; - bPrintToEvent = sal_False; - bForceNewEvent = sal_False; - bViewEvent = sal_False; - bStartEvent = sal_False; - bDisplaySpec = sal_False; + bOpenEvent = false; + bPrintEvent = false; + bForceOpenEvent = false; + bPrintToEvent = false; + bForceNewEvent = false; + bViewEvent = false; + bStartEvent = false; + bDisplaySpec = false; } #endif } @@ -308,29 +309,54 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) { // handle this argument as a filename if ( bOpenEvent ) + { AddStringListParam_Impl( CMD_STRINGPARAM_OPENLIST, aArgStr ); + bOpenDoc = true; + } else if ( bViewEvent ) + { AddStringListParam_Impl( CMD_STRINGPARAM_VIEWLIST, aArgStr ); + bOpenDoc = true; + } else if ( bStartEvent ) + { AddStringListParam_Impl( CMD_STRINGPARAM_STARTLIST, aArgStr ); + bOpenDoc = true; + } else if ( bPrintEvent ) + { AddStringListParam_Impl( CMD_STRINGPARAM_PRINTLIST, aArgStr ); + bOpenDoc = true; + } else if ( bPrintToEvent ) + { AddStringListParam_Impl( CMD_STRINGPARAM_PRINTTOLIST, aArgStr ); + bOpenDoc = true; + } else if ( bForceNewEvent ) + { AddStringListParam_Impl( CMD_STRINGPARAM_FORCENEWLIST, aArgStr ); + bOpenDoc = true; + } else if ( bForceOpenEvent ) + { AddStringListParam_Impl( CMD_STRINGPARAM_FORCEOPENLIST, aArgStr ); - else if ( bDisplaySpec ){ + bOpenDoc = true; + } + else if ( bDisplaySpec ) + { AddStringListParam_Impl( CMD_STRINGPARAM_DISPLAY, aArgStr ); - bDisplaySpec = sal_False; // only one display, not a lsit - bOpenEvent = sal_True; // set back to standard + bDisplaySpec = false; // only one display, not a lsit + bOpenEvent = true; // set back to standard } } } } } } + + if ( bOpenDoc ) + m_bDocumentArgs = true; } void CommandLineArgs::AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam ) @@ -432,8 +458,8 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& return sal_True; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-help" )) - || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" )) - || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-?" ))) + || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" )) + || aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-?" ))) { SetBoolParam_Impl( CMD_BOOLPARAM_HELP, sal_True ); return sal_True; @@ -473,18 +499,18 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& SetBoolParam_Impl( CMD_BOOLPARAM_HELPMATH, sal_True ); return sal_True; } - #ifdef MACOSX - /* #i84053# ignore -psn on Mac - Platform dependent #ifdef here is ugly, however this is currently - the only platform dependent parameter. Should more appear - we should find a better solution - */ +#ifdef MACOSX + /* #i84053# ignore -psn on Mac + Platform dependent #ifdef here is ugly, however this is currently + the only platform dependent parameter. Should more appear + we should find a better solution + */ else if ( aArg.compareToAscii( "-psn", 4 ) == 0 ) { SetBoolParam_Impl( CMD_BOOLPARAM_PSN, sal_True ); return sal_True; } - #endif +#endif else if ( aArgStr.Copy(0, 8).EqualsIgnoreCaseAscii( "-accept=" )) { AddStringListParam_Impl( CMD_STRINGPARAM_ACCEPT, aArgStr.Copy( 8 ) ); @@ -496,7 +522,7 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& return sal_True; } else if ( aArgStr.CompareIgnoreCaseToAscii( "-portal," , - RTL_CONSTASCII_LENGTH( "-portal," )) == COMPARE_EQUAL ) + RTL_CONSTASCII_LENGTH( "-portal," )) == COMPARE_EQUAL ) { AddStringListParam_Impl( CMD_STRINGPARAM_PORTAL, aArgStr.Copy( RTL_CONSTASCII_LENGTH( "-portal," )) ); return sal_True; @@ -504,13 +530,10 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& else if ( aArgStr.Copy( 0, 7 ).EqualsIgnoreCaseAscii( "-userid" )) { if ( aArgStr.Len() > 8 ) - { - rtl::OUString aUserDir = aArgStr; - AddStringListParam_Impl( - CMD_STRINGPARAM_USERDIR, - ::rtl::Uri::decode( aUserDir.copy( 8 ), - rtl_UriDecodeWithCharset, - RTL_TEXTENCODING_UTF8 ) ); + { + rtl::OUString aUserDir = aArgStr; + AddStringListParam_Impl( CMD_STRINGPARAM_USERDIR, + ::rtl::Uri::decode( aUserDir.copy( 8 ), rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ) ); } return sal_True; } @@ -533,56 +556,64 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& { sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_WRITER ); if ( !bAlreadySet ) - SetBoolParam_Impl( CMD_BOOLPARAM_WRITER, sal_True ); + SetBoolParam_Impl( CMD_BOOLPARAM_WRITER, sal_True ); + m_bDocumentArgs = true; return sal_True; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-calc" )) == sal_True ) { sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_CALC ); if ( !bAlreadySet ) - SetBoolParam_Impl( CMD_BOOLPARAM_CALC, sal_True ); + SetBoolParam_Impl( CMD_BOOLPARAM_CALC, sal_True ); + m_bDocumentArgs = true; return sal_True; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-draw" )) == sal_True ) { sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_DRAW ); if ( !bAlreadySet ) - SetBoolParam_Impl( CMD_BOOLPARAM_DRAW, sal_True ); + SetBoolParam_Impl( CMD_BOOLPARAM_DRAW, sal_True ); + m_bDocumentArgs = true; return sal_True; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-impress" )) == sal_True ) { sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_IMPRESS ); if ( !bAlreadySet ) - SetBoolParam_Impl( CMD_BOOLPARAM_IMPRESS, sal_True ); + SetBoolParam_Impl( CMD_BOOLPARAM_IMPRESS, sal_True ); + m_bDocumentArgs = true; return sal_True; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-base" )) == sal_True ) { sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_BASE ); if ( !bAlreadySet ) - SetBoolParam_Impl( CMD_BOOLPARAM_BASE, sal_True ); + SetBoolParam_Impl( CMD_BOOLPARAM_BASE, sal_True ); + m_bDocumentArgs = true; return sal_True; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-global" )) == sal_True ) { sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_GLOBAL ); if ( !bAlreadySet ) - SetBoolParam_Impl( CMD_BOOLPARAM_GLOBAL, sal_True ); + SetBoolParam_Impl( CMD_BOOLPARAM_GLOBAL, sal_True ); + m_bDocumentArgs = true; return sal_True; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-math" )) == sal_True ) { sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_MATH ); if ( !bAlreadySet ) - SetBoolParam_Impl( CMD_BOOLPARAM_MATH, sal_True ); + SetBoolParam_Impl( CMD_BOOLPARAM_MATH, sal_True ); + m_bDocumentArgs = true; return sal_True; } else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-web" )) == sal_True ) { sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_WEB ); if ( !bAlreadySet ) - SetBoolParam_Impl( CMD_BOOLPARAM_WEB, sal_True ); + SetBoolParam_Impl( CMD_BOOLPARAM_WEB, sal_True ); + m_bDocumentArgs = true; return sal_True; } @@ -605,12 +636,12 @@ sal_Bool CommandLineArgs::CheckGroupMembers( GroupParamId nGroupId, BoolParam nE void CommandLineArgs::ResetParamValues() { int i; - for ( i = 0; i < CMD_BOOLPARAM_COUNT; i++ ) m_aBoolParams[i] = sal_False; for ( i = 0; i < CMD_STRINGPARAM_COUNT; i++ ) m_aStrSetParams[i] = sal_False; m_eArgumentCount = NONE; + m_bDocumentArgs = false; } void CommandLineArgs::SetBoolParam( BoolParam eParam, sal_Bool bNewValue ) @@ -897,4 +928,10 @@ sal_Bool CommandLineArgs::IsEmptyOrAcceptOnly() const ( ( m_eArgumentCount == ONE ) && m_aBoolParams[ CMD_BOOLPARAM_PSN ] ); } +sal_Bool CommandLineArgs::WantsToLoadDocument() const +{ + osl::MutexGuard aMutexGuard( m_aMutex ); + return m_bDocumentArgs; +} + } // namespace desktop diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx index 615577098c2d..a1c70bf5df72 100644 --- a/desktop/source/app/cmdlineargs.hxx +++ b/desktop/source/app/cmdlineargs.hxx @@ -38,7 +38,7 @@ namespace desktop class CommandLineArgs { public: - enum BoolParam // must be zero based! + enum BoolParam // must be zero based! { CMD_BOOLPARAM_MINIMIZED, CMD_BOOLPARAM_INVISIBLE, @@ -71,7 +71,7 @@ class CommandLineArgs CMD_BOOLPARAM_HELPIMPRESS, CMD_BOOLPARAM_HELPBASE, CMD_BOOLPARAM_PSN, - CMD_BOOLPARAM_COUNT // must be last element! + CMD_BOOLPARAM_COUNT // must be last element! }; enum StringParam // must be zero based! @@ -92,7 +92,7 @@ class CommandLineArgs CMD_STRINGPARAM_PRINTERNAME, CMD_STRINGPARAM_DISPLAY, CMD_STRINGPARAM_LANGUAGE, - CMD_STRINGPARAM_COUNT // must be last element! + CMD_STRINGPARAM_COUNT // must be last element! }; enum GroupParamId @@ -101,7 +101,8 @@ class CommandLineArgs CMD_GRPID_COUNT }; - struct Supplier { + struct Supplier + { // Thrown from constructors and next: class Exception { public: @@ -122,86 +123,88 @@ class CommandLineArgs boost::optional< rtl::OUString > getCwdUrl() const { return m_cwdUrl; } // generic methods to access parameter - void SetBoolParam( BoolParam eParam, sal_Bool bNewValue ); + void SetBoolParam( BoolParam eParam, sal_Bool bNewValue ); // Access to bool parameters - sal_Bool IsMinimized() const; - sal_Bool IsInvisible() const; - sal_Bool IsNoRestore() const; - sal_Bool IsNoDefault() const; - sal_Bool IsBean() const; - sal_Bool IsServer() const; - sal_Bool IsHeadless() const; - sal_Bool IsQuickstart() const; - sal_Bool IsNoQuickstart() const; - sal_Bool IsTerminateAfterInit() const; - sal_Bool IsNoFirstStartWizard() const; - sal_Bool IsNoLogo() const; - sal_Bool IsNoLockcheck() const; - sal_Bool IsHelp() const; - sal_Bool IsHelpWriter() const; - sal_Bool IsHelpCalc() const; - sal_Bool IsHelpDraw() const; - sal_Bool IsHelpImpress() const; - sal_Bool IsHelpBase() const; - sal_Bool IsHelpMath() const; - sal_Bool IsHelpBasic() const; - sal_Bool IsWriter() const; - sal_Bool IsCalc() const; - sal_Bool IsDraw() const; - sal_Bool IsImpress() const; - sal_Bool IsBase() const; - sal_Bool IsGlobal() const; - sal_Bool IsMath() const; - sal_Bool IsWeb() const; - sal_Bool HasModuleParam() const; + sal_Bool IsMinimized() const; + sal_Bool IsInvisible() const; + sal_Bool IsNoRestore() const; + sal_Bool IsNoDefault() const; + sal_Bool IsBean() const; + sal_Bool IsServer() const; + sal_Bool IsHeadless() const; + sal_Bool IsQuickstart() const; + sal_Bool IsNoQuickstart() const; + sal_Bool IsTerminateAfterInit() const; + sal_Bool IsNoFirstStartWizard() const; + sal_Bool IsNoLogo() const; + sal_Bool IsNoLockcheck() const; + sal_Bool IsHelp() const; + sal_Bool IsHelpWriter() const; + sal_Bool IsHelpCalc() const; + sal_Bool IsHelpDraw() const; + sal_Bool IsHelpImpress() const; + sal_Bool IsHelpBase() const; + sal_Bool IsHelpMath() const; + sal_Bool IsHelpBasic() const; + sal_Bool IsWriter() const; + sal_Bool IsCalc() const; + sal_Bool IsDraw() const; + sal_Bool IsImpress() const; + sal_Bool IsBase() const; + sal_Bool IsGlobal() const; + sal_Bool IsMath() const; + sal_Bool IsWeb() const; + sal_Bool HasModuleParam() const; + sal_Bool WantsToLoadDocument() const; // Access to string parameters - sal_Bool GetPortalConnectString( ::rtl::OUString& rPara) const; - sal_Bool GetAcceptString( ::rtl::OUString& rPara) const; - sal_Bool GetUnAcceptString( ::rtl::OUString& rPara) const; - sal_Bool GetOpenList( ::rtl::OUString& rPara) const; - sal_Bool GetViewList( ::rtl::OUString& rPara) const; - sal_Bool GetStartList( ::rtl::OUString& rPara) const; - sal_Bool GetForceOpenList( ::rtl::OUString& rPara) const; - sal_Bool GetForceNewList( ::rtl::OUString& rPara) const; - sal_Bool GetPrintList( ::rtl::OUString& rPara) const; - sal_Bool GetPrintToList( ::rtl::OUString& rPara ) const; - sal_Bool GetPrinterName( ::rtl::OUString& rPara ) const; - sal_Bool GetLanguage( ::rtl::OUString& rPara ) const; + sal_Bool GetPortalConnectString( ::rtl::OUString& rPara) const; + sal_Bool GetAcceptString( ::rtl::OUString& rPara) const; + sal_Bool GetUnAcceptString( ::rtl::OUString& rPara) const; + sal_Bool GetOpenList( ::rtl::OUString& rPara) const; + sal_Bool GetViewList( ::rtl::OUString& rPara) const; + sal_Bool GetStartList( ::rtl::OUString& rPara) const; + sal_Bool GetForceOpenList( ::rtl::OUString& rPara) const; + sal_Bool GetForceNewList( ::rtl::OUString& rPara) const; + sal_Bool GetPrintList( ::rtl::OUString& rPara) const; + sal_Bool GetPrintToList( ::rtl::OUString& rPara ) const; + sal_Bool GetPrinterName( ::rtl::OUString& rPara ) const; + sal_Bool GetLanguage( ::rtl::OUString& rPara ) const; // Special analyzed states (does not match directly to a command line parameter!) - sal_Bool IsPrinting() const; - sal_Bool IsEmpty() const; - sal_Bool IsEmptyOrAcceptOnly() const; + sal_Bool IsPrinting() const; + sal_Bool IsEmpty() const; + sal_Bool IsEmptyOrAcceptOnly() const; private: enum Count { NONE, ONE, MANY }; struct GroupDefinition { - sal_Int32 nCount; - BoolParam* pGroupMembers; + sal_Int32 nCount; + BoolParam* pGroupMembers; }; // no copy and operator= CommandLineArgs( const CommandLineArgs& ); CommandLineArgs operator=( const CommandLineArgs& ); - sal_Bool InterpretCommandLineParameter( const ::rtl::OUString& ); - void ParseCommandLine_Impl( Supplier& supplier ); - void ResetParamValues(); - sal_Bool CheckGroupMembers( GroupParamId nGroup, BoolParam nExcludeMember ) const; + sal_Bool InterpretCommandLineParameter( const ::rtl::OUString& ); + void ParseCommandLine_Impl( Supplier& supplier ); + void ResetParamValues(); + sal_Bool CheckGroupMembers( GroupParamId nGroup, BoolParam nExcludeMember ) const; - void AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam ); - void SetBoolParam_Impl( BoolParam eParam, sal_Bool bValue ); + void AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam ); + void SetBoolParam_Impl( BoolParam eParam, sal_Bool bValue ); boost::optional< rtl::OUString > m_cwdUrl; - sal_Bool m_aBoolParams[ CMD_BOOLPARAM_COUNT ]; // Stores boolean parameters - rtl::OUString m_aStrParams[ CMD_STRINGPARAM_COUNT ]; // Stores string parameters - sal_Bool m_aStrSetParams[ CMD_STRINGPARAM_COUNT ]; // Stores if string parameters are provided on cmdline - Count m_eArgumentCount; // Number of Args - mutable ::osl::Mutex m_aMutex; + sal_Bool m_aBoolParams[ CMD_BOOLPARAM_COUNT ]; // Stores boolean parameters + rtl::OUString m_aStrParams[ CMD_STRINGPARAM_COUNT ]; // Stores string parameters + sal_Bool m_aStrSetParams[ CMD_STRINGPARAM_COUNT ]; // Stores if string parameters are provided on cmdline + Count m_eArgumentCount; // Number of Args + bool m_bDocumentArgs; // A document creation/open/load arg is used + mutable ::osl::Mutex m_aMutex; // static definition for groups where only one member can be true static GroupDefinition m_pGroupDefinitions[ CMD_GRPID_COUNT ]; diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 24b47aa223e3..5f9de3965199 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -71,29 +71,34 @@ Entry_Impl::Entry_Impl( const uno::Reference< deployment::XPackage > &xPackage, m_pPublisher( NULL ), m_xPackage( xPackage ) { - m_sTitle = xPackage->getDisplayName(); - m_sVersion = xPackage->getVersion(); - m_sDescription = xPackage->getDescription(); - - beans::StringPair aInfo( m_xPackage->getPublisherInfo() ); - m_sPublisher = aInfo.First; - m_sPublisherURL = aInfo.Second; - - // get the icons for the package if there are any - uno::Reference< graphic::XGraphic > xGraphic = xPackage->getIcon( false ); - if ( xGraphic.is() ) - m_aIcon = Image( xGraphic ); - - xGraphic = xPackage->getIcon( true ); - if ( xGraphic.is() ) - m_aIconHC = Image( xGraphic ); - else - m_aIconHC = m_aIcon; + try + { + m_sTitle = xPackage->getDisplayName(); + m_sVersion = xPackage->getVersion(); + m_sDescription = xPackage->getDescription(); + + beans::StringPair aInfo( m_xPackage->getPublisherInfo() ); + m_sPublisher = aInfo.First; + m_sPublisherURL = aInfo.Second; + + // get the icons for the package if there are any + uno::Reference< graphic::XGraphic > xGraphic = xPackage->getIcon( false ); + if ( xGraphic.is() ) + m_aIcon = Image( xGraphic ); + + xGraphic = xPackage->getIcon( true ); + if ( xGraphic.is() ) + m_aIconHC = Image( xGraphic ); + else + m_aIconHC = m_aIcon; - if ( eState == AMBIGUOUS ) - m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS ); - else if ( eState == NOT_REGISTERED ) - checkDependencies(); + if ( eState == AMBIGUOUS ) + m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS ); + else if ( eState == NOT_REGISTERED ) + checkDependencies(); + } + catch (deployment::ExtensionRemovedException &) {} + catch (uno::RuntimeException &) {} } //------------------------------------------------------------------------------ @@ -963,6 +968,11 @@ long ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > & bool bLocked = m_pManager->isReadOnly( xPackage ); TEntry_Impl pEntry( new Entry_Impl( xPackage, eState, bLocked ) ); + + // Don't add empty entries + if ( ! pEntry->m_sTitle.Len() ) + return 0; + xPackage->addEventListener( uno::Reference< lang::XEventListener > ( m_xRemoveListener, uno::UNO_QUERY ) ); ::osl::ClearableMutexGuard guard(m_entriesMutex); diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index feb55d0af3bf..7f262d66684b 100644..100755 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -986,16 +986,20 @@ OUString BackendImpl::PackageImpl::getDescription() if (sRelativeURL.getLength()) { OUString sURL = m_url_expanded + OUSTR("/") + sRelativeURL; - sDescription = getTextFromURL( - css::uno::Reference< css::ucb::XCommandEnvironment >(), sURL); + try + { + sDescription = getTextFromURL( css::uno::Reference< css::ucb::XCommandEnvironment >(), sURL ); + } + catch ( css::deployment::DeploymentException& ) + { + OSL_ENSURE( 0, ::rtl::OUStringToOString( ::comphelper::anyToString( ::cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); + } } + if (sDescription.getLength()) return sDescription; - else if(m_oldDescription.getLength()) - return m_oldDescription; - else - return OUString(); + return m_oldDescription; } //______________________________________________________________________________ |