diff options
Diffstat (limited to 'extensions/source/plugin')
-rw-r--r-- | extensions/source/plugin/aqua/macmgr.cxx | 4 | ||||
-rw-r--r-- | extensions/source/plugin/aqua/sysplug.cxx | 12 | ||||
-rw-r--r-- | extensions/source/plugin/base/manager.cxx | 6 | ||||
-rw-r--r-- | extensions/source/plugin/base/service.cxx | 27 | ||||
-rw-r--r-- | extensions/source/plugin/base/xplugin.cxx | 8 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/aqua/sysplug.hxx | 2 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/impl.hxx | 6 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/unx/mediator.hxx | 30 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/unx/plugcon.hxx | 28 | ||||
-rw-r--r-- | extensions/source/plugin/unx/mediator.cxx | 70 | ||||
-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 | ||||
-rw-r--r-- | extensions/source/plugin/util/makefile.mk | 8 | ||||
-rw-r--r-- | extensions/source/plugin/util/pl.component | 37 |
18 files changed, 241 insertions, 223 deletions
diff --git a/extensions/source/plugin/aqua/macmgr.cxx b/extensions/source/plugin/aqua/macmgr.cxx index 2a67cc994b8e..3b6984502a5e 100644 --- a/extensions/source/plugin/aqua/macmgr.cxx +++ b/extensions/source/plugin/aqua/macmgr.cxx @@ -587,7 +587,7 @@ static rtl::OUString FindFolderURL( FSVolumeRefNum vRefNum, OSType folderType ) Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() throw() { static Sequence<PluginDescription> aDescriptions; - static BOOL bHavePlugins = FALSE; + static sal_Bool bHavePlugins = sal_False; if( ! bHavePlugins ) { std::list<PluginDescription*> aPlugins; @@ -646,7 +646,7 @@ Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() th delete *iter; } aPlugins.clear(); - bHavePlugins = TRUE; + bHavePlugins = sal_True; } return aDescriptions; } diff --git a/extensions/source/plugin/aqua/sysplug.cxx b/extensions/source/plugin/aqua/sysplug.cxx index 6b4c93202b85..ef3c7bd3ee8d 100644 --- a/extensions/source/plugin/aqua/sysplug.cxx +++ b/extensions/source/plugin/aqua/sysplug.cxx @@ -70,8 +70,8 @@ struct FakeEventRecord : public EventRecord } -(id)initWithInstance: (XPlugin_Impl*)i_pImpl pluginComm: (MacPluginComm*)i_pCom frame: (NSRect)i_aRect; -(void)drawRect: (NSRect)i_aRect; --(MacOSBOOL)isOpaque; --(MacOSBOOL)isFlipped; +-(BOOL)isOpaque; +-(BOOL)isFlipped; // NSResponder -(void)mouseMoved: (NSEvent*)i_pEvent; @@ -104,12 +104,12 @@ struct FakeEventRecord : public EventRecord m_pCom->drawView( m_pImpl ); } --(MacOSBOOL)isOpaque +-(BOOL)isOpaque { return NO; } --(MacOSBOOL)isFlipped +-(BOOL)isFlipped { return YES; } @@ -273,10 +273,10 @@ MacPluginComm::~MacPluginComm() } //-------------------------------------------------------------------------------------------------- -BOOL MacPluginComm::retrieveFunction( const char* i_pName, void** o_ppFunc ) const +sal_Bool MacPluginComm::retrieveFunction( const char* i_pName, void** o_ppFunc ) const { if( ! m_hPlugLib || ! o_ppFunc ) - return FALSE; + return sal_False; *o_ppFunc = (void*)osl_getAsciiFunctionSymbol( m_hPlugLib, i_pName ); diff --git a/extensions/source/plugin/base/manager.cxx b/extensions/source/plugin/base/manager.cxx index 338eb1940df9..a261177aafaa 100644 --- a/extensions/source/plugin/base/manager.cxx +++ b/extensions/source/plugin/base/manager.cxx @@ -81,9 +81,9 @@ const Sequence< ::rtl::OUString >& PluginManager::getAdditionalSearchPaths() String aPluginPath( aOptions.GetPluginPath() ); if( aPluginPath.Len() ) { - USHORT nPaths = aPluginPath.GetTokenCount( ';' ); + sal_uInt16 nPaths = aPluginPath.GetTokenCount( ';' ); aPaths.realloc( nPaths ); - for( USHORT i = 0; i < nPaths; i++ ) + for( sal_uInt16 i = 0; i < nPaths; i++ ) aPaths.getArray()[i] = aPluginPath.GetToken( i, ';' ); } } @@ -181,7 +181,7 @@ Sequence<com::sun::star::plugin::PluginDescription> XPluginManager_Impl::getPlug return aRet; } -Reference< ::com::sun::star::plugin::XPlugin > XPluginManager_Impl::createPlugin( const Reference< ::com::sun::star::plugin::XPluginContext >& acontext, INT16 mode, const Sequence< ::rtl::OUString >& argn, const Sequence< ::rtl::OUString >& argv, const ::com::sun::star::plugin::PluginDescription& plugintype) +Reference< ::com::sun::star::plugin::XPlugin > XPluginManager_Impl::createPlugin( const Reference< ::com::sun::star::plugin::XPluginContext >& acontext, sal_Int16 mode, const Sequence< ::rtl::OUString >& argn, const Sequence< ::rtl::OUString >& argv, const ::com::sun::star::plugin::PluginDescription& plugintype) throw( RuntimeException,::com::sun::star::plugin::PluginException ) { XPlugin_Impl* pImpl = new XPlugin_Impl( m_xSMgr ); diff --git a/extensions/source/plugin/base/service.cxx b/extensions/source/plugin/base/service.cxx index bef0be999906..ac32608be0b9 100644 --- a/extensions/source/plugin/base/service.cxx +++ b/extensions/source/plugin/base/service.cxx @@ -59,33 +59,6 @@ extern "C" { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pXUnoKey ) - { - if( pXUnoKey ) - { - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pXUnoKey ) ); - - ::rtl::OUString aImplName (RTL_CONSTASCII_USTRINGPARAM("/")); - aImplName += XPluginManager_Impl::getImplementationName_Static(); - aImplName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES/com.sun.star.plugin.PluginManager")); - xKey->createKey( aImplName ); - - aImplName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImplName += PluginModel::getImplementationName_Static(); - aImplName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES/com.sun.star.plugin.PluginModel")); - xKey->createKey( aImplName ); - - return sal_True; - } - catch( ::com::sun::star::registry::InvalidRegistryException& ) - { - } - } - return sal_False; - } - void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pXUnoSMgr, diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index 1eac4dd9c983..38039f4fa7f9 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -86,7 +86,7 @@ void PluginDisposer::onShot() { if( m_pPlugin->isDisposable() ) { - ULONG nEvent; + sal_uLong nEvent; Application::PostUserEvent( nEvent, LINK( m_pPlugin, XPlugin_Impl, secondLevelDispose ), (void*)m_pPlugin ); } } @@ -1020,7 +1020,7 @@ void PluginInputStream::load() aUrl.SetSmartProtocol( INET_PROT_FILE ); aUrl.SetSmartURL( String( getStream()->url, - ::sal::static_int_cast< USHORT, size_t >( strlen( getStream()->url ) ), + ::sal::static_int_cast< sal_uInt16, size_t >( strlen( getStream()->url ) ), RTL_TEXTENCODING_MS_1252 ) ); try @@ -1065,8 +1065,8 @@ void PluginInputStream::writeBytes( const Sequence<sal_Int8>& Buffer ) throw() if( m_nMode == -1 || !m_pPlugin->getPluginComm() ) return; - UINT32 nPos = m_aFileStream.Tell(); - UINT32 nBytes = 0; + sal_uInt32 nPos = m_aFileStream.Tell(); + sal_uInt32 nBytes = 0; while( m_nMode != NP_ASFILEONLY && m_nWritePos < nPos && (nBytes = m_pPlugin->getPluginComm()-> NPP_WriteReady( diff --git a/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx b/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx index 01b8dafa0f2c..53f137e0c236 100644 --- a/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx +++ b/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx @@ -137,7 +137,7 @@ public: void drawView( XPlugin_Impl* ); private: - BOOL retrieveFunction( const char* i_pName, void** i_ppFunc ) const; + sal_Bool retrieveFunction( const char* i_pName, void** i_ppFunc ) const; DECL_LINK( NullTimerHdl, void* ); private: diff --git a/extensions/source/plugin/inc/plugin/impl.hxx b/extensions/source/plugin/inc/plugin/impl.hxx index cad61129d875..75c8cd55922e 100644 --- a/extensions/source/plugin/inc/plugin/impl.hxx +++ b/extensions/source/plugin/inc/plugin/impl.hxx @@ -341,7 +341,7 @@ class PluginInputStream : private: ::ucbhelper::Content* m_pContent; sal_Int32 m_nMode; - UINT32 m_nWritePos; + sal_uInt32 m_nWritePos; Reference< com::sun::star::io::XActiveDataSource > m_xSource; // hold a reference on input until closeOutput is called @@ -355,7 +355,7 @@ private: SvFileStream m_aFileStream; public: PluginInputStream( XPlugin_Impl* pPlugin, - const char* url, UINT32 len, UINT32 lastmod ); + const char* url, sal_uInt32 len, sal_uInt32 lastmod ); PluginInputStream() : PluginStream( NULL, NULL, 0, 0 ) {} @@ -364,7 +364,7 @@ public: virtual PluginStreamType getStreamType(); void setMode( sal_Int32 nMode ); - UINT32 read( UINT32 offset, sal_Int8* buffer, UINT32 size ); + sal_uInt32 read( sal_uInt32 offset, sal_Int8* buffer, sal_uInt32 size ); void setSource( const Reference< com::sun::star::io::XActiveDataSource >& xSource ) { m_xSource = xSource; } // get contents ot url via ucbhelper::Content void load(); diff --git a/extensions/source/plugin/inc/plugin/unx/mediator.hxx b/extensions/source/plugin/inc/plugin/unx/mediator.hxx index acf73c498a6c..72c0e3e82d3d 100644 --- a/extensions/source/plugin/inc/plugin/unx/mediator.hxx +++ b/extensions/source/plugin/inc/plugin/unx/mediator.hxx @@ -44,14 +44,14 @@ struct MediatorMessage { - ULONG m_nID; - ULONG m_nBytes; + sal_uLong m_nID; + sal_uLong m_nBytes; char* m_pBytes; char* m_pRun; MediatorMessage() : m_nID( 0 ), m_nBytes( 0 ), m_pBytes( NULL ), m_pRun( NULL ) {} - MediatorMessage( ULONG nID, ULONG nBytes, char* pBytes ) : + MediatorMessage( sal_uLong nID, sal_uLong nBytes, char* pBytes ) : m_nID( nID ),m_nBytes( nBytes ), m_pRun( NULL ) { m_pBytes = new char[ m_nBytes ]; @@ -64,7 +64,7 @@ struct MediatorMessage delete [] m_pBytes; } - void Set( ULONG nBytes, char* pBytes ) + void Set( sal_uLong nBytes, char* pBytes ) { if( m_pBytes ) delete [] m_pBytes; @@ -73,11 +73,11 @@ struct MediatorMessage memcpy( m_pBytes, pBytes, (size_t)m_nBytes ); } - ULONG ExtractULONG(); + sal_uLong ExtractULONG(); char* GetString(); - UINT32 GetUINT32(); - void* GetBytes( ULONG& ); - void* GetBytes() { ULONG nBytes; return GetBytes( nBytes ); } + sal_uInt32 GetUINT32(); + void* GetBytes( sal_uLong& ); + void* GetBytes() { sal_uLong nBytes; return GetBytes( nBytes ); } void Rewind() { m_pRun = NULL; } }; @@ -98,7 +98,7 @@ protected: MediatorListener* m_pListener; // thread to fill the queue - ULONG m_nCurrentID; + sal_uLong m_nCurrentID; // will be constantly increased with each message sent bool m_bValid; @@ -113,27 +113,27 @@ public: // with error void invalidate() { m_bValid = false; } - ULONG SendMessage( ULONG nBytes, const char* pBytes, ULONG nMessageID = 0 ); - ULONG SendMessage( const ByteString& rMessage, ULONG nMessageID = 0 ) + sal_uLong SendMessage( sal_uLong nBytes, const char* pBytes, sal_uLong nMessageID = 0 ); + sal_uLong SendMessage( const ByteString& rMessage, sal_uLong nMessageID = 0 ) { return SendMessage( rMessage.Len(), rMessage.GetBuffer(), nMessageID ); } - BOOL WaitForMessage( ULONG nTimeOut = 5000 ); + sal_Bool WaitForMessage( sal_uLong nTimeOut = 5000 ); // timeout in ms // TRUE: Message came in // FALSE: timed out // if timeout is set, WaitForMessage will wait even if there are messages // in the queue - virtual MediatorMessage* WaitForAnswer( ULONG nMessageID ); + virtual MediatorMessage* WaitForAnswer( sal_uLong nMessageID ); // wait for an answer message ( ID >= 1 << 24 ) // the message will be removed from the queue and returned - MediatorMessage* TransactMessage( ULONG nBytes, char* pBytes ); + MediatorMessage* TransactMessage( sal_uLong nBytes, char* pBytes ); // sends a message and waits for an answer - MediatorMessage* GetNextMessage( BOOL bWait = FALSE ); + MediatorMessage* GetNextMessage( sal_Bool bWait = sal_False ); Link SetConnectionLostHdl( const Link& rLink ) diff --git a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx index 7db023161249..2b8bf4f7a89d 100644 --- a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx +++ b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx @@ -158,9 +158,9 @@ public: NPSavedData aData; 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 ); ~ConnectorInstance(); }; @@ -177,22 +177,22 @@ protected: std::vector<NPStream*> m_aNPWrapStreams; std::vector<ConnectorInstance*> m_aInstances; - ULONG FillBuffer( char*&, const char*, ULONG, va_list ); + sal_uLong FillBuffer( char*&, const char*, sal_uLong, va_list ); public: PluginConnector( int nSocket ); ~PluginConnector(); - virtual MediatorMessage* WaitForAnswer( ULONG nMessageID ); - MediatorMessage* Transact( const char*, ULONG, ... ); - MediatorMessage* Transact( UINT32, ... ); - void Respond( ULONG nID, char*, ULONG, ... ); - ULONG Send( UINT32, ... ); + virtual MediatorMessage* WaitForAnswer( sal_uLong nMessageID ); + MediatorMessage* Transact( const char*, sal_uLong, ... ); + MediatorMessage* Transact( sal_uInt32, ... ); + void Respond( sal_uLong nID, char*, sal_uLong, ... ); + sal_uLong Send( sal_uInt32, ... ); - static const UINT32 UnknownStreamID = 0xffffffff; - static const UINT32 UnknownNPPID = 0xffffffff; + static const sal_uInt32 UnknownStreamID = 0xffffffff; + static const sal_uInt32 UnknownNPPID = 0xffffffff; - UINT32 GetStreamID( NPStream* pStream ); - UINT32 GetNPPID( NPP ); + sal_uInt32 GetStreamID( NPStream* pStream ); + sal_uInt32 GetNPPID( NPP ); std::vector<NPStream*>& getStreamList() { return m_aNPWrapStreams; } @@ -211,7 +211,7 @@ public: } ConnectorInstance* getInstance( NPP ); - ConnectorInstance* getInstanceById( UINT32 ); + ConnectorInstance* getInstanceById( sal_uInt32 ); }; enum CommandAtoms diff --git a/extensions/source/plugin/unx/mediator.cxx b/extensions/source/plugin/unx/mediator.cxx index 4cbab9e0c9a2..df73c01f7e5e 100644 --- a/extensions/source/plugin/unx/mediator.cxx +++ b/extensions/source/plugin/unx/mediator.cxx @@ -57,7 +57,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; @@ -76,7 +76,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; @@ -92,26 +92,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; @@ -122,12 +122,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 ) @@ -137,7 +137,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 ) ) { @@ -151,7 +151,7 @@ MediatorMessage* Mediator::WaitForAnswer( ULONG nMessageID ) return NULL; } -MediatorMessage* Mediator::GetNextMessage( BOOL bWait ) +MediatorMessage* Mediator::GetNextMessage( sal_Bool bWait ) { while( m_pListener ) { @@ -176,9 +176,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 ); } @@ -196,7 +196,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) @@ -204,7 +204,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 ] ) { ::osl::MutexGuard aMyGuard( m_aMutex ); { @@ -244,30 +244,30 @@ 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 ); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::ExtractULONG\n" ); + 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(); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetBytes\n" ); + sal_uLong nBytes = ExtractULONG(); if( nBytes == 0 ) return NULL; - medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetBytes\n" ); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetBytes\n" ); char* pBuffer = new char[ nBytes ]; memcpy( pBuffer, m_pRun, nBytes ); m_pRun += nBytes; @@ -280,13 +280,13 @@ char* MediatorMessage::GetString() if( ! m_pRun ) m_pRun = m_pBytes; - medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); - ULONG nBytes = ExtractULONG(); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); + sal_uLong nBytes = ExtractULONG(); if( nBytes == 0 ) return NULL; - medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); char* pBuffer = new char[ nBytes+1 ]; memcpy( pBuffer, m_pRun, nBytes ); pBuffer[ nBytes ] = 0; @@ -294,18 +294,18 @@ 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(); - 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; + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetUINT32\n" ); + sal_uLong nBytes = ExtractULONG(); + medDebug( nBytes != sizeof( sal_uInt32 ), "No sal_uInt32 in MediatorMessage::GetUINT32\n" ); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetUINT32\n" ); + 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 f50af7c1d5d3..c0cefa35a556 100644 --- a/extensions/source/plugin/unx/npnapi.cxx +++ b/extensions/source/plugin/unx/npnapi.cxx @@ -74,11 +74,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, @@ -125,7 +125,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; @@ -150,7 +150,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; @@ -177,7 +177,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; @@ -211,7 +211,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; @@ -236,7 +236,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; @@ -262,29 +262,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 ) @@ -298,7 +298,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; @@ -312,7 +312,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 ) @@ -342,10 +342,10 @@ static const char* l_NPN_UserAgent( NPP instance ) 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; @@ -360,7 +360,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; } @@ -518,7 +518,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 ) ); @@ -526,9 +526,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 ); @@ -544,7 +544,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 @@ -563,7 +563,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; @@ -598,7 +598,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; @@ -630,10 +630,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, @@ -646,7 +646,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, @@ -682,7 +682,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(); @@ -782,9 +782,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 ); @@ -794,7 +794,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(); @@ -807,9 +807,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 ); @@ -823,12 +823,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 1353722fdf91..add518cd54fc 100644 --- a/extensions/source/plugin/unx/nppapi.cxx +++ b/extensions/source/plugin/unx/nppapi.cxx @@ -99,7 +99,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 ) ); @@ -107,7 +107,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(); @@ -120,7 +120,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(); @@ -136,13 +136,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 ) ) { @@ -167,7 +167,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(); @@ -178,24 +178,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 ); } @@ -205,11 +205,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(); @@ -225,11 +225,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 = @@ -243,14 +243,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 ]; @@ -270,7 +270,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 ); @@ -291,13 +291,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 ); @@ -307,7 +307,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, @@ -325,7 +325,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) } #define GET_INSTANCE() \ - UINT32 nInstance; \ + sal_uInt32 nInstance; \ nInstance = GetNPPID( instance ); #define GET_INSTANCE_RET( err ) \ @@ -355,9 +355,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 { @@ -374,7 +374,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; @@ -531,7 +531,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; @@ -557,7 +557,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; @@ -580,7 +580,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 7124972d8578..32daa95d512e 100644 --- a/extensions/source/plugin/unx/npwrap.cxx +++ b/extensions/source/plugin/unx/npwrap.cxx @@ -233,7 +233,7 @@ static void signal_handler( int nSig ) static gboolean noClosure( gpointer ) { - return TRUE; + return sal_True; } // Xt events @@ -252,7 +252,7 @@ static gboolean checkXtEvent( GSource* ) static gboolean dispatchXtEvent( GSource*, GSourceFunc, gpointer ) { XtAppProcessEvent( app_context, XtIMAll ); - return TRUE; + return sal_True; } static GSourceFuncs aXtEventFuncs = @@ -273,7 +273,7 @@ static gboolean pollXtTimerCallback(gpointer) break; XtAppProcessEvent(app_context, XtIMAll & ~XtIMXEvent); } - return TRUE; + return sal_True; } static gboolean prepareWakeupEvent( GSource*, gint* ) @@ -308,7 +308,7 @@ static gboolean dispatchWakeupEvent( GSource*, GSourceFunc, gpointer ) pConnector = NULL; } - return TRUE; + return sal_True; } static GSourceFuncs aWakeupEventFuncs = { @@ -418,7 +418,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; @@ -480,7 +480,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 607ae05d9877..713154d87300 100644 --- a/extensions/source/plugin/unx/plugcon.cxx +++ b/extensions/source/plugin/unx/plugcon.cxx @@ -40,22 +40,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; @@ -73,37 +73,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 ); @@ -116,8 +116,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; } @@ -125,53 +125,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; @@ -184,7 +184,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 ) ) { @@ -201,9 +201,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 ), @@ -227,18 +227,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 dc7be6799ae3..dac8a24a52c3 100644 --- a/extensions/source/plugin/unx/sysplug.cxx +++ b/extensions/source/plugin/unx/sysplug.cxx @@ -99,7 +99,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 3ec32edd795b..742cb26f3498 100644 --- a/extensions/source/plugin/unx/unxmgr.cxx +++ b/extensions/source/plugin/unx/unxmgr.cxx @@ -243,7 +243,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(); @@ -321,7 +321,7 @@ Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() th delete *iter; } aPlugins.clear(); - bHavePlugins = TRUE; + bHavePlugins = sal_True; } return aDescriptions; } diff --git a/extensions/source/plugin/util/makefile.mk b/extensions/source/plugin/util/makefile.mk index cb5b751c7404..7b7d047a1779 100644 --- a/extensions/source/plugin/util/makefile.mk +++ b/extensions/source/plugin/util/makefile.mk @@ -99,3 +99,11 @@ SHL1STDLIBS+=$(SHL1OWNLIBS) + +ALLTAR : $(MISC)/pl.component + +$(MISC)/pl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + pl.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt pl.component diff --git a/extensions/source/plugin/util/pl.component b/extensions/source/plugin/util/pl.component new file mode 100644 index 000000000000..4a9d98f7dc7b --- /dev/null +++ b/extensions/source/plugin/util/pl.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.extensions.PluginManager"> + <service name="com.sun.star.plugin.PluginManager"/> + </implementation> + <implementation name="com.sun.star.extensions.PluginModel"> + <service name="com.sun.star.plugin.PluginModel"/> + </implementation> +</component> |