Kaydet (Commit) e66e54fb authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Further clean up of areas touched by previous commit.

üst e0424933
...@@ -190,7 +190,6 @@ class Desktop : public Application ...@@ -190,7 +190,6 @@ class Desktop : public Application
void DoFirstRunInitializations(); void DoFirstRunInitializations();
static sal_Bool SaveTasks(); static sal_Bool SaveTasks();
static sal_Bool _bTasksSaved;
static void retrieveCrashReporterState(); static void retrieveCrashReporterState();
static sal_Bool isUIOnSessionShutdownAllowed(); static sal_Bool isUIOnSessionShutdownAllowed();
......
This diff is collapsed.
...@@ -399,8 +399,8 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -399,8 +399,8 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
void CommandLineArgs::AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam ) void CommandLineArgs::AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam )
{ {
::rtl::OUStringBuffer aParamBuf(m_aStrParams[eParam]);
OSL_ASSERT( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT ); OSL_ASSERT( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT );
::rtl::OUStringBuffer aParamBuf(m_aStrParams[eParam]);
if ( aParamBuf.getLength() ) if ( aParamBuf.getLength() )
aParamBuf.append('\n'); aParamBuf.append('\n');
aParamBuf.append(aParam); aParamBuf.append(aParam);
......
...@@ -695,7 +695,6 @@ void SAL_CALL OfficeIPCThread::run() ...@@ -695,7 +695,6 @@ void SAL_CALL OfficeIPCThread::run()
// is this a termination message ? if so, terminate // is this a termination message ? if so, terminate
if(( aArguments.CompareTo( sc_aTerminationSequence, sc_nTSeqLength ) == COMPARE_EQUAL ) || if(( aArguments.CompareTo( sc_aTerminationSequence, sc_nTSeqLength ) == COMPARE_EQUAL ) ||
mbDowning ) return; mbDowning ) return;
String aEmpty;
std::auto_ptr< CommandLineArgs > aCmdLineArgs; std::auto_ptr< CommandLineArgs > aCmdLineArgs;
try try
{ {
...@@ -715,22 +714,22 @@ void SAL_CALL OfficeIPCThread::run() ...@@ -715,22 +714,22 @@ void SAL_CALL OfficeIPCThread::run()
{ {
// we have to use application event, because we have to start quickstart service in main thread!! // we have to use application event, because we have to start quickstart service in main thread!!
ApplicationEvent* pAppEvent = ApplicationEvent* pAppEvent =
new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("QUICKSTART"))); new ApplicationEvent(ApplicationEvent::TYPE_QUICKSTART);
ImplPostForeignAppEvent( pAppEvent ); ImplPostForeignAppEvent( pAppEvent );
} }
// handle request for acceptor // handle request for acceptor
OUString aAcceptString; OUString aAcceptString;
if ( aCmdLineArgs->GetAcceptString(aAcceptString) ) { if ( aCmdLineArgs->GetAcceptString(aAcceptString) ) {
ApplicationEvent* pAppEvent = ApplicationEvent* pAppEvent = new ApplicationEvent(
new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ACCEPT")), aAcceptString); ApplicationEvent::TYPE_ACCEPT, aAcceptString);
ImplPostForeignAppEvent( pAppEvent ); ImplPostForeignAppEvent( pAppEvent );
} }
// handle acceptor removal // handle acceptor removal
OUString aUnAcceptString; OUString aUnAcceptString;
if ( aCmdLineArgs->GetUnAcceptString(aUnAcceptString) ) { if ( aCmdLineArgs->GetUnAcceptString(aUnAcceptString) ) {
ApplicationEvent* pAppEvent = ApplicationEvent* pAppEvent = new ApplicationEvent(
new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNACCEPT")), aUnAcceptString); ApplicationEvent::TYPE_UNACCEPT, aUnAcceptString);
ImplPostForeignAppEvent( pAppEvent ); ImplPostForeignAppEvent( pAppEvent );
} }
...@@ -739,7 +738,7 @@ void SAL_CALL OfficeIPCThread::run() ...@@ -739,7 +738,7 @@ void SAL_CALL OfficeIPCThread::run()
// in a running instance in order to display the command line help // in a running instance in order to display the command line help
if ( aCmdLineArgs->IsHelp() ) { if ( aCmdLineArgs->IsHelp() ) {
ApplicationEvent* pAppEvent = ApplicationEvent* pAppEvent =
new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HELP"))); new ApplicationEvent(ApplicationEvent::TYPE_HELP);
ImplPostForeignAppEvent( pAppEvent ); ImplPostForeignAppEvent( pAppEvent );
} }
#endif #endif
...@@ -837,8 +836,9 @@ void SAL_CALL OfficeIPCThread::run() ...@@ -837,8 +836,9 @@ void SAL_CALL OfficeIPCThread::run()
#elif defined WNT #elif defined WNT
aHelpURLBuffer.appendAscii("&System=WIN"); aHelpURLBuffer.appendAscii("&System=WIN");
#endif #endif
ApplicationEvent* pAppEvent = ApplicationEvent* pAppEvent = new ApplicationEvent(
new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OPENHELPURL")), aHelpURLBuffer.makeStringAndClear()); ApplicationEvent::TYPE_OPENHELPURL,
aHelpURLBuffer.makeStringAndClear());
ImplPostForeignAppEvent( pAppEvent ); ImplPostForeignAppEvent( pAppEvent );
} }
} }
...@@ -876,7 +876,7 @@ void SAL_CALL OfficeIPCThread::run() ...@@ -876,7 +876,7 @@ void SAL_CALL OfficeIPCThread::run()
{ {
// no document was sent, just bring Office to front // no document was sent, just bring Office to front
ApplicationEvent* pAppEvent = ApplicationEvent* pAppEvent =
new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("APPEAR"))); new ApplicationEvent(ApplicationEvent::TYPE_APPEAR);
ImplPostForeignAppEvent( pAppEvent ); ImplPostForeignAppEvent( pAppEvent );
} }
......
...@@ -245,7 +245,8 @@ SV_IMPL_PTRARR( SfxDdeDocTopics_Impl, SfxDdeDocTopic_Impl *) ...@@ -245,7 +245,8 @@ SV_IMPL_PTRARR( SfxDdeDocTopics_Impl, SfxDdeDocTopic_Impl *)
//======================================================================== //========================================================================
sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent, sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent,
const String &rCmd, const String &rEvent ) const String &rCmd, const String &rEvent,
ApplicationEvent::Type eType )
/* [Description] /* [Description]
...@@ -291,7 +292,7 @@ sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent, ...@@ -291,7 +292,7 @@ sal_Bool SfxAppEvent_Impl( ApplicationEvent &rAppEvent,
} }
} }
rAppEvent = ApplicationEvent(rEvent, aData.makeStringAndClear()); rAppEvent = ApplicationEvent(eType, aData.makeStringAndClear());
return sal_True; return sal_True;
} }
} }
...@@ -318,8 +319,8 @@ long SfxApplication::DdeExecute ...@@ -318,8 +319,8 @@ long SfxApplication::DdeExecute
{ {
// Print or Open-Event? // Print or Open-Event?
ApplicationEvent aAppEvent; ApplicationEvent aAppEvent;
if ( SfxAppEvent_Impl( aAppEvent, rCmd, DEFINE_CONST_UNICODE("Print") ) || if ( SfxAppEvent_Impl( aAppEvent, rCmd, DEFINE_CONST_UNICODE("Print"), ApplicationEvent::TYPE_PRINT ) ||
SfxAppEvent_Impl( aAppEvent, rCmd, DEFINE_CONST_UNICODE("Open") ) ) SfxAppEvent_Impl( aAppEvent, rCmd, DEFINE_CONST_UNICODE("Open"), ApplicationEvent::TYPE_OPEN ) )
GetpApp()->AppEvent( aAppEvent ); GetpApp()->AppEvent( aAppEvent );
else else
{ {
......
...@@ -314,7 +314,7 @@ ...@@ -314,7 +314,7 @@
const rtl::OUString aFile( GetOUString( pFile ) ); const rtl::OUString aFile( GetOUString( pFile ) );
if( ! AquaSalInstance::isOnCommandLine( aFile ) ) if( ! AquaSalInstance::isOnCommandLine( aFile ) )
{ {
const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_OPEN_STRING)), aFile); const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::TYPE_OPEN, aFile);
AquaSalInstance::aAppEventList.push_back( pAppEvent ); AquaSalInstance::aAppEventList.push_back( pAppEvent );
} }
return YES; return YES;
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
// we have no back channel here, we have to assume success, in which case // we have no back channel here, we have to assume success, in which case
// replyToOpenOrPrint does not need to be called according to documentation // replyToOpenOrPrint does not need to be called according to documentation
// [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess]; // [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess];
const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_OPEN_STRING)), aFileList.makeStringAndClear()); const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::TYPE_OPEN, aFileList.makeStringAndClear());
AquaSalInstance::aAppEventList.push_back( pAppEvent ); AquaSalInstance::aAppEventList.push_back( pAppEvent );
} }
} }
...@@ -353,7 +353,7 @@ ...@@ -353,7 +353,7 @@
{ {
(void)app; (void)app;
const rtl::OUString aFile( GetOUString( pFile ) ); const rtl::OUString aFile( GetOUString( pFile ) );
const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_PRINT_STRING)), aFile); const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::TYPE_PRINT, aFile);
AquaSalInstance::aAppEventList.push_back( pAppEvent ); AquaSalInstance::aAppEventList.push_back( pAppEvent );
return YES; return YES;
} }
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
aFileList.append('\n'); aFileList.append('\n');
aFileList.append( GetOUString( pFile ) ); aFileList.append( GetOUString( pFile ) );
} }
const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_PRINT_STRING)), aFileList.makeStringAndClear()); const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::TYPE_PRINT, aFileList.makeStringAndClear());
AquaSalInstance::aAppEventList.push_back( pAppEvent ); AquaSalInstance::aAppEventList.push_back( pAppEvent );
// we have no back channel here, we have to assume success // we have no back channel here, we have to assume success
// correct handling would be NSPrintingReplyLater and then send [app replyToOpenOrPrint] // correct handling would be NSPrintingReplyLater and then send [app replyToOpenOrPrint]
...@@ -398,7 +398,7 @@ ...@@ -398,7 +398,7 @@
if( aReply == NSTerminateNow ) if( aReply == NSTerminateNow )
{ {
ApplicationEvent aEv(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PRIVATE:DOSHUTDOWN"))); ApplicationEvent aEv(ApplicationEvent::TYPE_PRIVATE_DOSHUTDOWN);
GetpApp()->AppEvent( aEv ); GetpApp()->AppEvent( aEv );
ImplImageTreeSingletonRef()->shutDown(); ImplImageTreeSingletonRef()->shutDown();
// DeInitVCL should be called in ImplSVMain - unless someon _exits first which // DeInitVCL should be called in ImplSVMain - unless someon _exits first which
......
...@@ -75,7 +75,7 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL; ...@@ -75,7 +75,7 @@ const AquaSalMenu* AquaSalMenu::pCurrentMenuBar = NULL;
else if( nDialog == SHOWDIALOG_ID_PREFERENCES ) else if( nDialog == SHOWDIALOG_ID_PREFERENCES )
aDialog = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PREFERENCES")); aDialog = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PREFERENCES"));
const ApplicationEvent* pAppEvent = new ApplicationEvent( const ApplicationEvent* pAppEvent = new ApplicationEvent(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SHOWDIALOG")), aDialog); ApplicationEvent::TYPE_SHOWDIALOG, aDialog);
AquaSalInstance::aAppEventList.push_back( pAppEvent ); AquaSalInstance::aAppEventList.push_back( pAppEvent );
} }
} }
......
...@@ -97,36 +97,27 @@ typedef long (*VCLEventHookProc)( NotifyEvent& rEvt, void* pData ); ...@@ -97,36 +97,27 @@ typedef long (*VCLEventHookProc)( NotifyEvent& rEvt, void* pData );
enum Service { SERVICE_OLE, SERVICE_APPEVENT, SERVICE_IPC }; enum Service { SERVICE_OLE, SERVICE_APPEVENT, SERVICE_IPC };
#endif #endif
#define APPEVENT_OPEN_STRING "Open"
#define APPEVENT_PRINT_STRING "Print"
class VCL_DLLPUBLIC ApplicationEvent class VCL_DLLPUBLIC ApplicationEvent
{ {
rtl::OUString aEvent;
rtl::OUString aData;
std::vector<rtl::OUString> aParams;
ApplicationEvent();
public: public:
ApplicationEvent(const rtl::OUString& rEvent, enum Type {
TYPE_ACCEPT, TYPE_APPEAR, TYPE_HELP, TYPE_OPEN, TYPE_OPENHELPURL,
TYPE_PRINT, TYPE_PRIVATE_DOSHUTDOWN, TYPE_QUICKSTART, TYPE_SHOWDIALOG,
TYPE_UNACCEPT
};
ApplicationEvent(Type rEvent,
const rtl::OUString& rData = rtl::OUString()): const rtl::OUString& rData = rtl::OUString()):
aEvent(rEvent), aEvent(rEvent),
aData(rData) aData(rData)
{ {}
sal_Int32 start = 0;
for(sal_Int32 i = 0; i < rData.getLength(); ++i)
{
if(rData[i] == '\n')
{
aParams.push_back(rData.copy(start, i - start));
start = ++i;
}
}
}
const rtl::OUString& GetEvent() const { return aEvent; } Type GetEvent() const { return aEvent; }
const rtl::OUString& GetData() const { return aData; } const rtl::OUString& GetData() const { return aData; }
const std::vector<rtl::OUString>& GetParams() const { return aParams; }
private:
Type aEvent;
rtl::OUString aData;
}; };
class VCL_DLLPUBLIC PropertyHandler class VCL_DLLPUBLIC PropertyHandler
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
// we have no back channel here, we have to assume success, in which case // we have no back channel here, we have to assume success, in which case
// replyToOpenOrPrint does not need to be called according to documentation // replyToOpenOrPrint does not need to be called according to documentation
// [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess]; // [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess];
const ApplicationEvent* pAppEvent = new ApplicationEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(APPEVENT_OPEN_STRING)), aFileList.makeStringAndClear()); const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::TYPE_OPEN, aFileList.makeStringAndClear());
IosSalInstance::aAppEventList.push_back( pAppEvent ); IosSalInstance::aAppEventList.push_back( pAppEvent );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment