diff options
author | Mikhail Voytenko <mav@openoffice.org> | 2011-01-14 12:13:45 +0100 |
---|---|---|
committer | Mikhail Voytenko <mav@openoffice.org> | 2011-01-14 12:13:45 +0100 |
commit | 1a64ddfe1d1deeb1779dfa73a4fc8aad089dc968 (patch) | |
tree | b5c0282fdbd2a35206ba10775baafedc0dda2de2 /extensions/source/plugin/unx | |
parent | 41fb6b154197078bf0abe89c1279cc6ce0d3e0ed (diff) |
removetooltypes01: #i112600# remove tooltypes from extensions
Diffstat (limited to 'extensions/source/plugin/unx')
-rw-r--r-- | extensions/source/plugin/unx/mediator.cxx | 54 | ||||
-rw-r--r-- | extensions/source/plugin/unx/npnapi.cxx | 74 | ||||
-rw-r--r-- | extensions/source/plugin/unx/nppapi.cxx | 68 | ||||
-rw-r--r-- | extensions/source/plugin/unx/npwrap.cxx | 12 | ||||
-rw-r--r-- | extensions/source/plugin/unx/plugcon.cxx | 66 | ||||
-rw-r--r-- | extensions/source/plugin/unx/sysplug.cxx | 2 | ||||
-rw-r--r-- | extensions/source/plugin/unx/unxmgr.cxx | 4 |
7 files changed, 140 insertions, 140 deletions
diff --git a/extensions/source/plugin/unx/mediator.cxx b/extensions/source/plugin/unx/mediator.cxx index 9ecf0f48d9f8..593c100f4267 100644 --- a/extensions/source/plugin/unx/mediator.cxx +++ b/extensions/source/plugin/unx/mediator.cxx @@ -56,7 +56,7 @@ Mediator::~Mediator() m_pListener = NULL; if( m_bValid ) { - ULONG aHeader[3]; + sal_uLong aHeader[3]; aHeader[0] = 0; aHeader[1] = 0; aHeader[2] = MEDIATOR_MAGIC; @@ -75,7 +75,7 @@ Mediator::~Mediator() } -ULONG Mediator::SendMessage( ULONG nBytes, const char* pBytes, ULONG nMessageID ) +sal_uLong Mediator::SendMessage( sal_uLong nBytes, const char* pBytes, sal_uLong nMessageID ) { if( ! m_pListener ) return 0; @@ -91,26 +91,26 @@ ULONG Mediator::SendMessage( ULONG nBytes, const char* pBytes, ULONG nMessageID if( ! m_bValid ) return nMessageID; - ULONG* pBuffer = new ULONG[ (nBytes/sizeof(ULONG)) + 4 ]; + sal_uLong* pBuffer = new sal_uLong[ (nBytes/sizeof(sal_uLong)) + 4 ]; pBuffer[ 0 ] = nMessageID; pBuffer[ 1 ] = nBytes; pBuffer[ 2 ] = MEDIATOR_MAGIC; memcpy( &pBuffer[3], pBytes, (size_t)nBytes ); - write( m_nSocket, pBuffer, nBytes + 3*sizeof( ULONG ) ); + write( m_nSocket, pBuffer, nBytes + 3*sizeof( sal_uLong ) ); delete [] pBuffer; return nMessageID; } -BOOL Mediator::WaitForMessage( ULONG nTimeOut ) +sal_Bool Mediator::WaitForMessage( sal_uLong nTimeOut ) { if( ! m_pListener ) - return FALSE; + return sal_False; size_t nItems = m_aMessageQueue.size(); if( ! nTimeOut && nItems > 0 ) - return TRUE; + return sal_True; TimeValue aValue; aValue.Seconds = nTimeOut/1000; @@ -121,12 +121,12 @@ BOOL Mediator::WaitForMessage( ULONG nTimeOut ) m_aNewMessageCdtn.wait( & aValue ); m_aNewMessageCdtn.reset(); if( nTimeOut && m_aMessageQueue.size() == nItems ) - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } -MediatorMessage* Mediator::WaitForAnswer( ULONG nMessageID ) +MediatorMessage* Mediator::WaitForAnswer( sal_uLong nMessageID ) { nMessageID &= 0x00ffffff; while( m_pListener ) @@ -136,7 +136,7 @@ MediatorMessage* Mediator::WaitForAnswer( ULONG nMessageID ) for( size_t i = 0; i < m_aMessageQueue.size(); i++ ) { MediatorMessage* pMessage = m_aMessageQueue[ i ]; - ULONG nID = pMessage->m_nID; + sal_uLong nID = pMessage->m_nID; if( ( nID & 0xff000000 ) && ( ( nID & 0x00ffffff ) == nMessageID ) ) { @@ -150,7 +150,7 @@ MediatorMessage* Mediator::WaitForAnswer( ULONG nMessageID ) return NULL; } -MediatorMessage* Mediator::GetNextMessage( BOOL bWait ) +MediatorMessage* Mediator::GetNextMessage( sal_Bool bWait ) { while( m_pListener ) { @@ -175,9 +175,9 @@ MediatorMessage* Mediator::GetNextMessage( BOOL bWait ) return NULL; } -MediatorMessage* Mediator::TransactMessage( ULONG nBytes, char* pBytes ) +MediatorMessage* Mediator::TransactMessage( sal_uLong nBytes, char* pBytes ) { - ULONG nID = SendMessage( nBytes, pBytes ); + sal_uLong nID = SendMessage( nBytes, pBytes ); return WaitForAnswer( nID ); } @@ -195,7 +195,7 @@ void MediatorListener::run() bool bRun = true; while( schedule() && m_pMediator && bRun ) { - ULONG nHeader[ 3 ]; + sal_uLong nHeader[ 3 ]; int nBytes; if( m_pMediator && ( nBytes = read( m_pMediator->m_nSocket, nHeader, sizeof( nHeader ) ) ) == sizeof( nHeader ) && nHeader[2] == MEDIATOR_MAGIC) @@ -203,7 +203,7 @@ void MediatorListener::run() if( nHeader[ 0 ] == 0 && nHeader[ 1 ] == 0 ) return; char* pBuffer = new char[ nHeader[ 1 ] ]; - if( m_pMediator && (ULONG)read( m_pMediator->m_nSocket, pBuffer, nHeader[ 1 ] ) == nHeader[ 1 ] ) + if( m_pMediator && (sal_uLong)read( m_pMediator->m_nSocket, pBuffer, nHeader[ 1 ] ) == nHeader[ 1 ] ) { ::vos::OGuard aMyGuard( m_aMutex ); { @@ -243,25 +243,25 @@ void MediatorListener::onTerminated() delete this; } -ULONG MediatorMessage::ExtractULONG() +sal_uLong MediatorMessage::ExtractULONG() { if( ! m_pRun ) m_pRun = m_pBytes; medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::ExtractULONG\n" ); - ULONG nCount; - memcpy( &nCount, m_pRun, sizeof( ULONG ) ); - m_pRun += sizeof( ULONG ); + sal_uLong nCount; + memcpy( &nCount, m_pRun, sizeof( sal_uLong ) ); + m_pRun += sizeof( sal_uLong ); return nCount; } -void* MediatorMessage::GetBytes( ULONG& rBytes ) +void* MediatorMessage::GetBytes( sal_uLong& rBytes ) { if( ! m_pRun ) m_pRun = m_pBytes; medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetBytes\n" ); - ULONG nBytes = ExtractULONG(); + sal_uLong nBytes = ExtractULONG(); if( nBytes == 0 ) return NULL; @@ -280,7 +280,7 @@ char* MediatorMessage::GetString() m_pRun = m_pBytes; medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); - ULONG nBytes = ExtractULONG(); + sal_uLong nBytes = ExtractULONG(); if( nBytes == 0 ) return NULL; @@ -293,17 +293,17 @@ char* MediatorMessage::GetString() return pBuffer; } -UINT32 MediatorMessage::GetUINT32() +sal_uInt32 MediatorMessage::GetUINT32() { if( ! m_pRun ) m_pRun = m_pBytes; medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetUINT32\n" ); - ULONG nBytes = ExtractULONG(); + sal_uLong nBytes = ExtractULONG(); medDebug( nBytes != sizeof( UINT32 ), "No UINT32 in MediatorMessage::GetUINT32\n" ); medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetUINT32\n" ); - UINT32 nRet; + sal_uInt32 nRet; memcpy( &nRet, m_pRun, sizeof( nRet ) ); - m_pRun += sizeof( UINT32 ); + m_pRun += sizeof( sal_uInt32 ); return nRet; } diff --git a/extensions/source/plugin/unx/npnapi.cxx b/extensions/source/plugin/unx/npnapi.cxx index 4a88577c5b71..364ff05606bc 100644 --- a/extensions/source/plugin/unx/npnapi.cxx +++ b/extensions/source/plugin/unx/npnapi.cxx @@ -66,11 +66,11 @@ static uint32 l_NPN_MemFlush( uint32 /*nSize*/ ) static NPError l_NPN_DestroyStream( NPP instance, NPStream* stream, NPError reason ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; - UINT32 nFileID = pConnector->GetStreamID( stream ); + sal_uInt32 nFileID = pConnector->GetStreamID( stream ); MediatorMessage* pMes= pConnector-> Transact( eNPN_DestroyStream, @@ -117,7 +117,7 @@ static jref l_NPN_GetJavaPeer( NPP /*instance*/ ) static NPError l_NPN_GetURL( NPP instance, const char* url, const char* window ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -142,7 +142,7 @@ static NPError l_NPN_GetURL( NPP instance, const char* url, const char* window ) static NPError l_NPN_GetURLNotify( NPP instance, const char* url, const char* target, void* notifyData ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -169,7 +169,7 @@ static NPError l_NPN_NewStream( NPP instance, NPMIMEType type, const char* targe NPStream** stream ) // stream is a return value { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -203,7 +203,7 @@ static NPError l_NPN_NewStream( NPP instance, NPMIMEType type, const char* targe static NPError l_NPN_PostURLNotify( NPP instance, const char* url, const char* target, uint32 len, const char* buf, NPBool file, void* notifyData ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -228,7 +228,7 @@ static NPError l_NPN_PostURLNotify( NPP instance, const char* url, const char* t static NPError l_NPN_PostURL( NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -254,29 +254,29 @@ static NPError l_NPN_RequestRead( NPStream* stream, NPByteRange* rangeList ) medDebug( 1, "pluginapp: NPN_RequestRead\n" ); NPByteRange* pRange = rangeList; - UINT32 nRanges = 0; + sal_uInt32 nRanges = 0; while( pRange ) { nRanges++; pRange = pRange->next; } - UINT32* pArray = new UINT32[ 2 * nRanges ]; + sal_uInt32* pArray = new sal_uInt32[ 2 * nRanges ]; pRange = rangeList; - UINT32 n = 0; + sal_uInt32 n = 0; while( pRange ) { - pArray[ 2*n ] = (UINT32)pRange->offset; - pArray[ 2*n + 1] = (UINT32)pRange->length; + pArray[ 2*n ] = (sal_uInt32)pRange->offset; + pArray[ 2*n + 1] = (sal_uInt32)pRange->length; n++; pRange = pRange->next; } - UINT32 nFileID = pConnector->GetStreamID( stream ); + sal_uInt32 nFileID = pConnector->GetStreamID( stream ); MediatorMessage* pMes = pConnector-> Transact( eNPN_RequestRead, &nFileID, sizeof( nFileID ), &nRanges, sizeof( nRanges ), - pArray, sizeof( UINT32 ) * 2 * nRanges, + pArray, sizeof( sal_uInt32 ) * 2 * nRanges, NULL ); if( ! pMes ) @@ -290,7 +290,7 @@ static NPError l_NPN_RequestRead( NPStream* stream, NPByteRange* rangeList ) static void l_NPN_Status( NPP instance, const char* message ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return; @@ -304,7 +304,7 @@ static const char* l_NPN_UserAgent( NPP instance ) { static char* pAgent = NULL; - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) { if( instance ) @@ -355,10 +355,10 @@ static void l_NPN_Version( int* major, int* minor, int* net_major, int* net_mino static int32 l_NPN_Write( NPP instance, NPStream* stream, int32 len, void* buffer ) { - UINT32 nFileID = pConnector->GetStreamID( stream ); + sal_uInt32 nFileID = pConnector->GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return NPERR_GENERIC_ERROR; - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -373,7 +373,7 @@ static int32 l_NPN_Write( NPP instance, NPStream* stream, int32 len, void* buffe if( ! pMes ) return 0; - INT32 nRet = pMes->GetUINT32(); + sal_Int32 nRet = pMes->GetUINT32(); return nRet; } @@ -531,7 +531,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) { MediatorMessage* pMessage; CommandAtoms nCommand; - while( (pMessage = GetNextMessage( FALSE )) ) + while( (pMessage = GetNextMessage( sal_False )) ) { nCommand = (CommandAtoms)pMessage->GetUINT32(); medDebug( 1, "pluginapp: %s\n", GetCommandName( nCommand ) ); @@ -539,9 +539,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) { case eNPP_DestroyStream: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; NPError aReason = GetNPError( pMessage ); m_aNPWrapStreams.erase( m_aNPWrapStreams.begin() + nFileID ); @@ -557,7 +557,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_Destroy: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); ConnectorInstance* pInst= m_aInstances[ nInstance ]; // some plugin rely on old netscapes behaviour @@ -576,7 +576,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) case eNPP_DestroyPhase2: { // now really destroy the instance - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); ConnectorInstance* pInst= m_aInstances[ nInstance ]; NPP instance = pInst->instance; NPSavedData* pSave = NULL; @@ -611,7 +611,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_NewStream: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pType = pMessage->GetString(); NPStream* pStream = new NPStream; @@ -643,10 +643,10 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) int16* pArgc = (int16*)pMessage->GetBytes(); NPP instance = new NPP_t; instance->pdata = instance->ndata = NULL; - ULONG nArgnBytes, nArgvBytes; + sal_uLong nArgnBytes, nArgvBytes; char* pArgn = (char*)pMessage->GetBytes( nArgnBytes ); char* pArgv = (char*)pMessage->GetBytes( nArgvBytes ); - ULONG nSaveBytes; + sal_uLong nSaveBytes; char* pSavedData = (char*)pMessage->GetBytes( nSaveBytes ); ConnectorInstance* pInst = new ConnectorInstance( instance, pType, @@ -659,7 +659,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) aRet = aPluginFuncs.newp( pInst->pMimeType, instance, *pMode, *pArgc, pInst->nArg ? pInst->argn : NULL, pInst->nArg ? pInst->argv : NULL, - ( nSaveBytes == 4 && *(UINT32*)pSavedData == 0 ) ? + ( nSaveBytes == 4 && *(sal_uInt32*)pSavedData == 0 ) ? &(pInst->aData) : NULL ); medDebug( 1, "pluginapp: NPP_New( %s, %p, %d, %d, %p, %p, %p ) returns %d\n", pInst->pMimeType, @@ -695,7 +695,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_SetWindow: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); ConnectorInstance* pInst= m_aInstances[ nInstance ]; NPWindow* pWindow = (NPWindow*)pMessage->GetBytes(); @@ -795,9 +795,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_StreamAsFile: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; char* fname = pMessage->GetString(); medDebug( 1, "pluginapp: NPP_StreamAsFile %s\n", fname ); @@ -807,7 +807,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_URLNotify: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* url = pMessage->GetString(); NPReason* pReason = (NPReason*)pMessage->GetBytes(); @@ -820,9 +820,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_WriteReady: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; int32 nRet = aPluginFuncs.writeready( instance, pStream ); @@ -836,12 +836,12 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_Write: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; int32 offset = pMessage->GetUINT32(); - ULONG len; + sal_uLong len; char* buffer = (char*)pMessage->GetBytes( len ); int32 nRet = aPluginFuncs.write( instance, pStream, offset, len, buffer ); diff --git a/extensions/source/plugin/unx/nppapi.cxx b/extensions/source/plugin/unx/nppapi.cxx index 82be7ae3c2df..640daba417ce 100644 --- a/extensions/source/plugin/unx/nppapi.cxx +++ b/extensions/source/plugin/unx/nppapi.cxx @@ -94,7 +94,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) MediatorMessage* pMessage; CommandAtoms nCommand; - while( (pMessage = GetNextMessage( FALSE )) ) + while( (pMessage = GetNextMessage( sal_False )) ) { nCommand = (CommandAtoms)pMessage->GetUINT32(); medDebug( 1, "%s\n", GetCommandName( nCommand ) ); @@ -102,7 +102,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) { case eNPN_GetURL: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pUrl = pMessage->GetString(); char* pWindow = pMessage->GetString(); @@ -115,7 +115,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_GetURLNotify: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pUrl = pMessage->GetString(); char* pWindow = pMessage->GetString(); @@ -131,13 +131,13 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_DestroyStream: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); char* pUrl = pMessage->GetString(); NPError* pReason = (NPError*)pMessage->GetBytes(); NPError aRet = NPERR_FILE_NOT_FOUND; - if( nFileID < static_cast<UINT32>(m_aNPWrapStreams.size()) ) + if( nFileID < static_cast<sal_uInt32>(m_aNPWrapStreams.size()) ) { if( ! strcmp( m_aNPWrapStreams[ nFileID ]->url, pUrl ) ) { @@ -162,7 +162,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_NewStream: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; NPMIMEType pType = pMessage->GetString(); char* pTarget = pMessage->GetString(); @@ -173,24 +173,24 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) if( aRet != NPERR_NO_ERROR ) { - UINT32 nDummy = 0; + sal_uInt32 nDummy = 0; Respond( pMessage->m_nID, (char*)&aRet, sizeof( aRet ), "", 0, - &nDummy, sizeof(UINT32), - &nDummy, sizeof(UINT32), + &nDummy, sizeof(sal_uInt32), + &nDummy, sizeof(sal_uInt32), NULL ); } else { m_aNPWrapStreams.push_back( pStream ); - ULONG nLen = strlen( pStream->url ); + sal_uLong nLen = strlen( pStream->url ); Respond( pMessage->m_nID, (char*)&aRet, sizeof( aRet ), pStream->url, nLen, - &pStream->end, sizeof(UINT32), - &pStream->lastmodified, sizeof(UINT32), + &pStream->end, sizeof(sal_uInt32), + &pStream->lastmodified, sizeof(sal_uInt32), NULL ); } @@ -200,11 +200,11 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_PostURLNotify: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pUrl = pMessage->GetString(); char* pTarget = pMessage->GetString(); - UINT32 nLen = pMessage->GetUINT32(); + sal_uInt32 nLen = pMessage->GetUINT32(); char* pBuf = (char*)pMessage->GetBytes(); NPBool* pFile = (NPBool*)pMessage->GetBytes(); void** pNData = (void**)pMessage->GetBytes(); @@ -220,11 +220,11 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_PostURL: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pUrl = pMessage->GetString(); char* pWindow = pMessage->GetString(); - UINT32 nLen = pMessage->GetUINT32(); + sal_uInt32 nLen = pMessage->GetUINT32(); char* pBuf = (char*)pMessage->GetBytes(); NPBool* pFile = (NPBool*)pMessage->GetBytes(); NPError aRet = @@ -238,14 +238,14 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_RequestRead: { - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; - UINT32 nRanges = pMessage->GetUINT32(); - UINT32* pArray = (UINT32*)pMessage->GetBytes(); + sal_uInt32 nRanges = pMessage->GetUINT32(); + sal_uInt32* pArray = (sal_uInt32*)pMessage->GetBytes(); // build ranges table NPByteRange* pFirst = new NPByteRange; NPByteRange* pRun = pFirst; - for( UINT32 n = 0; n < nRanges; n++ ) + for( sal_uInt32 n = 0; n < nRanges; n++ ) { pRun->offset = pArray[ 2*n ]; pRun->length = pArray[ 2*n+1 ]; @@ -265,7 +265,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_Status: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pString = pMessage->GetString(); NPN_Status( instance, pString ); @@ -286,13 +286,13 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_Write: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; - INT32 nLen = pMessage->GetUINT32(); + sal_Int32 nLen = pMessage->GetUINT32(); void* pBuffer = pMessage->GetBytes(); - INT32 nRet = NPN_Write( instance, pStream, nLen, pBuffer ); + sal_Int32 nRet = NPN_Write( instance, pStream, nLen, pBuffer ); Respond( pMessage->m_nID, (char*)&nRet, sizeof( nRet ), NULL ); @@ -302,7 +302,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_UserAgent: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; const char* pAnswer = NPN_UserAgent( instance ); Respond( pMessage->m_nID, @@ -320,7 +320,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) } #define GET_INSTANCE() \ - UINT32 nInstance; \ + sal_uInt32 nInstance; \ nInstance = GetNPPID( instance ); #define GET_INSTANCE_RET( err ) \ @@ -350,9 +350,9 @@ NPError UnxPluginComm::NPP_Destroy( NPP instance, NPSavedData** save ) return NPERR_GENERIC_ERROR; aRet = GetNPError( pMes ); - ULONG nSaveBytes; + sal_uLong nSaveBytes; void* pSaveData = pMes->GetBytes( nSaveBytes ); - if( nSaveBytes == 4 && *(UINT32*)pSaveData == 0 ) + if( nSaveBytes == 4 && *(sal_uInt32*)pSaveData == 0 ) *save = NULL; else { @@ -369,7 +369,7 @@ NPError UnxPluginComm::NPP_DestroyStream( NPP instance, NPStream* stream, NPErro { NPError aRet = NPERR_GENERIC_ERROR; GET_INSTANCE_RET( aRet ); - UINT32 nFileID = GetStreamID( stream ); + sal_uInt32 nFileID = GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return NPERR_GENERIC_ERROR; @@ -526,7 +526,7 @@ void UnxPluginComm::NPP_Shutdown() void UnxPluginComm::NPP_StreamAsFile( NPP instance, NPStream* stream, const char* fname ) { GET_INSTANCE(); - UINT32 nFileID = GetStreamID( stream ); + sal_uInt32 nFileID = GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return; @@ -552,7 +552,7 @@ void UnxPluginComm::NPP_URLNotify( NPP instance, const char* url, NPReason reaso int32 UnxPluginComm::NPP_Write( NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer ) { GET_INSTANCE_RET( -1 ); - UINT32 nFileID = GetStreamID( stream ); + sal_uInt32 nFileID = GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return -1; @@ -575,7 +575,7 @@ int32 UnxPluginComm::NPP_Write( NPP instance, NPStream* stream, int32 offset, in int32 UnxPluginComm::NPP_WriteReady( NPP instance, NPStream* stream ) { GET_INSTANCE_RET( -1 ); - UINT32 nFileID = GetStreamID( stream ); + sal_uInt32 nFileID = GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return -1; diff --git a/extensions/source/plugin/unx/npwrap.cxx b/extensions/source/plugin/unx/npwrap.cxx index 387de8cde24d..98bb858ecc0f 100644 --- a/extensions/source/plugin/unx/npwrap.cxx +++ b/extensions/source/plugin/unx/npwrap.cxx @@ -227,7 +227,7 @@ static void signal_handler( int nSig ) static gboolean noClosure( gpointer ) { - return TRUE; + return sal_True; } // Xt events @@ -246,7 +246,7 @@ static gboolean checkXtEvent( GSource* ) static gboolean dispatchXtEvent( GSource*, GSourceFunc, gpointer ) { XtAppProcessEvent( app_context, XtIMAll ); - return TRUE; + return sal_True; } static GSourceFuncs aXtEventFuncs = @@ -267,7 +267,7 @@ static gboolean pollXtTimerCallback(gpointer) break; XtAppProcessEvent(app_context, XtIMAll & ~XtIMXEvent); } - return TRUE; + return sal_True; } static gboolean prepareWakeupEvent( GSource*, gint* ) @@ -302,7 +302,7 @@ static gboolean dispatchWakeupEvent( GSource*, GSourceFunc, gpointer ) pConnector = NULL; } - return TRUE; + return sal_True; } static GSourceFuncs aWakeupEventFuncs = { @@ -412,7 +412,7 @@ int main( int argc, char **argv) } g_source_set_priority( pXTSource, GDK_PRIORITY_EVENTS ); - g_source_set_can_recurse( pXTSource, TRUE ); + g_source_set_can_recurse( pXTSource, sal_True ); g_source_attach( pXTSource, NULL ); aXtPollDesc.fd = ConnectionNumber( pXtAppDisplay ); aXtPollDesc.events = G_IO_IN; @@ -474,7 +474,7 @@ int main( int argc, char **argv) do { #ifdef ENABLE_GTK - g_main_context_iteration( NULL, TRUE ); + g_main_context_iteration( NULL, sal_True ); #else XtAppProcessEvent( app_context, XtIMAll ); #endif diff --git a/extensions/source/plugin/unx/plugcon.cxx b/extensions/source/plugin/unx/plugcon.cxx index 8e0183ab8c81..c71738be3632 100644 --- a/extensions/source/plugin/unx/plugcon.cxx +++ b/extensions/source/plugin/unx/plugcon.cxx @@ -32,22 +32,22 @@ #include <cstdarg> #include <vector> -UINT32 PluginConnector::GetStreamID( NPStream* pStream ) +sal_uInt32 PluginConnector::GetStreamID( NPStream* pStream ) { size_t nLen = m_aNPWrapStreams.size(); for( size_t i = 0; i < nLen; i++ ) if( m_aNPWrapStreams[ i ] == pStream ) - return static_cast<UINT32>(i); + return static_cast<sal_uInt32>(i); medDebug( 1, "Error: NPStream has no ID\n" ); return UnknownStreamID; } -UINT32 PluginConnector::GetNPPID( NPP instance ) +sal_uInt32 PluginConnector::GetNPPID( NPP instance ) { size_t nLen = m_aInstances.size(); for( size_t i=0; i <nLen; i++ ) if( m_aInstances[ i ]->instance == instance ) - return static_cast<UINT32>(i); + return static_cast<sal_uInt32>(i); medDebug( 1, "Error: NPP has no ID\n" ); return UnknownNPPID; @@ -65,37 +65,37 @@ ConnectorInstance* PluginConnector::getInstance( NPP instance ) return NULL; } -ConnectorInstance* PluginConnector::getInstanceById( UINT32 nInstanceID ) +ConnectorInstance* PluginConnector::getInstanceById( sal_uInt32 nInstanceID ) { - return nInstanceID < static_cast<UINT32>(m_aInstances.size()) ? m_aInstances[ nInstanceID ] : NULL; + return nInstanceID < static_cast<sal_uInt32>(m_aInstances.size()) ? m_aInstances[ nInstanceID ] : NULL; } struct PtrStruct { char* pData; - ULONG nBytes; + sal_uLong nBytes; - PtrStruct( char* i_pData, ULONG i_nBytes ) + PtrStruct( char* i_pData, sal_uLong i_nBytes ) : pData( i_pData ), nBytes( i_nBytes ) {} }; -ULONG PluginConnector::FillBuffer( char*& rpBuffer, +sal_uLong PluginConnector::FillBuffer( char*& rpBuffer, const char* pFunction, - ULONG nFunctionLen, + sal_uLong nFunctionLen, va_list ap ) { std::vector< PtrStruct > aList; aList.reserve( 5 ); - ULONG nDataSize = nFunctionLen + sizeof( ULONG ); + sal_uLong nDataSize = nFunctionLen + sizeof( sal_uLong ); char* pNext; do { pNext = va_arg( ap, char* ); if( pNext ) { - aList.push_back( PtrStruct( pNext, va_arg( ap, ULONG ) ) ); - nDataSize += aList.back().nBytes + sizeof(ULONG); + aList.push_back( PtrStruct( pNext, va_arg( ap, sal_uLong ) ) ); + nDataSize += aList.back().nBytes + sizeof(sal_uLong); } } while( pNext ); @@ -108,8 +108,8 @@ ULONG PluginConnector::FillBuffer( char*& rpBuffer, for( std::vector<PtrStruct>::const_iterator it = aList.begin(); it != aList.end(); ++it ) { - memcpy( pRun, &it->nBytes, sizeof( ULONG ) ); - pRun += sizeof( ULONG ); + memcpy( pRun, &it->nBytes, sizeof( sal_uLong ) ); + pRun += sizeof( sal_uLong ); memcpy( pRun, it->pData, it->nBytes ); pRun += it->nBytes; } @@ -117,53 +117,53 @@ ULONG PluginConnector::FillBuffer( char*& rpBuffer, } MediatorMessage* PluginConnector::Transact( const char* pFunction, - ULONG nFunctionLen, ... ) + sal_uLong nFunctionLen, ... ) { va_list ap; char* pBuffer; va_start( ap, nFunctionLen ); - ULONG nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); + sal_uLong nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); va_end( ap ); return TransactMessage( nSize, pBuffer ); } -MediatorMessage* PluginConnector::Transact( UINT32 nFunction, ... ) +MediatorMessage* PluginConnector::Transact( sal_uInt32 nFunction, ... ) { va_list ap; char* pBuffer; va_start( ap, nFunction ); - ULONG nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap ); + sal_uLong nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap ); va_end( ap ); return TransactMessage( nSize, pBuffer ); } -ULONG PluginConnector::Send( UINT32 nFunction, ... ) +sal_uLong PluginConnector::Send( sal_uInt32 nFunction, ... ) { va_list ap; char* pBuffer; va_start( ap, nFunction ); - ULONG nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap ); + sal_uLong nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap ); va_end( ap ); return SendMessage( nSize, pBuffer ); } -void PluginConnector::Respond( ULONG nID, +void PluginConnector::Respond( sal_uLong nID, char* pFunction, - ULONG nFunctionLen, ... ) + sal_uLong nFunctionLen, ... ) { va_list ap; char* pBuffer; va_start( ap, nFunctionLen ); - ULONG nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); + sal_uLong nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); va_end( ap ); SendMessage( nSize, pBuffer, nID | ( 1 << 24 ) ); } -MediatorMessage* PluginConnector::WaitForAnswer( ULONG nMessageID ) +MediatorMessage* PluginConnector::WaitForAnswer( sal_uLong nMessageID ) { if( ! m_bValid ) return NULL; @@ -176,7 +176,7 @@ MediatorMessage* PluginConnector::WaitForAnswer( ULONG nMessageID ) for( size_t i = 0; i < m_aMessageQueue.size(); i++ ) { MediatorMessage* pMessage = m_aMessageQueue[ i ]; - ULONG nID = pMessage->m_nID; + sal_uLong nID = pMessage->m_nID; if( ( nID & 0xff000000 ) && ( ( nID & 0x00ffffff ) == nMessageID ) ) { @@ -193,9 +193,9 @@ MediatorMessage* PluginConnector::WaitForAnswer( ULONG nMessageID ) } ConnectorInstance::ConnectorInstance( NPP inst, char* type, - int args, char* pargnbuf, ULONG nargnbytes, - char* pargvbuf, ULONG nargvbytes, - char* savedata, ULONG savebytes ) : + int args, char* pargnbuf, sal_uLong nargnbytes, + char* pargvbuf, sal_uLong nargvbytes, + char* savedata, sal_uLong savebytes ) : instance( inst ), pShell( NULL ), pWidget( NULL ), @@ -219,18 +219,18 @@ ConnectorInstance::ConnectorInstance( NPP inst, char* type, for( i = 0; i < nArg; i++ ) { argn[i] = pRun; - while( *pRun != 0 && (ULONG)(pRun - pArgnBuf) < nargnbytes ) + while( *pRun != 0 && (sal_uLong)(pRun - pArgnBuf) < nargnbytes ) pRun++; - if( (ULONG)(pRun - pArgnBuf) < nargnbytes ) + if( (sal_uLong)(pRun - pArgnBuf) < nargnbytes ) pRun++; } pRun = pArgvBuf; for( i = 0; i < nArg; i++ ) { argv[i] = pRun; - while( *pRun != 0 && (ULONG)(pRun - pArgvBuf) < nargvbytes ) + while( *pRun != 0 && (sal_uLong)(pRun - pArgvBuf) < nargvbytes ) pRun++; - if( (ULONG)(pRun - pArgvBuf) < nargvbytes ) + if( (sal_uLong)(pRun - pArgvBuf) < nargvbytes ) pRun++; } } diff --git a/extensions/source/plugin/unx/sysplug.cxx b/extensions/source/plugin/unx/sysplug.cxx index fbcf9b7497eb..be5879bf238d 100644 --- a/extensions/source/plugin/unx/sysplug.cxx +++ b/extensions/source/plugin/unx/sysplug.cxx @@ -91,7 +91,7 @@ UnxPluginComm::UnxPluginComm( } else { - MediatorMessage* pMessage = GetNextMessage( TRUE ); + MediatorMessage* pMessage = GetNextMessage( sal_True ); Respond( pMessage->m_nID, const_cast<char*>("init ack"),8, NULL ); diff --git a/extensions/source/plugin/unx/unxmgr.cxx b/extensions/source/plugin/unx/unxmgr.cxx index 1a3736e87e0b..5c02910ada33 100644 --- a/extensions/source/plugin/unx/unxmgr.cxx +++ b/extensions/source/plugin/unx/unxmgr.cxx @@ -231,7 +231,7 @@ static void CheckPluginRegistryFiles( const rtl::OString& rPath, list< PluginDes Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() throw() { static Sequence<PluginDescription> aDescriptions; - static BOOL bHavePlugins = FALSE; + static sal_Bool bHavePlugins = sal_False; if( ! bHavePlugins ) { rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); @@ -309,7 +309,7 @@ Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() th delete *iter; } aPlugins.clear(); - bHavePlugins = TRUE; + bHavePlugins = sal_True; } return aDescriptions; } |