From c83a393ffe5c80afd18f215f70af3e152d51a6bd Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 19 Jun 2012 12:43:10 +0200 Subject: Clean up how nStateVal is smuggled in Change-Id: Ib27bce3d6d20dd8ea81dc51f1501774cd313b5da --- vcl/unx/generic/app/sm.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'vcl') 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" ); } -- cgit