[Libreoffice-commits] core.git: dbaccess/source desktop/source extensions/source forms/source fpicker/source include/dbaccess include/svtools include/svx include/vcl reportdesign/source sd/source sfx2/source svtools/source svx/source sw/inc sw/source toolkit/source vcl/inc vcl/source vcl/unx

Stephan Bergmann sbergman at redhat.com
Wed May 7 02:55:05 PDT 2014


 dbaccess/source/filter/xml/dbloader2.cxx                             |    2 
 dbaccess/source/ui/app/AppController.hxx                             |    2 
 dbaccess/source/ui/inc/TableGrantCtrl.hxx                            |    2 
 dbaccess/source/ui/inc/TableWindowListBox.hxx                        |    4 
 dbaccess/source/ui/inc/sbagrid.hxx                                   |    2 
 dbaccess/source/ui/inc/unodatbr.hxx                                  |    2 
 dbaccess/source/ui/tabledesign/TEditControl.cxx                      |    1 
 dbaccess/source/ui/tabledesign/TEditControl.hxx                      |   11 -
 desktop/source/deployment/gui/dp_gui_dialog2.hxx                     |    2 
 extensions/source/plugin/base/xplugin.cxx                            |    3 
 forms/source/component/Button.cxx                                    |    2 
 forms/source/component/Button.hxx                                    |    3 
 forms/source/component/Edit.hxx                                      |    4 
 forms/source/component/FormattedField.hxx                            |    4 
 fpicker/source/office/commonpicker.hxx                               |    4 
 include/dbaccess/AsyncronousLink.hxx                                 |    4 
 include/svtools/asynclink.hxx                                        |    3 
 include/svtools/editbrowsebox.hxx                                    |    2 
 include/svtools/ruler.hxx                                            |    2 
 include/svx/gridctrl.hxx                                             |    4 
 include/svx/sdr/table/tablecontroller.hxx                            |    2 
 include/vcl/evntpost.hxx                                             |    4 
 include/vcl/floatwin.hxx                                             |    2 
 include/vcl/menu.hxx                                                 |    3 
 include/vcl/svapp.hxx                                                |   25 +--
 include/vcl/window.hxx                                               |    6 
 reportdesign/source/ui/dlg/GroupsSorting.cxx                         |    4 
 sd/source/ui/accessibility/AccessibleSlideSorterView.cxx             |    4 
 sd/source/ui/annotations/annotationmanagerimpl.hxx                   |    2 
 sd/source/ui/annotations/annotationtag.hxx                           |    2 
 sd/source/ui/dlg/filedlg.cxx                                         |    2 
 sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx |    4 
 sd/source/ui/inc/slideshow.hxx                                       |    3 
 sd/source/ui/inc/view/viewoverlaymanager.hxx                         |    2 
 sd/source/ui/presenter/CanvasUpdateRequester.hxx                     |    4 
 sd/source/ui/slideshow/SlideShowRestarter.hxx                        |    2 
 sd/source/ui/slideshow/slideshowimpl.cxx                             |    9 -
 sd/source/ui/slideshow/slideshowimpl.hxx                             |    5 
 sd/source/ui/slidesorter/controller/SlsClipboard.cxx                 |    8 -
 sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx             |    3 
 sd/source/ui/view/ToolBarManager.cxx                                 |    4 
 sfx2/source/dialog/backingwindow.cxx                                 |    3 
 sfx2/source/dialog/filedlgimpl.hxx                                   |    2 
 sfx2/source/inc/tplcitem.hxx                                         |    2 
 sfx2/source/sidebar/AsynchronousCall.hxx                             |    4 
 svtools/source/contnr/imivctl.hxx                                    |    4 
 svtools/source/contnr/svimpbox.cxx                                   |   10 -
 svtools/source/control/asynclink.cxx                                 |    2 
 svtools/source/inc/svimpbox.hxx                                      |    2 
 svx/source/form/filtnav.cxx                                          |    3 
 svx/source/inc/delayedevent.hxx                                      |    3 
 svx/source/inc/fmexpl.hxx                                            |    2 
 svx/source/inc/fmshimp.hxx                                           |    8 -
 svx/source/inc/fmvwimp.hxx                                           |    9 -
 sw/inc/PostItMgr.hxx                                                 |    3 
 sw/inc/SidebarWin.hxx                                                |    2 
 sw/source/filter/html/swhtml.hxx                                     |    3 
 toolkit/source/awt/vclxwindow.cxx                                    |    2 
 vcl/inc/toolbox.h                                                    |    2 
 vcl/inc/window.h                                                     |    4 
 vcl/source/app/svapp.cxx                                             |   65 ++++------
 vcl/source/helper/threadex.cxx                                       |    2 
 vcl/source/window/dockmgr.cxx                                        |    2 
 vcl/source/window/dockwin.cxx                                        |    2 
 vcl/source/window/floatwin.cxx                                       |    2 
 vcl/source/window/menu.cxx                                           |    2 
 vcl/source/window/syschild.cxx                                       |    2 
 vcl/source/window/toolbox.cxx                                        |    2 
 vcl/source/window/toolbox2.cxx                                       |    2 
 vcl/source/window/window.cxx                                         |   39 ++----
 vcl/source/window/winproc.cxx                                        |    4 
 vcl/unx/generic/app/i18n_status.cxx                                  |    2 
 72 files changed, 163 insertions(+), 196 deletions(-)

New commits:
commit 93f5d5a9190e0e03bf4822663652a4b068c44f75
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed May 7 11:49:46 2014 +0200

    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

diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index 92eaf50..8aaeb3b 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -229,7 +229,7 @@ private:
     const Reference< XComponentContext >  m_aContext;
     Reference< XFrameLoader >           m_xMySelf;
     OUString                            m_sCurrentURL;
-    sal_uLong                               m_nStartWizard;
+    ImplSVEvent * m_nStartWizard;
 
     DECL_LINK( OnStartTableWizard, void* );
 public:
diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx
index ad56c3a..38a2176 100644
--- a/dbaccess/source/ui/app/AppController.hxx
+++ b/dbaccess/source/ui/app/AppController.hxx
@@ -116,7 +116,7 @@ namespace dbaui
         OTableCopyHelper        m_aTableCopyHelper;
         TransferableClipboardListener*
                                 m_pClipbordNotifier;        // notifier for changes in the clipboard
-        sal_uLong               m_nAsyncDrop;
+        ImplSVEvent *           m_nAsyncDrop;
         OAsyncronousLink        m_aSelectContainerEvent;
         PreviewMode             m_ePreviewMode;             // the mode of the preview
         ElementType             m_eCurrentType;
diff --git a/dbaccess/source/ui/inc/TableGrantCtrl.hxx b/dbaccess/source/ui/inc/TableGrantCtrl.hxx
index 5a97c39..d3ad883 100644
--- a/dbaccess/source/ui/inc/TableGrantCtrl.hxx
+++ b/dbaccess/source/ui/inc/TableGrantCtrl.hxx
@@ -56,7 +56,7 @@ class OTableGrantControl : public ::svt::EditBrowseBox
     ::svt::CheckBoxControl*     m_pCheckCell;
     Edit*                       m_pEdit;
     long                        m_nDataPos;
-    sal_uLong                       m_nDeactivateEvent;
+    ImplSVEvent *               m_nDeactivateEvent;
 
 public:
     OTableGrantControl( Window* pParent,const ResId& _RsId);
diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx
index 70e807d..13f30c6 100644
--- a/dbaccess/source/ui/inc/TableWindowListBox.hxx
+++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx
@@ -57,8 +57,8 @@ namespace dbaui
         Point                       m_aMousePos;
 
         OTableWindow*               m_pTabWin;
-        sal_uLong                       m_nDropEvent;
-        sal_uLong                       m_nUiEvent;
+        ImplSVEvent *               m_nDropEvent;
+        ImplSVEvent *               m_nUiEvent;
         OJoinDropData               m_aDropInfo;
 
         bool                        m_bReallyScrolled : 1;
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx
index a1e1032..e9c7e3b 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -217,7 +217,7 @@ namespace dbaui
         ::svx::ODataAccessDescriptor    m_aDataDescriptor;
         SbaGridListener*                m_pMasterListener;
 
-        sal_uLong                       m_nAsyncDropEvent;
+        ImplSVEvent *                   m_nAsyncDropEvent;
 
         sal_uInt16                          m_nCurrentActionColId;
             // ui actions (e.g. a context menu) may be performed on columns which aren't the current one
diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx
index 1b35d2f..b86083a 100644
--- a/dbaccess/source/ui/inc/unodatbr.hxx
+++ b/dbaccess/source/ui/inc/unodatbr.hxx
@@ -104,7 +104,7 @@ namespace dbaui
         Splitter*               m_pSplitter;
         SvTreeList*         m_pTreeModel;           // contains the datasources of the registry
         SvTreeListEntry*            m_pCurrentlyDisplayed;
-        sal_uLong                   m_nAsyncDrop;
+        ImplSVEvent *               m_nAsyncDrop;
 
         sal_Int16               m_nBorder;              // sal_True when border should be shown
 
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 310e2b5..0954b20 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -145,7 +145,6 @@ OTableEditorCtrl::OTableEditorCtrl(Window* pWindow)
     ,pHelpTextCell(NULL)
     ,pDescrCell(NULL)
     ,pDescrWin(NULL)
-    ,nIndexEvent(0)
     ,nCutEvent(0)
     ,nPasteEvent(0)
     ,nDeleteEvent(0)
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx
index 3a8064e..af84754 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.hxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx
@@ -54,12 +54,11 @@ namespace dbaui
 
          ::boost::shared_ptr<OTableRow> pActRow;
 
-        sal_uLong                       nIndexEvent;
-        sal_uLong                       nCutEvent;
-        sal_uLong                       nPasteEvent;
-        sal_uLong                       nDeleteEvent;
-        sal_uLong                       nInsNewRowsEvent;
-        sal_uLong                       nInvalidateTypeEvent;
+        ImplSVEvent *               nCutEvent;
+        ImplSVEvent *               nPasteEvent;
+        ImplSVEvent *               nDeleteEvent;
+        ImplSVEvent *               nInsNewRowsEvent;
+        ImplSVEvent *               nInvalidateTypeEvent;
         ChildFocusState             m_eChildFocus;
 
         long nOldDataPos;
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index 763edfd..99dd0db 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -55,7 +55,7 @@ class DialogHelper
 {
     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
     Dialog*         m_pVCLWindow;
-    sal_uLong           m_nEventID;
+    ImplSVEvent *   m_nEventID;
     bool            m_bIsBusy;
 
 public:
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index 606b4bc..be7311a 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -89,8 +89,7 @@ void PluginDisposer::onShot()
     {
         if( m_pPlugin->isDisposable() )
         {
-            sal_uLong nEvent;
-            Application::PostUserEvent( nEvent, LINK( m_pPlugin, XPlugin_Impl, secondLevelDispose ), (void*)m_pPlugin );
+            Application::PostUserEvent( LINK( m_pPlugin, XPlugin_Impl, secondLevelDispose ), (void*)m_pPlugin );
         }
     }
     else
diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx
index 550db56..9fb6e46 100644
--- a/forms/source/component/Button.cxx
+++ b/forms/source/component/Button.cxx
@@ -426,7 +426,7 @@ void SAL_CALL OButtonControl::disposing( const EventObject& _rSource ) throw( Ru
 void OButtonControl::actionPerformed(const ActionEvent& /*rEvent*/) throw ( ::com::sun::star::uno::RuntimeException, std::exception)
 {
     // Asynchronous for starutil::URL-Button
-    sal_uLong n = Application::PostUserEvent( LINK(this, OButtonControl,OnClick) );
+    ImplSVEvent * n = Application::PostUserEvent( LINK(this, OButtonControl,OnClick) );
     {
         ::osl::MutexGuard aGuard( m_aMutex );
         m_nClickEvent = n;
diff --git a/forms/source/component/Button.hxx b/forms/source/component/Button.hxx
index f07dbb5..48f52e3 100644
--- a/forms/source/component/Button.hxx
+++ b/forms/source/component/Button.hxx
@@ -35,6 +35,7 @@
 
 #include <cppuhelper/implbase1.hxx>
 
+struct ImplSVEvent;
 
 namespace frm
 {
@@ -119,7 +120,7 @@ class OButtonControl    :public OButtonControl_BASE
                         ,public OFormNavigationHelper
 {
 private:
-    sal_uLong m_nClickEvent;
+    ImplSVEvent * m_nClickEvent;
     sal_Int16   m_nTargetUrlFeatureId;
     /// caches the value of the "Enabled" property of our model
     bool    m_bEnabledByPropertyValue;
diff --git a/forms/source/component/Edit.hxx b/forms/source/component/Edit.hxx
index 8e806ff..f317bc3 100644
--- a/forms/source/component/Edit.hxx
+++ b/forms/source/component/Edit.hxx
@@ -26,7 +26,7 @@
 #include <cppuhelper/implbase3.hxx>
 
 namespace dbtools { class FormattedColumnValue; }
-
+struct ImplSVEvent;
 
 namespace frm
 {
@@ -132,7 +132,7 @@ class OEditControl : public OBoundControl
                         m_aChangeListeners;
 
     OUString         m_aHtmlChangeValue;
-    sal_uInt32              m_nKeyEvent;
+    ImplSVEvent *    m_nKeyEvent;
 
 public:
     OEditControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
diff --git a/forms/source/component/FormattedField.hxx b/forms/source/component/FormattedField.hxx
index 58cc655..f2a4b9a 100644
--- a/forms/source/component/FormattedField.hxx
+++ b/forms/source/component/FormattedField.hxx
@@ -26,6 +26,8 @@
 #include <cppuhelper/implbase1.hxx>
 #include "errorbroadcaster.hxx"
 
+struct ImplSVEvent;
+
 namespace frm
 {
 class OFormattedModel
@@ -145,7 +147,7 @@ class OFormattedModel
     class OFormattedControl :    public OBoundControl
                                 ,public OFormattedControl_BASE
     {
-        sal_uInt32              m_nKeyEvent;
+        ImplSVEvent * m_nKeyEvent;
 
     public:
         OFormattedControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
diff --git a/fpicker/source/office/commonpicker.hxx b/fpicker/source/office/commonpicker.hxx
index 9df6be2..c103a91 100644
--- a/fpicker/source/office/commonpicker.hxx
+++ b/fpicker/source/office/commonpicker.hxx
@@ -36,7 +36,7 @@
 
 class SvtFileDialog;
 class Window;
-
+struct ImplSVEvent;
 
 namespace svt
 {
@@ -65,7 +65,7 @@ namespace svt
         // </properties>
 
         SvtFileDialog*      m_pDlg;
-        sal_uInt32          m_nCancelEvent;
+        ImplSVEvent *       m_nCancelEvent;
         bool            m_bExecuting;
 
         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >  m_xDialogParent;
diff --git a/include/dbaccess/AsyncronousLink.hxx b/include/dbaccess/AsyncronousLink.hxx
index 2a1cfc0..b0ba02d 100644
--- a/include/dbaccess/AsyncronousLink.hxx
+++ b/include/dbaccess/AsyncronousLink.hxx
@@ -23,6 +23,8 @@
 #include <tools/link.hxx>
 #include <osl/mutex.hxx>
 
+struct ImplSVEvent;
+
 namespace dbaui
 {
 
@@ -41,7 +43,7 @@ namespace dbaui
     protected:
         ::osl::Mutex        m_aEventSafety;
         ::osl::Mutex        m_aDestructionSafety;
-        sal_uLong               m_nEventId;
+        ImplSVEvent *       m_nEventId;
 
     public:
         /** constructs the object
diff --git a/include/svtools/asynclink.hxx b/include/svtools/asynclink.hxx
index 55a156e..e303bbe 100644
--- a/include/svtools/asynclink.hxx
+++ b/include/svtools/asynclink.hxx
@@ -26,13 +26,14 @@
 #include <osl/mutex.hxx>
 
 class Timer;
+struct ImplSVEvent;
 
 namespace svtools {
 
 class SVT_DLLPUBLIC AsynchronLink
 {
     Link   _aLink;
-    sal_uLong  _nEventId;
+    ImplSVEvent * _nEventId;
     Timer* _pTimer;
     bool   _bInCall;
     bool*  _pDeleted;
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index b5157e9..ff8d732 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -471,7 +471,7 @@ namespace svt
         CellControllerRef        aController,
                                  aOldController;
 
-        sal_uLong   nStartEvent, nEndEvent, nCellModifiedEvent;     // event ids
+        ImplSVEvent * nStartEvent, * nEndEvent, * nCellModifiedEvent;     // event ids
         Window* m_pFocusWhileRequest;
             // In ActivateCell, we grab the focus asynchronously, but if between requesting activation
             // and the asynchornous event the focus has changed, we won't grab it for ourself.
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index d162639..b645c45 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -623,7 +623,7 @@ private:
     long            mnBorderWidth;
     long            mnStartDragPos;
     long            mnDragPos;
-    sal_uLong       mnUpdateEvtId;
+    ImplSVEvent *   mnUpdateEvtId;
     ImplRulerData*  mpSaveData;
     ImplRulerData*  mpData;
     ImplRulerData*  mpDragData;
diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx
index 8fb2dbb..39a273b 100644
--- a/include/svx/gridctrl.hxx
+++ b/include/svx/gridctrl.hxx
@@ -233,7 +233,7 @@ private:
 
                     m_xEmptyRow;        // record set to insert
 
-    sal_uInt32          m_nAsynAdjustEvent;
+    ImplSVEvent *   m_nAsynAdjustEvent;
 
     // if we modify the row for the new record, we automatically insert a "new new row".
     // But if somebody else inserts a new record into the data source, we have to do the same.
@@ -272,7 +272,7 @@ private:
 
     BrowserMode         m_nMode;
     sal_Int32           m_nCurrentPos;      // Current position;
-    sal_uInt32          m_nDeleteEvent;     // EventId for asychronous deletion of rows
+    ImplSVEvent *       m_nDeleteEvent;     // EventId for asychronous deletion of rows
     sal_uInt16          m_nOptions;         // What is the able to do (Insert, Update, Delete)
                                         // default readonly
     sal_uInt16          m_nOptionMask;      // the mask of options to be enabled in setDataSource
diff --git a/include/svx/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx
index 1550bc4..0f2de21 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -167,7 +167,7 @@ private:
 
     ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > mxModifyListener;
 
-    sal_uLong mnUpdateEvent;
+    ImplSVEvent * mnUpdateEvent;
 };
 
 rtl::Reference< sdr::SelectionController > CreateTableController( SdrObjEditView* pView, const SdrObject* pObj, const rtl::Reference< sdr::SelectionController >& xRefController );
diff --git a/include/vcl/evntpost.hxx b/include/vcl/evntpost.hxx
index 3b502a4..5989823 100644
--- a/include/vcl/evntpost.hxx
+++ b/include/vcl/evntpost.hxx
@@ -22,7 +22,7 @@
 #include <tools/link.hxx>
 #include <vcl/dllapi.h>
 
-
+struct ImplSVEvent;
 
 namespace vcl
 {
@@ -34,7 +34,7 @@ namespace vcl
 
     class VCL_DLLPUBLIC EventPoster
     {
-        sal_uLong           m_nId;
+        ImplSVEvent *   m_nId;
         Link            m_aLink;
 
         DECL_DLLPRIVATE_LINK( DoEvent_Impl, UserEvent* );
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index e58873e..62d0086 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -72,7 +72,7 @@ private:
     Window*         mpFirstPopupModeWin;
     ImplData*       mpImplData;
     Rectangle       maFloatRect;
-    sal_uLong           mnPostId;
+    ImplSVEvent *   mnPostId;
     sal_uLong           mnPopupModeFlags;
     sal_uInt16          mnTitle;
     sal_uInt16          mnOldTitle;
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 10ac788..9f31b20 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -30,6 +30,7 @@
 #include <vcl/vclevent.hxx>
 #include <com/sun/star/uno/Reference.hxx>
 
+struct ImplSVEvent;
 struct MenuItemData;
 class Point;
 class Size;
@@ -128,7 +129,7 @@ private:
 
     OUString            aTitleText;         // PopupMenu text
 
-    sal_uLong           nEventId;
+    ImplSVEvent *       nEventId;
     sal_uInt16          mnHighlightedItemPos; // for native menus: keeps track of the highlighted item
     sal_uInt16          nMenuFlags;
     sal_uInt16          nDefaultItem;       // Id of default item
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index b7e00ca..5f24c76 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -60,6 +60,7 @@ class KeyEvent;
 class MouseEvent;
 class ZoomEvent;
 class ScrollEvent;
+struct ImplSVEvent;
 
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/connection/XConnection.hpp>
@@ -846,7 +847,7 @@ public:
 
      @see HandleKey
     */
-    static sal_uLong            PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
+    static ImplSVEvent *        PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent );
 
     /** Send mouse event
 
@@ -854,7 +855,7 @@ public:
      @param     pWin            Pointer to window to which the event is sent
      @param     pKeyEvent       Mouse event to send
     */
-    static sal_uLong            PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent );
+    static ImplSVEvent *        PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent );
 
 #if !HAVE_FEATURE_DESKTOP
     /** Send zoom event
@@ -863,7 +864,7 @@ public:
      @param     pWin            Pointer to window to which the event is sent
      @param     pZoomEvent      Zoom event to send
     */
-    static sal_uLong            PostZoomEvent( sal_uLong nEvent, Window *pWin, ZoomEvent* pZoomEvent );
+    static ImplSVEvent *        PostZoomEvent( sal_uLong nEvent, Window *pWin, ZoomEvent* pZoomEvent );
 
     /* Send scroll event
 
@@ -871,7 +872,7 @@ public:
      @param      pWin            Pointer to window to which the event is sent
      @param      pScrollEvent    Scroll event to send
     */
-    static sal_uLong            PostScrollEvent( sal_uLong nEvent, Window *pWin, ScrollEvent* pScrollEvent );
+    static ImplSVEvent *         PostScrollEvent( sal_uLong nEvent, Window *pWin, ScrollEvent* pScrollEvent );
 #endif
 
     /** Remove mouse and keypress events from a window... any also zoom and scroll events
@@ -892,23 +893,13 @@ public:
 
      @return the event ID used to post the event.
     */
-    static sal_uLong            PostUserEvent( const Link& rLink, void* pCaller = NULL );
-
-    /** Post a user event to the default window.
-
-     @param     rEventID        Reference to event ID to be posted
-     @param     rLink           Link to event callback function
-     @param     pCaller         Pointer to data sent to teh event by the caller. Optional.
-
-     @return true if there is a default window and the event could be posted to it successfully.
-    */
-    static bool                 PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL );
+    static ImplSVEvent * PostUserEvent( const Link& rLink, void* pCaller = NULL );
 
     /** Remove user event based on event ID
 
-     @param     nUserEvent      Numeric user event to remove
+     @param     nUserEvent      User event to remove
     */
-    static void                 RemoveUserEvent( sal_uLong nUserEvent );
+    static void                 RemoveUserEvent( ImplSVEvent * nUserEvent );
 
     /** Insert an idle handler into the application.
 
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 64d4732..b7cb9b3 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -41,6 +41,7 @@
 
 class VirtualDevice;
 struct ImplDelData;
+struct ImplSVEvent;
 struct ImplWinData;
 struct ImplFrameData;
 struct ImplCalcToTopData;
@@ -704,9 +705,8 @@ public:
     /*virtual*/ void    AddChildEventListener( const Link& rEventListener );
     /*virtual*/ void    RemoveChildEventListener( const Link& rEventListener );
 
-    sal_uLong               PostUserEvent( const Link& rLink, void* pCaller = NULL );
-    bool                PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL );
-    void                RemoveUserEvent( sal_uLong nUserEvent );
+    ImplSVEvent *       PostUserEvent( const Link& rLink, void* pCaller = NULL );
+    void                RemoveUserEvent( ImplSVEvent * nUserEvent );
 
     void                IncrementLockCount();
     void                DecrementLockCount();
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index ebaa44c..cc18b17 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -90,8 +90,8 @@ class OFieldExpressionControl : public TContainerListenerBase
     ::svt::ComboBoxControl*         m_pComboCell;
     sal_Int32                       m_nDataPos;
     sal_Int32                       m_nCurrentPos;
-    sal_uLong                           m_nPasteEvent;
-    sal_uLong                           m_nDeleteEvent;
+    ImplSVEvent *                   m_nPasteEvent;
+    ImplSVEvent *                   m_nDeleteEvent;
     OGroupsSortingDialog*           m_pParent;
     bool                            m_bIgnoreEvent;
 
diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index 9bd85c0..19bfe18 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -101,8 +101,8 @@ private:
     ::Window* mpWindow;
     sal_Int32 mnFocusedIndex;
     bool mbModelChangeLocked;
-    sal_uLong mnUpdateChildrenUserEventId;
-    sal_uLong mnSelectionChangeUserEventId;
+    ImplSVEvent * mnUpdateChildrenUserEventId;
+    ImplSVEvent * mnSelectionChangeUserEventId;
 
     void UpdateChildren (void);
 };
diff --git a/sd/source/ui/annotations/annotationmanagerimpl.hxx b/sd/source/ui/annotations/annotationmanagerimpl.hxx
index 4ac5997..5636c5d 100644
--- a/sd/source/ui/annotations/annotationmanagerimpl.hxx
+++ b/sd/source/ui/annotations/annotationmanagerimpl.hxx
@@ -124,7 +124,7 @@ private:
     ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > mxSelectedAnnotation;
 
     bool mbShowAnnotations;
-    sal_uLong mnUpdateTagsEvent;
+    ImplSVEvent * mnUpdateTagsEvent;
     Font maFont;
 };
 
diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx
index 8006922..869ae81 100644
--- a/sd/source/ui/annotations/annotationtag.hxx
+++ b/sd/source/ui/annotations/annotationtag.hxx
@@ -84,7 +84,7 @@ private:
     int                                             mnIndex;
     const Font&                                     mrFont;
     Size                                            maSize;
-    sal_uLong                                           mnClosePopupEvent;
+    ImplSVEvent *                                   mnClosePopupEvent;
     ::Window*                                       mpListenWindow;
     Point                                           maMouseDownPos;
 };
diff --git a/sd/source/ui/dlg/filedlg.cxx b/sd/source/ui/dlg/filedlg.cxx
index 452cc8f..daf2aca 100644
--- a/sd/source/ui/dlg/filedlg.cxx
+++ b/sd/source/ui/dlg/filedlg.cxx
@@ -54,7 +54,7 @@ private:
     css::uno::Reference< css::ui::dialogs::XFilePickerControlAccess >   mxControlAccess;
 
     css::uno::Reference< css::media::XPlayer > mxPlayer;
-    sal_uLong                       mnPlaySoundEvent;
+    ImplSVEvent *               mnPlaySoundEvent;
     bool                        mbUsableSelection;
     bool                        mbLabelPlaying;
 
diff --git a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx
index f473dae..33c5479 100644
--- a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx
+++ b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.hxx
@@ -31,6 +31,8 @@
 
 #include <boost/shared_ptr.hpp>
 
+struct ImplSVEvent;
+
 namespace sd { namespace framework {
 
 class ConfigurationController;
@@ -103,7 +105,7 @@ private:
         so that a pending user event can be removed when the queue processor
         is destroyed.
     */
-    sal_uIntPtr mnUserEventId;
+    ImplSVEvent * mnUserEventId;
 
     ::com::sun::star::uno::Reference<
         ::com::sun::star::drawing::framework::XConfiguration> mxConfiguration;
diff --git a/sd/source/ui/inc/slideshow.hxx b/sd/source/ui/inc/slideshow.hxx
index 20324f5..6f16ce0 100644
--- a/sd/source/ui/inc/slideshow.hxx
+++ b/sd/source/ui/inc/slideshow.hxx
@@ -51,6 +51,7 @@ class Rectangle;
 class Window;
 class SfxRequest;
 class WorkWindow;
+struct ImplSVEvent;
 
 // TODO: Remove
 #define PAGE_NO_END         65535
@@ -216,7 +217,7 @@ private:
     ViewShellBase* mpCurrentViewShellBase;
     ViewShellBase* mpFullScreenViewShellBase;
     FrameView* mpFullScreenFrameView;
-    sal_Int32   mnInPlaceConfigEvent;
+    ImplSVEvent * mnInPlaceConfigEvent;
 };
 
 namespace slideshowhelp
diff --git a/sd/source/ui/inc/view/viewoverlaymanager.hxx b/sd/source/ui/inc/view/viewoverlaymanager.hxx
index 3c04ed8..1259690 100644
--- a/sd/source/ui/inc/view/viewoverlaymanager.hxx
+++ b/sd/source/ui/inc/view/viewoverlaymanager.hxx
@@ -50,7 +50,7 @@ public:
 
 private:
     ViewShellBase& mrBase;
-    sal_uLong mnUpdateTagsEvent;
+    ImplSVEvent * mnUpdateTagsEvent;
 
     ViewTagVector   maTagVector;
 };
diff --git a/sd/source/ui/presenter/CanvasUpdateRequester.hxx b/sd/source/ui/presenter/CanvasUpdateRequester.hxx
index 04822d8..78bfe2b 100644
--- a/sd/source/ui/presenter/CanvasUpdateRequester.hxx
+++ b/sd/source/ui/presenter/CanvasUpdateRequester.hxx
@@ -29,6 +29,8 @@
 #include <tools/link.hxx>
 #include <vector>
 
+struct ImplSVEvent;
+
 namespace sd { namespace presenter {
 
 /** Each UpdateRequester handles update requests (calls to
@@ -59,7 +61,7 @@ private:
     static RequesterMap maRequesterMap;
 
     css::uno::Reference<css::rendering::XSpriteCanvas> mxCanvas;
-    sal_uLong mnUserEventId;
+    ImplSVEvent * mnUserEventId;
     bool mbUpdateFlag;
     DECL_LINK(Callback, void*);
 };
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.hxx b/sd/source/ui/slideshow/SlideShowRestarter.hxx
index da82e51..05d8fe6 100644
--- a/sd/source/ui/slideshow/SlideShowRestarter.hxx
+++ b/sd/source/ui/slideshow/SlideShowRestarter.hxx
@@ -59,7 +59,7 @@ public:
     void Restart (bool bForce);
 
 private:
-    sal_Int32 mnEventId;
+    ImplSVEvent * mnEventId;
     ::rtl::Reference<SlideShow> mpSlideShow;
     ViewShellBase* mpViewShellBase;
     ::boost::shared_ptr<SlideShowRestarter> mpSelf;
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index de55c65..3f816c0 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -539,7 +539,6 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation,
 , msVerb( "Verb" )
 , mnEndShowEvent(0)
 , mnContextMenuEvent(0)
-, mnUpdateEvent(0)
 , mxPresentation( xPresentation )
 {
     if( mpViewShell )
@@ -622,12 +621,6 @@ void SAL_CALL SlideshowImpl::disposing()
 
     maUpdateTimer.Stop();
 
-    if( mnUpdateEvent )
-    {
-        Application::RemoveUserEvent( mnUpdateEvent );
-        mnUpdateEvent = 0;
-    }
-
     removeShapeEvents();
 
     if( mxListenerProxy.is() )
@@ -1843,8 +1836,6 @@ IMPL_LINK_NOARG(SlideshowImpl, ReadyForNextInputHdl)
 */
 IMPL_LINK_NOARG(SlideshowImpl, updateHdl)
 {
-    mnUpdateEvent = 0;
-
     return updateSlideShow();
 }
 
diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx
index 73a481e1d..074b667 100644
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -400,9 +400,8 @@ private:
 
     ::std::auto_ptr<PaneHider> mpPaneHider;
 
-    sal_uLong   mnEndShowEvent;
-    sal_uLong   mnContextMenuEvent;
-    sal_Int32 mnUpdateEvent;
+    ImplSVEvent * mnEndShowEvent;
+    ImplSVEvent * mnContextMenuEvent;
 
     css::uno::Reference< css::presentation::XPresentation2 > mxPresentation;
     ::rtl::Reference< SlideShowListenerProxy > mxListenerProxy;
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index 6b14839..e2cde15 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -617,13 +617,9 @@ void Clipboard::DragFinished (sal_Int8 nDropAction)
 {
     if (mnDragFinishedUserEventId == 0)
     {
-        if ( ! Application::PostUserEvent(
-            mnDragFinishedUserEventId,
+        mnDragFinishedUserEventId = Application::PostUserEvent(
             LINK(this, Clipboard, ProcessDragFinished),
-            reinterpret_cast<void*>(nDropAction)))
-        {
-            mnDragFinishedUserEventId = 0;
-        }
+            reinterpret_cast<void*>(nDropAction));
     }
 }
 
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx
index bb922e5..e868070 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx
@@ -36,6 +36,7 @@ class Window;
 struct AcceptDropEvent;
 class DropTargetHelper;
 struct ExecuteDropEvent;
+struct ImplSVEvent;
 class Point;
 class SdPage;
 class Window;
@@ -137,7 +138,7 @@ private:
     ::boost::scoped_ptr<UndoContext> mpUndoContext;
 
     ::boost::scoped_ptr<SelectionObserver::Context> mpSelectionObserverContext;
-    sal_uLong mnDragFinishedUserEventId;
+    ImplSVEvent * mnDragFinishedUserEventId;
 
     void CreateSlideTransferable (
         ::Window* pWindow,
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index 476ba6a..e249a24 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -331,8 +331,8 @@ private:
     ::std::auto_ptr<LayouterLock> mpAsynchronousLayouterLock;
     ::std::auto_ptr<ViewShellManager::UpdateLock> mpViewShellManagerLock;
     SAL_WNODEPRECATED_DECLARATIONS_POP
-    sal_uLong mnPendingUpdateCall;
-    sal_uLong mnPendingSetValidCall;
+    ImplSVEvent * mnPendingUpdateCall;
+    ImplSVEvent * mnPendingSetValidCall;
     ToolBarRules maToolBarRules;
 
     OUString GetToolBarResourceName (const OUString& rsBaseName) const;
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index 9c17757..06d7c01 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 0b25cc5..21e3a30 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 ad0471b..1b17a3e 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 1c2b45d..d3ecd5d 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*);
 };
diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx
index b787c9c..13a1c3e 100644
--- a/svtools/source/contnr/imivctl.hxx
+++ b/svtools/source/contnr/imivctl.hxx
@@ -189,8 +189,8 @@ class SvxIconChoiceCtrl_Impl
     long                    nMaxBoundHeight;            // height of highest BoundRects
     sal_uInt16              nFlags;
     sal_uInt16              nCurTextDrawFlags;
-    sal_uLong               nUserEventAdjustScrBars;
-    sal_uLong               nUserEventShowCursor;
+    ImplSVEvent *           nUserEventAdjustScrBars;
+    ImplSVEvent *           nUserEventShowCursor;
     SvxIconChoiceCtrlEntry* pCurHighlightFrame;
     sal_Bool                bHighlightFramePressed;
     SvxIconChoiceCtrlEntry* pHead;                      // top left entry
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 34609f8..3ce62da 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -104,7 +104,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS
 
     nMostRight = -1;
     pMostRightEntry = 0;
-    nCurUserEvent = 0xffffffff;
+    nCurUserEvent = 0;
 
     bUpdateMode = true;
     bInVScrollHdl = false;
@@ -3336,7 +3336,7 @@ void SvImpLBox::FindMostRight_Impl( SvTreeListEntry* pParent, SvTreeListEntry* p
 void SvImpLBox::NotifyTabsChanged()
 {
     if( GetUpdateMode() && !(nFlags & F_IGNORE_CHANGED_TABS ) &&
-        nCurUserEvent == 0xffffffff )
+        nCurUserEvent == 0 )
     {
         nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpLBox,MyUserEvent),(void*)0);
     }
@@ -3354,7 +3354,7 @@ bool SvImpLBox::IsNowExpandable() const
 
 IMPL_LINK(SvImpLBox,MyUserEvent,void*, pArg )
 {
-    nCurUserEvent = 0xffffffff;
+    nCurUserEvent = 0;
     if( !pArg )
     {
         pView->Invalidate();
@@ -3372,10 +3372,10 @@ IMPL_LINK(SvImpLBox,MyUserEvent,void*, pArg )
 
 void SvImpLBox::StopUserEvent()
 {
-    if( nCurUserEvent != 0xffffffff )
+    if( nCurUserEvent != 0 )
     {
         Application::RemoveUserEvent( nCurUserEvent );
-        nCurUserEvent = 0xffffffff;
+        nCurUserEvent = 0;
     }
 }
 
diff --git a/svtools/source/control/asynclink.cxx b/svtools/source/control/asynclink.cxx
index cdc1888..57550e8 100644
--- a/svtools/source/control/asynclink.cxx
+++ b/svtools/source/control/asynclink.cxx
@@ -69,7 +69,7 @@ bAllowDoubles
         else
         {
             if( _pMutex ) _pMutex->acquire();
-            Application::PostUserEvent( _nEventId, STATIC_LINK( this, AsynchronLink, HandleCall), 0 );
+            _nEventId = Application::PostUserEvent( STATIC_LINK( this, AsynchronLink, HandleCall), 0 );
             if( _pMutex ) _pMutex->release();
         }
     }
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index 85a9540..a897aa3 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -135,7 +135,7 @@ private:
     long                nNextVerVisSize;
     long                nMostRight;
     sal_uLong               nVisibleCount;  // Anzahl Zeilen im Control
-    sal_uLong               nCurUserEvent; //-1 == kein Userevent amn Laufen
+    ImplSVEvent *       nCurUserEvent;
     short               nHorSBarHeight, nVerSBarWidth;
     sal_uInt16              nFlags;
     sal_uInt16              nCurTabPos;
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index f3124df..e002069 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -1234,8 +1234,7 @@ bool FmFilterNavigator::EditedEntry( SvTreeListEntry* pEntry, const OUString& rN
     if (aText.isEmpty())
     {
         // deleting the entry asynchron
-        sal_uLong nEvent;
-        PostUserEvent(nEvent, LINK(this, FmFilterNavigator, OnRemove), pEntry);
+        PostUserEvent(LINK(this, FmFilterNavigator, OnRemove), pEntry);
     }
     else
     {
diff --git a/svx/source/inc/delayedevent.hxx b/svx/source/inc/delayedevent.hxx
index 20eb2e2..9f4a12a 100644
--- a/svx/source/inc/delayedevent.hxx
+++ b/svx/source/inc/delayedevent.hxx
@@ -22,6 +22,7 @@
 
 #include <tools/link.hxx>
 
+struct ImplSVEvent;
 
 namespace svxform
 {
@@ -62,7 +63,7 @@ namespace svxform
 
     private:
         Link    m_aHandler;
-        sal_uLong   m_nEventId;
+        ImplSVEvent * m_nEventId;
 
     private:
         DECL_LINK( OnCall, void* );
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index 18b9a18..b76fc1e 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -434,7 +434,7 @@ namespace svxform
         SvTreeListEntry*        m_pRootEntry;
         SvTreeListEntry*        m_pEditEntry;
 
-        sal_uLong               nEditEvent;
+        ImplSVEvent *       nEditEvent;
 
         SELDATA_ITEMS       m_sdiState;
         Point               m_aTimerTriggered;      // die Position, an der der DropTimer angeschaltet wurde
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index 7279edf..906b9aa 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -103,11 +103,11 @@ class FmFormPage;
 struct FmLoadAction
 {
     FmFormPage* pPage;
-    sal_uLong       nEventId;
+    ImplSVEvent * nEventId;
     sal_uInt16  nFlags;
 
     FmLoadAction( ) : pPage( NULL ), nEventId( 0 ), nFlags( 0 ) { }
-    FmLoadAction( FmFormPage* _pPage, sal_uInt16 _nFlags, sal_uLong _nEventId )
+    FmLoadAction( FmFormPage* _pPage, sal_uInt16 _nFlags, ImplSVEvent * _nEventId )
         :pPage( _pPage ), nEventId( _nEventId ), nFlags( _nFlags )
     {
     }
@@ -183,8 +183,8 @@ class FmXFormShell   :public FmXFormShell_BASE
     std::vector<long> m_arrRelativeGridColumn;
 
     ::osl::Mutex    m_aMutex;
-    sal_uLong           m_nInvalidationEvent;
-    sal_uLong           m_nActivationEvent;
+    ImplSVEvent *   m_nInvalidationEvent;
+    ImplSVEvent *   m_nActivationEvent;
     ::std::queue< FmLoadAction >
                     m_aLoadingPages;
 
diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx
index a9ce1ba..86e2165 100644
--- a/svx/source/inc/fmvwimp.hxx
+++ b/svx/source/inc/fmvwimp.hxx
@@ -56,6 +56,7 @@ class FmFormShell;
 class Window;
 class OutputDevice;
 class SdrUnoObj;
+struct ImplSVEvent;
 
 namespace com { namespace sun { namespace star {
     namespace awt {
@@ -159,10 +160,10 @@ class FmXFormView : public ::cppu::WeakImplHelper3<
 
     FmFormObj*      m_pMarkedGrid;
     FmFormView*     m_pView;
-    sal_uIntPtr     m_nActivationEvent;
-    sal_uIntPtr     m_nErrorMessageEvent;   // event for an asynchronous error message. See also m_aAsyncError
-    sal_uIntPtr     m_nAutoFocusEvent;      // event for asynchronously setting the focus to a control
-    sal_uIntPtr     m_nControlWizardEvent;  // event for asynchronously setting the focus to a control
+    ImplSVEvent *   m_nActivationEvent;
+    ImplSVEvent *   m_nErrorMessageEvent;   // event for an asynchronous error message. See also m_aAsyncError
+    ImplSVEvent *   m_nAutoFocusEvent;      // event for asynchronously setting the focus to a control
+    ImplSVEvent *   m_nControlWizardEvent;  // event for asynchronously setting the focus to a control
 
     ::com::sun::star::sdb::SQLErrorEvent
                     m_aAsyncError;          // error event which is to be displayed asyn. See m_nErrorMessageEvent.
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 438cffa..3d3cda9 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -58,6 +58,7 @@ namespace sw { namespace sidebarwindows {
 class SwSidebarItem;
 class SwFrm;
 class Window;
+struct ImplSVEvent;
 
 #define SORT_POS    1
 #define SORT_AUTHOR 2
@@ -143,7 +144,7 @@ class SwPostItMgr: public SfxListener
         SwEditWin*                      mpEditWin;
         std::list< SwSidebarItem*>      mvPostItFlds;
         std::vector<SwPostItPageItem*>  mPages;
-        sal_uLong                           mnEventId;
+        ImplSVEvent *                   mnEventId;
         bool                            mbWaitingForCalcRects;
         sw::sidebarwindows::SwSidebarWin* mpActivePostIt;
         bool                            mbLayout;
diff --git a/sw/inc/SidebarWin.hxx b/sw/inc/SidebarWin.hxx
index 0144a39..541772d 100644
--- a/sw/inc/SidebarWin.hxx
+++ b/sw/inc/SidebarWin.hxx
@@ -205,7 +205,7 @@ class SwSidebarWin : public Window
         SwView&         mrView;
         const SwPostItBits nFlags;
 
-        sal_uLong           mnEventId;
+        ImplSVEvent *   mnEventId;
 
         OutlinerView*   mpOutlinerView;
         Outliner*       mpOutliner;
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 2b0bf01..cd97cad 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -47,6 +47,7 @@ struct SwHTMLFootEndNote_Impl;
 class HTMLTableCnts;
 struct SwPendingStack;
 class SvxCSS1PropertyInfo;
+struct ImplSVEvent;
 
 #define HTML_PARSPACE (MM50)
 #define HTML_CJK_PARSPACE (MM50/2)
@@ -406,7 +407,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient
 
     sal_uInt32  aFontHeights[7];    // die Font-Hoehen 1-7
     sal_uInt32  nScriptStartLineNr; // Zeilennummer eines Script-Blocks
-    sal_uLong       nEventId;
+    ImplSVEvent * nEventId;
 
     sal_uInt16  nBaseFontStMin;
     sal_uInt16  nFontStMin;
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index d424479..3743415 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -113,7 +113,7 @@ private:
     TopWindowListenerMultiplexer        maTopWindowListeners;
 
     CallbackArray                       maCallbackEvents;
-    sal_uLong                               mnCallbackEventId;
+    ImplSVEvent *                       mnCallbackEventId;
 
 public:
     bool                                mbDisposing             : 1;
diff --git a/vcl/inc/toolbox.h b/vcl/inc/toolbox.h
index 43c0c91..9056ec5 100644
--- a/vcl/inc/toolbox.h
+++ b/vcl/inc/toolbox.h
@@ -139,7 +139,7 @@ struct ImplToolBoxPrivateData
     // the optional custom menu
     PopupMenu*  mpMenu;
     sal_uInt16      maMenuType;
-    sal_uIntPtr       mnEventId;
+    ImplSVEvent *   mnEventId;
 
     // called when menu button is clicked and before the popup menu is executed
     Link        maMenuButtonHdl;
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 0895836..d42eeb2 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -140,8 +140,8 @@ struct ImplFrameData
     sal_Int32           mnDPIY;             // Original Screen Resolution
     ImplMapRes          maMapUnitRes;       // for LogicUnitToPixel
     sal_uIntPtr         mnAllSaveBackSize;  // size of all bitmaps of saved backgrounds
-    sal_uIntPtr         mnFocusId;          // FocusId for PostUserLink
-    sal_uIntPtr         mnMouseMoveId;      // MoveId for PostUserLink
+    ImplSVEvent *       mnFocusId;          // FocusId for PostUserLink
+    ImplSVEvent *       mnMouseMoveId;      // MoveId for PostUserLink
     long                mnLastMouseX;       // last x mouse position
     long                mnLastMouseY;       // last y mouse position
     long                mnBeforeLastMouseX; // last but one x mouse position
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 8a7a8b4..5177aa1 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -156,7 +156,7 @@ struct ImplPostEventData
 {
     sal_uLong           mnEvent;
     const Window*   mpWin;
-    sal_uLong           mnEventId;
+    ImplSVEvent *   mnEventId;
     KeyEvent        maKeyEvent;
     MouseEvent      maMouseEvent;
     ZoomEvent       maZoomEvent;
@@ -712,16 +712,16 @@ bool Application::HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent
     return bProcessed;
 }
 
-sal_uLong Application::PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent )
+ImplSVEvent * Application::PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent )
 {
     const SolarMutexGuard aGuard;
-    sal_uLong               nEventId = 0;
+    ImplSVEvent * nEventId = 0;
 
     if( pWin && pKeyEvent )
     {
         ImplPostEventData* pPostEventData = new ImplPostEventData( nEvent, pWin, *pKeyEvent );
 
-        PostUserEvent( nEventId,
+        nEventId = PostUserEvent(
                        STATIC_LINK( NULL, Application, PostEventHandler ),
                        pPostEventData );
 
@@ -737,10 +737,10 @@ sal_uLong Application::PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* p
     return nEventId;
 }
 
-sal_uLong Application::PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent )
+ImplSVEvent * Application::PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent )
 {
     const SolarMutexGuard aGuard;
-    sal_uLong               nEventId = 0;
+    ImplSVEvent * nEventId = 0;
 
     if( pWin && pMouseEvent )
     {
@@ -754,7 +754,7 @@ sal_uLong Application::PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEven
 
         ImplPostEventData* pPostEventData = new ImplPostEventData( nEvent, pWin, aTransformedEvent );
 
-        PostUserEvent( nEventId,
+        nEventId = PostUserEvent(
                        STATIC_LINK( NULL, Application, PostEventHandler ),
                        pPostEventData );
 
@@ -772,10 +772,10 @@ sal_uLong Application::PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEven
 
 #if !HAVE_FEATURE_DESKTOP
 
-sal_uLong Application::PostZoomEvent( sal_uLong nEvent, Window *pWin, ZoomEvent* pZoomEvent )
+ImplSVEvent * Application::PostZoomEvent( sal_uLong nEvent, Window *pWin, ZoomEvent* pZoomEvent )
 {
     const SolarMutexGuard aGuard;
-    sal_uLong               nEventId = 0;
+    ImplSVEvent * nEventId = 0;
 
     if( pWin && pZoomEvent )
     {
@@ -788,7 +788,7 @@ sal_uLong Application::PostZoomEvent( sal_uLong nEvent, Window *pWin, ZoomEvent*
 
         ImplPostEventData* pPostEventData = new ImplPostEventData( nEvent, pWin, aTransformedEvent );
 
-        PostUserEvent( nEventId,
+        nEventId = PostUserEvent(
                        STATIC_LINK( NULL, Application, PostEventHandler ),
                        pPostEventData );
 
@@ -804,16 +804,16 @@ sal_uLong Application::PostZoomEvent( sal_uLong nEvent, Window *pWin, ZoomEvent*
     return nEventId;
 }
 
-sal_uLong Application::PostScrollEvent( sal_uLong nEvent, Window *pWin, ScrollEvent* pScrollEvent )
+ImplSVEvent * Application::PostScrollEvent( sal_uLong nEvent, Window *pWin, ScrollEvent* pScrollEvent )
 {
     const SolarMutexGuard aGuard;
-    sal_uLong               nEventId = 0;
+    ImplSVEvent * nEventId = 0;
 
     if( pWin && pScrollEvent )
     {
         ImplPostEventData* pPostEventData = new ImplPostEventData( nEvent, pWin, *pScrollEvent );
 
-        PostUserEvent( nEventId,
+        nEventId = PostUserEvent(
                        STATIC_LINK( NULL, Application, PostEventHandler ),
                        pPostEventData );
 
@@ -837,7 +837,7 @@ IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
     ImplPostEventData*  pData = static_cast< ImplPostEventData * >( pCallData );
     const void*         pEventData;
     sal_uLong               nEvent;
-    const sal_uLong         nEventId = pData->mnEventId;
+    ImplSVEvent * const nEventId = pData->mnEventId;
 
     switch( pData->mnEvent )
     {
@@ -924,51 +924,40 @@ void Application::RemoveMouseAndKeyEvents( Window* pWin )
     }
 }
 
-sal_uLong Application::PostUserEvent( const Link& rLink, void* pCaller )
-{
-    sal_uLong nEventId;
-    PostUserEvent( nEventId, rLink, pCaller );
-    return nEventId;
-}
-
-bool Application::PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller )
+ImplSVEvent * Application::PostUserEvent( const Link& rLink, void* pCaller )
 {
     ImplSVEvent* pSVEvent = new ImplSVEvent;
     pSVEvent->mpData    = pCaller;
     pSVEvent->mpLink    = new Link( rLink );
     pSVEvent->mpWindow  = NULL;
     pSVEvent->mbCall    = true;
-    rEventId = (sal_uLong)pSVEvent;
     Window* pDefWindow = ImplGetDefaultWindow();
-    if ( pDefWindow && pDefWindow->ImplGetFrame()->PostEvent( pSVEvent ) )
-        return true;
-    else
+    if ( pDefWindow == 0 || !pDefWindow->ImplGetFrame()->PostEvent( pSVEvent ) )
     {
-        rEventId = 0;
+        delete pSVEvent->mpLink;
         delete pSVEvent;
-        return false;
+        pSVEvent = 0;
     }
+    return pSVEvent;
 }
 
-void Application::RemoveUserEvent( sal_uLong nUserEvent )
+void Application::RemoveUserEvent( ImplSVEvent * nUserEvent )
 {
     if(nUserEvent)
     {
-        ImplSVEvent* pSVEvent = (ImplSVEvent*)nUserEvent;
-
-        DBG_ASSERT( !pSVEvent->mpWindow,
+        DBG_ASSERT( !nUserEvent->mpWindow,
                     "Application::RemoveUserEvent(): Event is send to a window" );
-        DBG_ASSERT( pSVEvent->mbCall,
+        DBG_ASSERT( nUserEvent->mbCall,
                     "Application::RemoveUserEvent(): Event is already removed" );
 
-        if ( pSVEvent->mpWindow )
+        if ( nUserEvent->mpWindow )
         {
-            if( ! pSVEvent->maDelData.IsDead() )
-                pSVEvent->mpWindow->ImplRemoveDel( &(pSVEvent->maDelData) );
-            pSVEvent->mpWindow = NULL;
+            if( ! nUserEvent->maDelData.IsDead() )
+                nUserEvent->mpWindow->ImplRemoveDel( &(nUserEvent->maDelData) );
+            nUserEvent->mpWindow = NULL;
         }
 
-        pSVEvent->mbCall = false;
+        nUserEvent->mbCall = false;
     }
 }
 
diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx
index 85fe63c..37d8ef8 100644
--- a/vcl/source/helper/threadex.cxx
+++ b/vcl/source/helper/threadex.cxx
@@ -60,7 +60,7 @@ long SolarThreadExecutor::impl_execute( const TimeValue* _pTimeout )
         osl_resetCondition( m_aStart );
         osl_resetCondition( m_aFinish );
         sal_uLong nSolarMutexCount = Application::ReleaseSolarMutex();
-        sal_uLong nEvent = Application::PostUserEvent( LINK( this, SolarThreadExecutor, worker ) );
+        ImplSVEvent * nEvent = Application::PostUserEvent( LINK( this, SolarThreadExecutor, worker ) );
         if ( osl_cond_result_timeout == osl_waitCondition( m_aStart, _pTimeout ) )
         {
             m_bTimeout = true;
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index bcffef5..93014d3 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -47,7 +47,7 @@ private:
     Point           maDockPos;
     Rectangle       maDockRect;
     bool            mbInMove;
-    sal_uLong           mnLastUserEvent;
+    ImplSVEvent *   mnLastUserEvent;
 
     DECL_LINK(DockingHdl, void *);
     DECL_LINK(DockTimerHdl, void *);
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 72ecded..e1276fc 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -63,7 +63,7 @@ private:
     Point           maDockPos;
     Rectangle       maDockRect;
     bool            mbInMove;
-    sal_uLong           mnLastUserEvent;
+    ImplSVEvent *   mnLastUserEvent;
 
     DECL_LINK(DockingHdl, void *);
     DECL_LINK(DockTimerHdl, void *);
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 56bd19a..5163b51 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -577,7 +577,7 @@ void FloatingWindow::ImplCallPopupModeEnd()
 
     // call Handler asyncron.
     if ( !mnPostId )
-        Application::PostUserEvent( mnPostId, LINK( this, FloatingWindow, ImplEndPopupModeHdl ) );
+        mnPostId = Application::PostUserEvent( LINK( this, FloatingWindow, ImplEndPopupModeHdl ) );
 }
 
 void FloatingWindow::PopupModeEnd()
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index b06a9a5..57b9121 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1132,7 +1132,7 @@ void Menu::ImplSelect()
     // call select
     ImplSVData* pSVData = ImplGetSVData();
     pSVData->maAppData.mpActivePopupMenu = NULL;        // if new execute in select()
-    Application::PostUserEvent( nEventId, LINK( this, Menu, ImplCallSelect ) );
+    nEventId = Application::PostUserEvent( LINK( this, Menu, ImplCallSelect ) );
 }
 
 void Menu::Select()
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index f70d25c..eb141a1 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -85,7 +85,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
             if ( !pWindow->ImplGetFrameData()->mnFocusId )
             {
                 pWindow->ImplGetFrameData()->mbStartFocusState = true;
-                Application::PostUserEvent( pWindow->ImplGetFrameData()->mnFocusId, LINK( pWindow->ImplGetFrameWindow(), Window, ImplAsyncFocusHdl ) );
+                pWindow->ImplGetFrameData()->mnFocusId = Application::PostUserEvent( LINK( pWindow->ImplGetFrameWindow(), Window, ImplAsyncFocusHdl ) );
             }
             break;
 
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 6ca7338..a12de7b 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4979,7 +4979,7 @@ bool ToolBox::ImplOpenItem( KeyCode aKeyCode )
             return bRet;
 
         UpdateCustomMenu();
-        Application::PostUserEvent( mpData->mnEventId, LINK( this, ToolBox, ImplCallExecuteCustomMenu ) );
+        mpData->mnEventId = Application::PostUserEvent( LINK( this, ToolBox, ImplCallExecuteCustomMenu ) );
     }
     else if( mnHighItemId &&  ImplGetItem( mnHighItemId ) &&
         (ImplGetItem( mnHighItemId )->mnBits & TIB_DROPDOWN) )
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index ea9a1fa..ba4e866 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -2050,7 +2050,7 @@ void ToolBox::ExecuteCustomMenu()
         // handle custom menu asynchronously
         // to avoid problems if the toolbox is closed during menu execute
         UpdateCustomMenu();
-        Application::PostUserEvent( mpData->mnEventId, LINK( this, ToolBox, ImplCallExecuteCustomMenu ) );
+        mpData->mnEventId = Application::PostUserEvent( LINK( this, ToolBox, ImplCallExecuteCustomMenu ) );
     }
 }
 
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index ed5e018..53ab027 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3869,7 +3869,7 @@ void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, bool bModChanged )
 void Window::ImplGenerateMouseMove()
 {
     if ( !mpWindowImpl->mpFrameData->mnMouseMoveId )
-        Application::PostUserEvent( mpWindowImpl->mpFrameData->mnMouseMoveId, LINK( mpWindowImpl->mpFrameWindow, Window, ImplGenerateMouseMoveHdl ) );
+        mpWindowImpl->mpFrameData->mnMouseMoveId = Application::PostUserEvent( LINK( mpWindowImpl->mpFrameWindow, Window, ImplGenerateMouseMoveHdl ) );
 }
 
 IMPL_LINK_NOARG(Window, ImplGenerateMouseMoveHdl)
@@ -5242,51 +5242,38 @@ void Window::RemoveChildEventListener( const Link& rEventListener )
     mpWindowImpl->maChildEventListeners.removeListener( rEventListener );
 }
 
-sal_uLong Window::PostUserEvent( const Link& rLink, void* pCaller )
+ImplSVEvent * Window::PostUserEvent( const Link& rLink, void* pCaller )
 {
-    sal_uLong nEventId;
-    PostUserEvent( nEventId, rLink, pCaller );
-    return nEventId;
-}
-
-bool Window::PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller )
-{
-
     ImplSVEvent* pSVEvent = new ImplSVEvent;
     pSVEvent->mpData    = pCaller;
     pSVEvent->mpLink    = new Link( rLink );
     pSVEvent->mpWindow  = this;
     pSVEvent->mbCall    = true;
     ImplAddDel( &(pSVEvent->maDelData) );
-    rEventId = (sal_uLong)pSVEvent;
-    if ( mpWindowImpl->mpFrame->PostEvent( pSVEvent ) )
-        return true;
-    else
+    if ( !mpWindowImpl->mpFrame->PostEvent( pSVEvent ) )
     {
-        rEventId = 0;
         ImplRemoveDel( &(pSVEvent->maDelData) );
+        delete pSVEvent->mpLink;
         delete pSVEvent;
-        return false;
+        pSVEvent = 0;
     }
+    return pSVEvent;
 }
 
-void Window::RemoveUserEvent( sal_uLong nUserEvent )
+void Window::RemoveUserEvent( ImplSVEvent * nUserEvent )
 {
-
-    ImplSVEvent* pSVEvent = (ImplSVEvent*)nUserEvent;
-
-    DBG_ASSERT( pSVEvent->mpWindow == this,
+    DBG_ASSERT( nUserEvent->mpWindow == this,
                 "Window::RemoveUserEvent(): Event doesn't send to this window or is already removed" );
-    DBG_ASSERT( pSVEvent->mbCall,
+    DBG_ASSERT( nUserEvent->mbCall,
                 "Window::RemoveUserEvent(): Event is already removed" );
 
-    if ( pSVEvent->mpWindow )
+    if ( nUserEvent->mpWindow )
     {
-        pSVEvent->mpWindow->ImplRemoveDel( &(pSVEvent->maDelData) );
-        pSVEvent->mpWindow = NULL;
+        nUserEvent->mpWindow->ImplRemoveDel( &(nUserEvent->maDelData) );
+        nUserEvent->mpWindow = NULL;
     }
 
-    pSVEvent->mbCall = false;
+    nUserEvent->mbCall = false;
 }
 
 bool Window::IsLocked( bool bChildren ) const
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 769e1d5..93ff18b 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1743,7 +1743,7 @@ static void ImplHandleGetFocus( Window* pWindow )
     if ( !pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId )
     {
         pWindow->ImplGetWindowImpl()->mpFrameData->mbStartFocusState = !pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus;
-        Application::PostUserEvent( pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId, LINK( pWindow, Window, ImplAsyncFocusHdl ) );
+        pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId = Application::PostUserEvent( LINK( pWindow, Window, ImplAsyncFocusHdl ) );
         Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
         if ( pFocusWin && pFocusWin->ImplGetWindowImpl()->mpCursor )
             pFocusWin->ImplGetWindowImpl()->mpCursor->ImplShow();
@@ -1780,7 +1780,7 @@ static void ImplHandleLoseFocus( Window* pWindow )
     if ( !pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId )
     {
         pWindow->ImplGetWindowImpl()->mpFrameData->mbStartFocusState = !pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus;
-        Application::PostUserEvent( pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId, LINK( pWindow, Window, ImplAsyncFocusHdl ) );
+        pWindow->ImplGetWindowImpl()->mpFrameData->mnFocusId = Application::PostUserEvent( LINK( pWindow, Window, ImplAsyncFocusHdl ) );
     }
 
     Window* pFocusWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx
index 945d858..b0d5e8e 100644
--- a/vcl/unx/generic/app/i18n_status.cxx
+++ b/vcl/unx/generic/app/i18n_status.cxx
@@ -87,7 +87,7 @@ class XIMStatusWindow : public StatusWindow
     // for delayed showing
     bool                    m_bDelayedShow;
     I18NStatus::ShowReason  m_eDelayedReason;
-    sal_uLong                   m_nDelayedEvent;
+    ImplSVEvent *           m_nDelayedEvent;
     // for toggling
     bool                    m_bOn;
 


More information about the Libreoffice-commits mailing list