diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-03-10 13:56:43 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-03-10 14:53:19 +0100 |
commit | 5a9fa5ca17073f409b8ffc13d909b218b5bcb40d (patch) | |
tree | b3e5a2022aeeb24521f07c181342a54a34d241f4 /desktop | |
parent | a3fcf5a3b8ea26c289b12216d7f8fdb7e07814b7 (diff) |
No need for heap allocation here
Change-Id: I34e96e3101f80398f238cdb5a94c00fee4b0faae
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 2b4782c023ef..3cfd3e78c10d 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2603,15 +2603,13 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) const CommandLineArgs& rCmdLine = GetCommandLineArgs(); if ( !rCmdLine.IsInvisible() && !rCmdLine.IsTerminateAfterInit() ) { - ProcessDocumentsRequest* pDocsRequest = new ProcessDocumentsRequest( - rCmdLine.getCwdUrl()); + ProcessDocumentsRequest docsRequest(rCmdLine.getCwdUrl()); std::vector<OUString> const & data(rAppEvent.GetStringsData()); - pDocsRequest->aOpenList.insert( - pDocsRequest->aOpenList.end(), data.begin(), data.end()); - pDocsRequest->pcProcessed = nullptr; + docsRequest.aOpenList.insert( + docsRequest.aOpenList.end(), data.begin(), data.end()); + docsRequest.pcProcessed = nullptr; - OfficeIPCThread::ExecuteCmdLineRequests( *pDocsRequest ); - delete pDocsRequest; + OfficeIPCThread::ExecuteCmdLineRequests(docsRequest); } } break; @@ -2624,15 +2622,13 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) const CommandLineArgs& rCmdLine = GetCommandLineArgs(); if ( !rCmdLine.IsInvisible() && !rCmdLine.IsTerminateAfterInit() ) { - ProcessDocumentsRequest* pDocsRequest = new ProcessDocumentsRequest( - rCmdLine.getCwdUrl()); + ProcessDocumentsRequest docsRequest(rCmdLine.getCwdUrl()); std::vector<OUString> const & data(rAppEvent.GetStringsData()); - pDocsRequest->aPrintList.insert( - pDocsRequest->aPrintList.end(), data.begin(), data.end()); - pDocsRequest->pcProcessed = nullptr; + docsRequest.aPrintList.insert( + docsRequest.aPrintList.end(), data.begin(), data.end()); + docsRequest.pcProcessed = nullptr; - OfficeIPCThread::ExecuteCmdLineRequests( *pDocsRequest ); - delete pDocsRequest; + OfficeIPCThread::ExecuteCmdLineRequests(docsRequest); } } break; |