diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-06-19 12:43:10 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-06-20 14:44:04 +0200 |
commit | c83a393ffe5c80afd18f215f70af3e152d51a6bd (patch) | |
tree | 59a9e002dd4ec25a82edae90881cdb090eb73c3e | |
parent | 43a8d203d816321dccbaec38b6e8307f98f0249d (diff) |
Clean up how nStateVal is smuggled in
Change-Id: Ib27bce3d6d20dd8ea81dc51f1501774cd313b5da
-rw-r--r-- | vcl/unx/generic/app/sm.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx index 843e0394d9fc..5a05c8db6c46 100644 --- a/vcl/unx/generic/app/sm.cxx +++ b/vcl/unx/generic/app/sm.cxx @@ -241,10 +241,10 @@ bool SessionManagerClient::checkDocumentsSaved() return bDocSaveDone; } -IMPL_STATIC_LINK( SessionManagerClient, SaveYourselfHdl, void*, EMPTYARG ) +IMPL_STATIC_LINK_NOINSTANCE( SessionManagerClient, SaveYourselfHdl, void*, pStateVal ) { - //decode argument smuggled in by abusing pThis member of SessionManagerClient - sal_uIntPtr nStateVal = (sal_uIntPtr)pThis; + // Decode argument smuggled in as void*: + sal_uIntPtr nStateVal = reinterpret_cast< sal_uIntPtr >(pStateVal); Bool shutdown = nStateVal != 0; SAL_INFO("vcl.sm", "posting save documents event shutdown = " << (shutdown ? "true" : "false" )); @@ -340,9 +340,9 @@ void SessionManagerClient::SaveYourselfProc( SessionManagerClient::saveDone(); return; } - //Smuggle argument in by abusing pThis member of SessionManagerClient - sal_uIntPtr nStateVal = shutdown ? 0xffffffff : 0x0; - Application::PostUserEvent( STATIC_LINK( (void*)nStateVal, SessionManagerClient, SaveYourselfHdl ) ); + // Smuggle argument in as void*: + sal_uIntPtr nStateVal = shutdown; + Application::PostUserEvent( STATIC_LINK( 0, SessionManagerClient, SaveYourselfHdl ), reinterpret_cast< void * >(nStateVal) ); SAL_INFO("vcl.sm", "waiting for save yourself event to be processed" ); } |