diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-05-07 11:49:46 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-05-07 11:49:46 +0200 |
commit | 93f5d5a9190e0e03bf4822663652a4b068c44f75 (patch) | |
tree | 9ac61601b056acad6a6c83d728c684661d3f3271 /sfx2 | |
parent | c6fdd34c16f415629222348631141c3e13af6d4a (diff) |
The opaque PostUserEvent IDs are actually pointers
...so declare them as such. This avoids the recurring mistake of storing such
IDs as sal_uInt32, truncating in 64 bit environments, causing RemoveUserEvent to
potentially not remove the event, it thus firing "too late" and probably causing
a crash.
While at it, consolidate the trivially unnecessary overloads of both
Application::PostUserEvent and Window::PostUserEvent. And in each of them, it
looks like deleting the mpLink member was missing from the failure branch.
Change-Id: Iab13afbb06e12ac15dec6a6b5b85a7e402a3c654
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlgimpl.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/inc/tplcitem.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/AsynchronousCall.hxx | 4 |
4 files changed, 6 insertions, 5 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 9c177575a02e..06d7c01c33b9 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -561,8 +561,7 @@ void BackingWindow::dispatchURL( const OUString& i_rURL, if ( xDispatch.is() ) { ImplDelayedDispatch* pDisp = new ImplDelayedDispatch( xDispatch, aDispatchURL, i_rArgs ); - sal_uLong nEventId = 0; - if( ! Application::PostUserEvent( nEventId, Link( NULL, implDispatchDelayed ), pDisp ) ) + if( Application::PostUserEvent( Link( NULL, implDispatchDelayed ), pDisp ) == 0 ) delete pDisp; // event could not be posted for unknown reason, at least don't leak } } diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 0b25cc51e6a5..21e3a30912f9 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -72,7 +72,7 @@ namespace sfx2 SfxFilterFlags m_nMustFlags; SfxFilterFlags m_nDontFlags; - sal_uIntPtr mnPostUserEventId; + ImplSVEvent * mnPostUserEventId; ErrCode mnError; diff --git a/sfx2/source/inc/tplcitem.hxx b/sfx2/source/inc/tplcitem.hxx index ad0471b2c5f8..1b17a3e59bdc 100644 --- a/sfx2/source/inc/tplcitem.hxx +++ b/sfx2/source/inc/tplcitem.hxx @@ -27,7 +27,7 @@ class SfxCommonTemplateDialog_Impl; class SfxTemplateControllerItem: public SfxControllerItem { SfxCommonTemplateDialog_Impl &rTemplateDlg; sal_uInt8 nWaterCanState; - long nUserEventId; + ImplSVEvent * nUserEventId; DECL_STATIC_LINK(SfxTemplateControllerItem, SetWaterCanStateHdl_Impl, SfxTemplateControllerItem*); diff --git a/sfx2/source/sidebar/AsynchronousCall.hxx b/sfx2/source/sidebar/AsynchronousCall.hxx index 1c2b45d61db4..d3ecd5dcf98c 100644 --- a/sfx2/source/sidebar/AsynchronousCall.hxx +++ b/sfx2/source/sidebar/AsynchronousCall.hxx @@ -23,6 +23,8 @@ #include <tools/solar.h> #include <tools/link.hxx> +struct ImplSVEvent; + namespace sfx2 { namespace sidebar { /** A simple asynchronous call via Application::PostUserCall. @@ -42,7 +44,7 @@ public: private: Action maAction; - sal_uLong mnCallId; + ImplSVEvent * mnCallId; DECL_LINK(HandleUserCall, void*); }; |