summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-11-09 15:38:59 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-11-09 15:38:59 +0100
commit35653fbf17e48e3bc87803388f6132f8df0dabc2 (patch)
tree5706815566dc2c9a579b5995bc6701bea44d61e5
parent99ff0570721994b688ab1d5703ad0bbd44c40a65 (diff)
parentf2ef99142047914beea7ac4da849f261e38e70fa (diff)
CWS-TOOLING: integrate CWS fwk149ooo/DEV300_m93
-rw-r--r--desktop/source/app/app.cxx125
-rw-r--r--desktop/source/app/cmdlineargs.cxx281
-rw-r--r--desktop/source/app/cmdlineargs.hxx131
-rw-r--r--framework/source/uielement/comboboxtoolbarcontroller.cxx33
-rw-r--r--sfx2/source/view/viewsh.cxx1
-rw-r--r--svx/source/dialog/docrecovery.hrc4
6 files changed, 282 insertions, 293 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index ae3036a53e..ad95231143 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;
}
@@ -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 c142c5f96a..beb8423814 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 569dd5ccbc..6412c2a7f2 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,89 +123,91 @@ 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 ];
+ static GroupDefinition m_pGroupDefinitions[ CMD_GRPID_COUNT ];
};
}
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index 6a0516e258..c9f93e6290 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -261,19 +261,30 @@ void ComboboxToolbarController::LoseFocus()
long ComboboxToolbarController::PreNotify( NotifyEvent& rNEvt )
{
- if( rNEvt.GetType() == EVENT_KEYINPUT )
+ switch ( rNEvt.GetType() )
{
- const ::KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
- const KeyCode& rKeyCode = pKeyEvent->GetKeyCode();
- if(( rKeyCode.GetModifier() | rKeyCode.GetCode()) == KEY_RETURN )
- {
- // Call execute only with non-empty text
- if ( m_pComboBox->GetText().Len() > 0 )
- execute( rKeyCode.GetModifier() );
- return 1;
- }
+ case EVENT_KEYINPUT :
+ {
+ const ::KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
+ const KeyCode& rKeyCode = pKeyEvent->GetKeyCode();
+ if(( rKeyCode.GetModifier() | rKeyCode.GetCode()) == KEY_RETURN )
+ {
+ // Call execute only with non-empty text
+ if ( m_pComboBox->GetText().Len() > 0 )
+ execute( rKeyCode.GetModifier() );
+ return 1;
+ }
+ }
+ break;
+ case EVENT_GETFOCUS :
+ notifyFocusGet();
+ break;
+ case EVENT_LOSEFOCUS :
+ notifyFocusLost();
+ break;
+ default :
+ break;
}
-
return 0;
}
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 51142c52d8..a18dd7a0ed 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2061,6 +2061,7 @@ void Change( Menu* pMenu, SfxViewShell* pView )
if ( pSlot )
{
pMenu->InsertItem( pSlot->GetSlotId(), pMenu->GetItemText( nId ), pMenu->GetItemBits( nId ), nPos );
+ pMenu->SetItemCommand( pSlot->GetSlotId(), aCmd );
pMenu->RemoveItem( nPos+1 );
break;
}
diff --git a/svx/source/dialog/docrecovery.hrc b/svx/source/dialog/docrecovery.hrc
index 851321bc6a..ae6ddc84bc 100644
--- a/svx/source/dialog/docrecovery.hrc
+++ b/svx/source/dialog/docrecovery.hrc
@@ -36,7 +36,7 @@
// TabDialog
#define TABDLG_WIDTH 290
-#define TABDLG_HEIGHT 278
+#define TABDLG_HEIGHT 238
// TabPage CrashSave
@@ -52,7 +52,7 @@
#define SAVE_WIDTH 290
-#define SAVE_HEIGHT 278
+#define SAVE_HEIGHT 238
#define SAVE_TITLEWINHEIGHT 36
#define SAVE_DESCRHEIGHT 48
#define SAVE_COL0 (RSC_SP_DLG_INNERBORDER_LEFT)