diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-08 10:01:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-08 10:01:44 +0000 |
commit | cfe3d74c60169b1b0ca010b31b8e5d705c0f58a7 (patch) | |
tree | 363dd9c3a7f866db0592d4ec4f34cef7639bec32 /extensions | |
parent | refactor SetTwoLines a little (diff) | |
download | core-cfe3d74c60169b1b0ca010b31b8e5d705c0f58a7.tar.gz core-cfe3d74c60169b1b0ca010b31b8e5d705c0f58a7.zip |
fix build against new npapi.h
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/plugin/base/makefile.mk | 1 | ||||
-rw-r--r-- | extensions/source/plugin/base/nfuncs.cxx | 38 | ||||
-rw-r--r-- | extensions/source/plugin/base/xplugin.cxx | 12 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/plcom.hxx | 4 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/unx/sysplug.hxx | 4 | ||||
-rw-r--r-- | extensions/source/plugin/unx/npnapi.cxx | 6 | ||||
-rw-r--r-- | extensions/source/plugin/unx/nppapi.cxx | 6 |
7 files changed, 34 insertions, 37 deletions
diff --git a/extensions/source/plugin/base/makefile.mk b/extensions/source/plugin/base/makefile.mk index 3049d9e9c0f9..a7e28f8deae5 100644 --- a/extensions/source/plugin/base/makefile.mk +++ b/extensions/source/plugin/base/makefile.mk @@ -37,7 +37,6 @@ INCPRE+=-I$(SOLARINCDIR)$/mozilla$/plugin .IF "$(SOLAR_JAVA)" != "" INCPRE+=-I$(SOLARINCDIR)$/mozilla$/java INCPRE+=-I$(SOLARINCDIR)$/mozilla$/nspr -CDEFS+=-DOJI .ENDIF .IF "$(WITH_MOZILLA)" != "NO" diff --git a/extensions/source/plugin/base/nfuncs.cxx b/extensions/source/plugin/base/nfuncs.cxx index 571ead19bae1..113aee54c5a8 100644 --- a/extensions/source/plugin/base/nfuncs.cxx +++ b/extensions/source/plugin/base/nfuncs.cxx @@ -96,6 +96,24 @@ using ::rtl::OUString; using ::rtl::OString; using ::rtl::OStringToOUString; +// Move deprecated functions which no longer appear in npapi.h before +// their use to avoid errors that they're undeclared at point of use +extern "C" +{ + const JRIEnvInterface** SAL_CALL NP_LOADDS NPN_GetJavaEnv() + { + TRACE( "NPN_GetJavaEnv" ); + // no java in this program + return NULL; + } + + jref SAL_CALL NP_LOADDS NPN_GetJavaPeer( NPP /*instance*/ ) + { + TRACE( "NPN_GetJavaPeer" ); + return NULL; + } +} + NPNetscapeFuncs aNPNFuncs = { sizeof( NPNetscapeFuncs ), @@ -112,13 +130,8 @@ NPNetscapeFuncs aNPNFuncs = NPN_MemFree, NPN_MemFlush, NPN_ReloadPlugins, -#ifdef OJI NPN_GetJavaEnv, NPN_GetJavaPeer, -#else - 0, - 0, -#endif NPN_GetURLNotify, NPN_PostURLNotify, NPN_GetValue, @@ -238,21 +251,6 @@ extern "C" { return NPERR_NO_ERROR; } - #ifdef OJI - const JRIEnvInterface** SAL_CALL NP_LOADDS NPN_GetJavaEnv() - { - TRACE( "NPN_GetJavaEnv" ); - // no java in this program - return NULL; - } - - jref SAL_CALL NP_LOADDS NPN_GetJavaPeer( NPP /*instance*/ ) - { - TRACE( "NPN_GetJavaPeer" ); - return NULL; - } - #endif - NPError SAL_CALL NP_LOADDS NPN_GetURL( NPP instance, const char* url, const char* window ) { TRACES( "NPN_GetURL", url ); diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index fd202ad5897d..5573176169f7 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -562,7 +562,7 @@ void XPlugin_Impl::loadPlugin() m_aEncoding).getStr(), getNPPInstance(), m_aPluginMode == PluginMode::FULL ? NP_FULL : NP_EMBED, - ::sal::static_int_cast< int16, int >( m_nArgs ), + ::sal::static_int_cast< int16_t, int >( m_nArgs ), (char**)(m_nArgs ? m_pArgn : NULL), (char**)(m_nArgs ? m_pArgv : NULL), NULL ); @@ -595,8 +595,8 @@ void XPlugin_Impl::loadPlugin() m_aNPWindow.clipRect.top = 0; m_aNPWindow.clipRect.left = 0; - m_aNPWindow.clipRect.bottom = ::sal::static_int_cast< uint16, sal_Int32 >( aPosSize.Height ); - m_aNPWindow.clipRect.right = ::sal::static_int_cast< uint16, sal_Int32 >( aPosSize.Width ); + m_aNPWindow.clipRect.bottom = ::sal::static_int_cast< uint16_t, sal_Int32 >( aPosSize.Height ); + m_aNPWindow.clipRect.right = ::sal::static_int_cast< uint16_t, sal_Int32 >( aPosSize.Width ); m_aNPWindow.type = NPWindowTypeWindow; m_aNPWindow.x = 0; @@ -742,7 +742,7 @@ sal_Bool XPlugin_Impl::provideNewStream(const OUString& mimetype, if( iter != m_aPEventListeners.end() ) pStream->getStream()->notifyData = (*iter)->getNotifyData(); - uint16 stype = 0; + uint16_t stype = 0; // special handling acrobat reader // presenting a seekable stream to it does not seem to work correctly @@ -876,8 +876,8 @@ void XPlugin_Impl::setPosSize( sal_Int32 nX_, sal_Int32 nY_, sal_Int32 nWidth_, m_aNPWindow.height = nHeight_; m_aNPWindow.clipRect.top = 0; m_aNPWindow.clipRect.left = 0; - m_aNPWindow.clipRect.right = ::sal::static_int_cast< uint16, sal_Int32 >( nWidth_ ); - m_aNPWindow.clipRect.bottom = ::sal::static_int_cast< uint16, sal_Int32 >( nHeight_ ); + m_aNPWindow.clipRect.right = ::sal::static_int_cast< uint16_t, sal_Int32 >( nWidth_ ); + m_aNPWindow.clipRect.bottom = ::sal::static_int_cast< uint16_t, sal_Int32 >( nHeight_ ); if( getPluginComm() ) getPluginComm()->NPP_SetWindow( this ); diff --git a/extensions/source/plugin/inc/plugin/plcom.hxx b/extensions/source/plugin/inc/plugin/plcom.hxx index b23fc6c6ada9..7436a15afcaf 100644 --- a/extensions/source/plugin/inc/plugin/plcom.hxx +++ b/extensions/source/plugin/inc/plugin/plcom.hxx @@ -59,12 +59,12 @@ public: virtual void* NPP_GetJavaClass() = 0; virtual NPError NPP_Initialize() = 0; virtual NPError NPP_New( NPMIMEType pluginType, NPP instance, - uint16 mode, int16 argc, + uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved ) = 0; virtual NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream, - NPBool seekable, uint16* stype ) = 0; + NPBool seekable, uint16_t* stype ) = 0; virtual void NPP_Print( NPP instance, NPPrint* platformPrint ) = 0; virtual NPError NPP_SetWindow( NPP instance, NPWindow* window ) = 0; virtual void NPP_Shutdown() = 0; diff --git a/extensions/source/plugin/inc/plugin/unx/sysplug.hxx b/extensions/source/plugin/inc/plugin/unx/sysplug.hxx index df44c149e30a..a10c68861164 100644 --- a/extensions/source/plugin/inc/plugin/unx/sysplug.hxx +++ b/extensions/source/plugin/inc/plugin/unx/sysplug.hxx @@ -56,11 +56,11 @@ public: virtual void* NPP_GetJavaClass(); virtual NPError NPP_Initialize(); virtual NPError NPP_New( NPMIMEType pluginType, NPP instance, - uint16 mode, int16 argc, + uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved ); virtual NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream, - NPBool seekable, uint16* stype ); + NPBool seekable, uint16_t* stype ); virtual void NPP_Print( NPP instance, NPPrint* platformPrint ); using PluginComm::NPP_SetWindow; diff --git a/extensions/source/plugin/unx/npnapi.cxx b/extensions/source/plugin/unx/npnapi.cxx index c0cefa35a556..837a1f238293 100644 --- a/extensions/source/plugin/unx/npnapi.cxx +++ b/extensions/source/plugin/unx/npnapi.cxx @@ -608,7 +608,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) pStream->pdata = pStream->ndata = pStream->notifyData = NULL; NPBool* pSeekable = (NPBool*)pMessage->GetBytes(); m_aNPWrapStreams.push_back( pStream ); - uint16 nStype = NP_ASFILE; + uint16_t nStype = NP_ASFILE; NPError aRet = aPluginFuncs.newstream( instance, pType, pStream, *pSeekable, &nStype ); medDebug( 1, "pluginapp: NPP_NewStream( %p, %s, %p, %s, %p ) returns %d\n" @@ -626,8 +626,8 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) case eNPP_New: { char* pType = pMessage->GetString(); - uint16* pMode = (uint16*)pMessage->GetBytes(); - int16* pArgc = (int16*)pMessage->GetBytes(); + uint16_t* pMode = (uint16_t*)pMessage->GetBytes(); + int16_t* pArgc = (int16_t*)pMessage->GetBytes(); NPP instance = new NPP_t; instance->pdata = instance->ndata = NULL; sal_uLong nArgnBytes, nArgvBytes; diff --git a/extensions/source/plugin/unx/nppapi.cxx b/extensions/source/plugin/unx/nppapi.cxx index add518cd54fc..34ce8f86c047 100644 --- a/extensions/source/plugin/unx/nppapi.cxx +++ b/extensions/source/plugin/unx/nppapi.cxx @@ -411,7 +411,7 @@ NPError UnxPluginComm::NPP_Initialize() return aRet; } -NPError UnxPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, +NPError UnxPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved ) { m_aInstances.push_back( @@ -473,7 +473,7 @@ NPError UnxPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode } NPError UnxPluginComm::NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream, - NPBool seekable, uint16* stype ) + NPBool seekable, uint16_t* stype ) { NPError aRet = NPERR_GENERIC_ERROR; GET_INSTANCE_RET( aRet ); @@ -493,7 +493,7 @@ NPError UnxPluginComm::NPP_NewStream( NPP instance, NPMIMEType type, NPStream* s return NPERR_GENERIC_ERROR; aRet = GetNPError( pMes ); - uint16* pSType = (uint16*)pMes->GetBytes(); + uint16_t* pSType = (uint16_t*)pMes->GetBytes(); *stype = *pSType; delete [] pSType; |