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