diff options
Diffstat (limited to 'extensions/source/plugin')
31 files changed, 759 insertions, 721 deletions
diff --git a/extensions/source/plugin/aqua/macmgr.cxx b/extensions/source/plugin/aqua/macmgr.cxx index b66963e420fb..cdcdf0c4ef37 100644 --- a/extensions/source/plugin/aqua/macmgr.cxx +++ b/extensions/source/plugin/aqua/macmgr.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -39,7 +39,7 @@ using namespace com::sun::star::plugin; namespace plugstringhelper { - + rtl::OUString getString( CFStringRef i_xString ) { rtl::OUStringBuffer aBuf; @@ -69,7 +69,7 @@ CFMutableStringRef createString( const rtl::OUString& i_rString ) CFURLRef createURL( const rtl::OUString& i_rString ) { - + CFMutableStringRef xMutableString = createString( i_rString ); CFURLRef xURL = CFURLCreateWithString( NULL, xMutableString, NULL ); CFRelease( xMutableString ); @@ -123,12 +123,12 @@ static int parsePlist( CFBundleRef i_xBundle, const rtl::OUString& i_rBundleURL { return 0; } - + // prepare an array of key and value refs std::vector< CFTypeRef > aKeys( nMimetypes, CFTypeRef(NULL) ); std::vector< CFTypeRef > aValues( nMimetypes, CFTypeRef(NULL) ); CFDictionaryGetKeysAndValues(static_cast<CFDictionaryRef>(xMimeDict), &aKeys[0], &aValues[0] ); - + int nAdded = 0; for( int i = 0; i < nMimetypes; i++ ) { @@ -137,7 +137,7 @@ static int parsePlist( CFBundleRef i_xBundle, const rtl::OUString& i_rBundleURL if( ! xKey || CFGetTypeID(xKey) != CFStringGetTypeID() ) continue; rtl::OUString aMimetype = getString( (CFStringRef)xKey ); - + // the correspoding value should be a dictionary CFTypeRef xDict = aValues[i]; if( ! xDict || CFGetTypeID( xDict ) != CFDictionaryGetTypeID() ) @@ -147,7 +147,7 @@ static int parsePlist( CFBundleRef i_xBundle, const rtl::OUString& i_rBundleURL CFTypeRef xExtArray = CFDictionaryGetValue( (CFDictionaryRef)xDict, CFSTR("WebPluginExtensions" ) ); if( !xExtArray || CFGetTypeID( xExtArray ) != CFArrayGetTypeID() ) continue; - + OUStringBuffer aExtBuf; int nExtensions = CFArrayGetCount( (CFArrayRef)xExtArray ); for( int n = 0; n < nExtensions; n++ ) @@ -163,7 +163,7 @@ static int parsePlist( CFBundleRef i_xBundle, const rtl::OUString& i_rBundleURL aExtBuf.append( aExt ); } } - + // get the description string CFTypeRef xDescString = CFDictionaryGetValue( (CFDictionaryRef)xDict, CFSTR("WebPluginTypeDescription" ) ); if( !xDescString || CFGetTypeID( xDescString ) != CFStringGetTypeID() ) @@ -172,14 +172,14 @@ static int parsePlist( CFBundleRef i_xBundle, const rtl::OUString& i_rBundleURL PluginDescription* pNew = new PluginDescription; // set plugin name (path to library) - pNew->PluginName = i_rBundleURL; + pNew->PluginName = i_rBundleURL; // set mimetype - pNew->Mimetype = aMimetype; + pNew->Mimetype = aMimetype; // set extension line - pNew->Extension = aExtBuf.makeStringAndClear(); + pNew->Extension = aExtBuf.makeStringAndClear(); // set description pNew->Description= aDescription; - + io_rDescriptions.push_back( pNew ); nAdded++; @@ -194,9 +194,9 @@ static int parsePlist( CFBundleRef i_xBundle, const rtl::OUString& i_rBundleURL OUStringToOString( pNew->Description, RTL_TEXTENCODING_UTF8 ).getStr() ); #endif - + } - + return nAdded; } @@ -204,12 +204,12 @@ static int parseMimeString( const rtl::OUString& i_rBundleURL , list< PluginDesc { if( ! i_pMime ) return 0; - + rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); - + OStringBuffer aMIME; aMIME.append( i_pMime ); - + if( aMIME.getLength() < 1 ) return 0; @@ -220,14 +220,14 @@ static int parseMimeString( const rtl::OUString& i_rBundleURL , list< PluginDesc while( nIndex != -1 ) { OString aType = aLine.getToken( 0, ';', nIndex ); - + sal_Int32 nTypeIndex = 0; - OString aMimetype = aType.getToken( 0, ':', nTypeIndex ); - OString aExtLine = aType.getToken( 0, ':', nTypeIndex ); + OString aMimetype = aType.getToken( 0, ':', nTypeIndex ); + OString aExtLine = aType.getToken( 0, ':', nTypeIndex ); if( nTypeIndex < 0 ) // ensure at least three tokens continue; - OString aDesc = aType.getToken( 0, ':', nTypeIndex ); - + OString aDesc = aType.getToken( 0, ':', nTypeIndex ); + // create extension list string sal_Int32 nExtIndex = 0; OStringBuffer aExtension; @@ -240,19 +240,19 @@ static int parseMimeString( const rtl::OUString& i_rBundleURL , list< PluginDesc if( nExtIndex != -1 ) aExtension.append( ';' ); } - + PluginDescription* pNew = new PluginDescription; // set plugin name (path to library) - pNew->PluginName = i_rBundleURL; + pNew->PluginName = i_rBundleURL; // set mimetype - pNew->Mimetype = OStringToOUString( aMimetype, aEncoding ); + pNew->Mimetype = OStringToOUString( aMimetype, aEncoding ); // set extension line - pNew->Extension = OStringToOUString( aExtension.makeStringAndClear(), aEncoding ); + pNew->Extension = OStringToOUString( aExtension.makeStringAndClear(), aEncoding ); // set description pNew->Description= OStringToOUString( aDesc, aEncoding ); io_rDescriptions.push_back( pNew ); nAdded++; - + #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "Inserting from mime string:\n" @@ -294,7 +294,7 @@ static int parseMimeResource( CFBundleRef i_xBundle, #endif xRes = 0; BPSupportedMIMETypes aMIMETypesStrangeStruct = {kBPSupportedMIMETypesStructVers_1, NULL, NULL}; - + BP_GetSupportedMIMETypesUPP pBPGetSupp = (BP_GetSupportedMIMETypesUPP)osl_getAsciiFunctionSymbol( i_rMod, "BP_GetSupportedMIMETypes" ); if( pBPGetSupp && noErr == pBPGetSupp( &aMIMETypesStrangeStruct, 0 ) && @@ -323,7 +323,7 @@ static int parseMimeResource( CFBundleRef i_xBundle, } } } - + if( aMIMETypesStrangeStruct.typeStrings && aMIMETypesStrangeStruct.infoStrings ) { short nVariantCount = (**(short**)aMIMETypesStrangeStruct.typeStrings) / 2; @@ -352,19 +352,19 @@ static int parseMimeResource( CFBundleRef i_xBundle, if( nExtIndex != -1 ) aExtension.append( sal_Unicode(';') ); } - + PluginDescription* pNew = new PluginDescription; // set plugin name (path to library) - pNew->PluginName = i_rBundleURL; + pNew->PluginName = i_rBundleURL; // set mimetype - pNew->Mimetype = aMimetype; + pNew->Mimetype = aMimetype; // set extension line - pNew->Extension = aExtension.makeStringAndClear(); + pNew->Extension = aExtension.makeStringAndClear(); // set description pNew->Description= aDescription; io_rDescriptions.push_back( pNew ); nAdded++; - + #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "Inserting from resource:\n" @@ -378,8 +378,8 @@ static int parseMimeResource( CFBundleRef i_xBundle, #endif } } - - + + // clean up if( aMIMETypesStrangeStruct.typeStrings ) { @@ -393,7 +393,7 @@ static int parseMimeResource( CFBundleRef i_xBundle, } if( xRes ) CFBundleCloseBundleResourceMap( i_xBundle, xRes ); - + return nAdded; } @@ -409,9 +409,9 @@ static bool checkBlackList( CFBundleRef i_xBundle ) CFTypeRef bundleversion = CFBundleGetValueForInfoDictionaryKey( i_xBundle, CFSTR("CFBundleVersion")); if( bundleversion && CFGetTypeID(bundleversion) == CFStringGetTypeID() ) aBundleVersion = getString( static_cast<CFStringRef>(bundleversion) ); - + bool bReject = false; - // #i102735# VLC plugin prior to 1.0 tends to crash + // #i102735# VLC plugin prior to 1.0 tends to crash if( aBundleName.equalsAscii( "VLC Plug-in" ) ) { sal_Int32 nIndex = 0; @@ -426,7 +426,7 @@ static bool checkBlackList( CFBundleRef i_xBundle ) { bReject = true; } - + #if OSL_DEBUG_LEVEL > 1 if( bReject ) fprintf( stderr, "rejecting plugin \"%s\" version %s\n", @@ -443,7 +443,7 @@ static int getPluginDescriptions( CFBundleRef i_xBundle , list< PluginDescriptio int nDescriptions = 0; if( ! i_xBundle ) return nDescriptions; - + if( checkBlackList( i_xBundle ) ) return 0; @@ -451,7 +451,7 @@ static int getPluginDescriptions( CFBundleRef i_xBundle , list< PluginDescriptio CFURLRef xURL = CFBundleCopyBundleURL( i_xBundle ); aPlugURL = getString( xURL ); CFRelease( xURL ); - + #if OSL_DEBUG_LEVEL > 1 rtl::OUString aPlugName, aPlugDescription; CFTypeRef name = CFBundleGetValueForInfoDictionaryKey( i_xBundle, CFSTR("WebPluginName")); @@ -461,15 +461,15 @@ static int getPluginDescriptions( CFBundleRef i_xBundle , list< PluginDescriptio CFTypeRef description = CFBundleGetValueForInfoDictionaryKey( i_xBundle, CFSTR("WebPluginDescription")); if( description && CFGetTypeID(description) == CFStringGetTypeID() ) aPlugDescription = getString( static_cast<CFStringRef>(description) ); - + fprintf( stderr, "URL: %s\nname: %s\ndescription: %s\n", rtl::OUStringToOString( aPlugURL, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( aPlugName, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( aPlugDescription, RTL_TEXTENCODING_UTF8 ).getStr() ); #endif - - + + // get location of plugin library CFURLRef xLibURL = CFBundleCopyExecutableURL( i_xBundle ); if( ! xLibURL ) @@ -477,7 +477,7 @@ static int getPluginDescriptions( CFBundleRef i_xBundle , list< PluginDescriptio // get the file system path rtl::OUString aModuleURL( CFURLtoOSLURL( xLibURL ) ); CFRelease( xLibURL ); - + #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "exec URL = %s\n", rtl::OUStringToOString( aModuleURL, RTL_TEXTENCODING_UTF8 ).getStr() ); #endif @@ -505,7 +505,7 @@ static int getPluginDescriptions( CFBundleRef i_xBundle , list< PluginDescriptio osl_unloadModule( aMod ); return nDescriptions; } - + // resolve the symbol that might get us the mimetypes const char* (*pGetMimeDescription)() = (const char*(*)())osl_getAsciiFunctionSymbol( aMod, "_NP_GetMIMEDescription" ); if( pGetMimeDescription ) @@ -521,7 +521,7 @@ static int getPluginDescriptions( CFBundleRef i_xBundle , list< PluginDescriptio } } } - + // and as last resort check the resource of the bundle nDescriptions = parseMimeResource( i_xBundle, aMod, aPlugURL, io_rDescriptions ); osl_unloadModule( aMod ); @@ -535,24 +535,24 @@ static bool CheckPlugin( const rtl::OUString& rPath, list< PluginDescription* >& #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "Trying path %s ... ", rtl::OUStringToOString( rPath, RTL_TEXTENCODING_UTF8 ).getStr() ); #endif - CFURLRef xURL = createURL( rPath ); - + CFURLRef xURL = createURL( rPath ); + CFArrayRef xBundles = CFBundleCreateBundlesFromDirectory( NULL, xURL, CFSTR("plugin") ); if( ! xBundles ) return false; - + CFIndex nBundles = CFArrayGetCount( xBundles ); - + #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "got %d bundles\n", (int)nBundles ); #endif - + int nDescriptions = 0; for( CFIndex i = 0; i < nBundles; i++ ) { CFBundleRef xBundle = (CFBundleRef)CFArrayGetValueAtIndex( xBundles, i ); nDescriptions += getPluginDescriptions( xBundle, rDescriptions ); - + CFRelease( xBundle ); } CFRelease( xBundles ); @@ -573,7 +573,7 @@ static rtl::OUString FindFolderURL( FSVolumeRefNum vRefNum, OSType folderType ) aRet = getString( xURL ); CFRelease( xURL ); } - + return aRet; } @@ -586,7 +586,7 @@ Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() th std::list<PluginDescription*> aPlugins; static const char* pNPXPluginPath = getenv( "MOZ_PLUGIN_PATH" ); - + // get directories std::list< rtl::OUString > aPaths; if( pNPXPluginPath ) @@ -598,7 +598,7 @@ Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() th aPaths.push_back( getString( xURL ) ); CFRelease( xURL ); } - + rtl::OUString aPath = FindFolderURL( kUserDomain, kInternetPlugInFolderType ); if( aPath.getLength() ) aPaths.push_back( aPath ); @@ -608,14 +608,14 @@ Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() th aPath = FindFolderURL( kOnAppropriateDisk, kInternetPlugInFolderType ); if( aPath.getLength() ) aPaths.push_back( aPath ); - - + + const Sequence< ::rtl::OUString >& rPaths( PluginManager::getAdditionalSearchPaths() ); for( sal_Int32 i = 0; i < rPaths.getLength(); i++ ) { aPaths.push_back( getURLFromPath( rPaths.getConstArray()[i] ) ); } - + for( std::list< rtl::OUString >::const_iterator it = aPaths.begin(); it != aPaths.end(); ++it ) { rtl::OUString aPath( *it ); @@ -624,8 +624,8 @@ Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() th #endif CheckPlugin( aPath, aPlugins ); } - - + + // create return value aDescriptions = Sequence<PluginDescription>( aPlugins.size() ); #if OSL_DEBUG_LEVEL > 1 diff --git a/extensions/source/plugin/aqua/sysplug.cxx b/extensions/source/plugin/aqua/sysplug.cxx index 81637eb2d564..ab3a9680f424 100644 --- a/extensions/source/plugin/aqua/sysplug.cxx +++ b/extensions/source/plugin/aqua/sysplug.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -207,7 +207,7 @@ MacPluginComm::MacPluginComm( const rtl::OUString& i_rMimetype, const rtl::OUStr { // initialize plugin function table memset( &m_aNPPfuncs, 0, sizeof( m_aNPPfuncs ) ); - + // load the bundle CFURLRef xURL = createURL( i_rBundle ); m_xBundle = CFBundleCreate( NULL, xURL ); @@ -246,7 +246,7 @@ MacPluginComm::MacPluginComm( const rtl::OUString& i_rMimetype, const rtl::OUStr m_aNPPfuncs.size = sizeof( m_aNPPfuncs ); m_aNPPfuncs.version = 0; - + m_eCall = eNP_Initialize; execute(); } @@ -276,7 +276,7 @@ BOOL MacPluginComm::retrieveFunction( const char* i_pName, void** o_ppFunc ) con return FALSE; *o_ppFunc = (void*)osl_getAsciiFunctionSymbol( m_hPlugLib, i_pName ); - + if( ! *o_ppFunc && m_xBundle ) { rtl::OUString aName( OUString::createFromAscii( *i_pName == '_' ? i_pName+1 : i_pName ) ); @@ -294,7 +294,7 @@ BOOL MacPluginComm::retrieveFunction( const char* i_pName, void** o_ppFunc ) con IMPL_LINK( MacPluginComm, NullTimerHdl, void*, EMPTYARG ) { // note: this is a Timer handler, we are already protected by the SolarMutex - + FakeEventRecord aRec; aRec.what = nullEvent; aRec.where.h = aRec.where.v = 20000; @@ -306,7 +306,7 @@ IMPL_LINK( MacPluginComm, NullTimerHdl, void*, EMPTYARG ) if( rPlugData.m_pPlugView ) // for safety do not dispatch null events before first NPP_SetWindow (*m_aNPPfuncs.event)( (*it)->getNPPInstance(), &aRec ); } - + return 0; } @@ -329,8 +329,8 @@ long MacPluginComm::doIt() NPError (*pEntry)( NPPluginFuncs* ); retrieveFunction( "NP_GetEntryPoints", (void**)&pEntry ); nErr = (*pEntry)( &m_aNPPfuncs ); - - DBG_ASSERT( nErr == NPERR_NO_ERROR, "NP_GetEntryPoints() failed!" ); + + DBG_ASSERT( nErr == NPERR_NO_ERROR, "NP_GetEntryPoints() failed!" ); } else { @@ -342,7 +342,7 @@ long MacPluginComm::doIt() case eNPP_Destroy: if( m_aNullEventClients.empty() ) delete m_pNullTimer, m_pNullTimer = NULL; - + TRACE( "eNPP_Destroy" ); nRet = (m_aNPPfuncs.destroy ? (*m_aNPPfuncs.destroy)( @@ -407,7 +407,7 @@ long MacPluginComm::doIt() (NPP)m_aArgs[0], (NPWindow*)m_aArgs[1] ) : NPERR_GENERIC_ERROR); - + break; } case eNPP_HandleEvent: @@ -418,7 +418,7 @@ long MacPluginComm::doIt() (NPP)m_aArgs[0], m_aArgs[1] ) : NPERR_GENERIC_ERROR); - + break; } case eNPP_StreamAsFile: @@ -500,9 +500,9 @@ NPError MacPluginComm::NPP_Destroy( XPlugin_Impl* i_pImpl, NPSavedData** save ) { // remove from NullEvent timer m_aNullEventClients.remove( i_pImpl ); - + NPError nErr = NPP_Destroy( i_pImpl->getNPPInstance(), save ); - + // release plugin view SysPlugData& rPlugData( i_pImpl->getSysPlugData() ); if( rPlugData.m_pPlugView ) @@ -511,7 +511,7 @@ NPError MacPluginComm::NPP_Destroy( XPlugin_Impl* i_pImpl, NPSavedData** save ) [rPlugData.m_pPlugView release]; rPlugData.m_pPlugView = nil; } - + return nErr; } @@ -545,7 +545,7 @@ NPError MacPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode if( pImpl ) // sanity check m_aNullEventClients.push_back( pImpl ); - + DBG_ASSERT( m_aNPPfuncs.newp, "### NPP_New(): null pointer in NPP functions table!" ); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "NPP_New( %s. %p, %d, %d", @@ -562,7 +562,7 @@ NPError MacPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode m_aArgs[4] = (void*)argn; m_aArgs[5] = (void*)argv; m_aArgs[6] = (void*)saved; - + return (NPError)execute(); } @@ -702,7 +702,7 @@ void MacPluginComm::NPP_Shutdown() NPError MacPluginComm::NPP_SetWindow( XPlugin_Impl* i_pImpl ) { // update window NPWindow from view - SysPlugData& rPlugData( i_pImpl->getSysPlugData() ); + SysPlugData& rPlugData( i_pImpl->getSysPlugData() ); // update plug view NSRect aPlugRect = [rPlugData.m_pParentView frame]; @@ -720,31 +720,31 @@ NPError MacPluginComm::NPP_SetWindow( XPlugin_Impl* i_pImpl ) NSRect aWinRect = [pWin frame]; NSRect aBounds = [rPlugData.m_pPlugView frame]; NSRect aVisibleBounds = [rPlugData.m_pPlugView visibleRect]; - + #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "visible bounds = %d+%d+%dx%d\n", (int)aVisibleBounds.origin.x, (int)aVisibleBounds.origin.y, (int)aVisibleBounds.size.width, (int)aVisibleBounds.size.height ); #endif - + NSPoint aViewOrigin = [rPlugData.m_pPlugView convertPoint: NSZeroPoint toView: nil]; // save view origin so we can notice movement of the view in drawView // in case of a moved view we need to reset the port/context rPlugData.m_aLastPlugViewOrigin = aViewOrigin; - + // convert view origin to topdown coordinates aViewOrigin.y = aWinRect.size.height - aViewOrigin.y; - + // same for clipping NSPoint aClipOrigin = [rPlugData.m_pPlugView convertPoint: aVisibleBounds.origin toView: nil]; aClipOrigin.y = aWinRect.size.height - aClipOrigin.y; - + #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "view origin: %d+%d, clip origin = %d+%d\n", (int)aViewOrigin.x, (int)aViewOrigin.y, (int)aClipOrigin.x, (int)aClipOrigin.y ); #endif - + pNPWin->x = aViewOrigin.x; pNPWin->y = aViewOrigin.y; pNPWin->width = aBounds.size.width; @@ -755,7 +755,7 @@ NPError MacPluginComm::NPP_SetWindow( XPlugin_Impl* i_pImpl ) pNPWin->clipRect.bottom = aClipOrigin.y + aVisibleBounds.size.height; if( rPlugData.m_nDrawingModel == 1 ) - { + { rPlugData.m_aCGContext.window = reinterpret_cast<WindowRef>([pWin windowRef]); pNPWin->window = &rPlugData.m_aCGContext; rPlugData.m_aCGContext.context = reinterpret_cast<CGContextRef>([[pWin graphicsContext] graphicsPort]); @@ -775,12 +775,12 @@ NPError MacPluginComm::NPP_SetWindow( XPlugin_Impl* i_pImpl ) rPlugData.m_aNPPort.port, (int)rPlugData.m_aNPPort.portx, (int)rPlugData.m_aNPPort.porty ); #endif } - + if( pNPWin->width == 0 || pNPWin->height == 0 || [rPlugData.m_pPlugView isHiddenOrHasHiddenAncestor] ) rPlugData.m_bSetWindowOnDraw = true; NPError nErr = NPP_SetWindow( i_pImpl->getNPPInstance(), i_pImpl->getNPWindow() ); - + return nErr; } diff --git a/extensions/source/plugin/base/context.cxx b/extensions/source/plugin/base/context.cxx index 27266579148e..a50fba278920 100644 --- a/extensions/source/plugin/base/context.cxx +++ b/extensions/source/plugin/base/context.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -47,19 +47,19 @@ using namespace com::sun::star::io; namespace ext_plug { - + class FileSink : public ::cppu::WeakAggImplHelper1< ::com::sun::star::io::XOutputStream > { private: - Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xSMgr; - FILE* fp; - Reference< ::com::sun::star::plugin::XPlugin > m_xPlugin; - ::rtl::OUString m_aMIMEType; - ::rtl::OUString m_aTarget; - ::rtl::OUString m_aFileName; + Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xSMgr; + FILE* fp; + Reference< ::com::sun::star::plugin::XPlugin > m_xPlugin; + ::rtl::OUString m_aMIMEType; + ::rtl::OUString m_aTarget; + ::rtl::OUString m_aFileName; public: - FileSink( const Reference< ::com::sun::star::lang::XMultiServiceFactory > &, + FileSink( const Reference< ::com::sun::star::lang::XMultiServiceFactory > &, const Reference< ::com::sun::star::plugin::XPlugin > & plugin, const ::rtl::OUString& mimetype, const ::rtl::OUString& target, @@ -77,8 +77,8 @@ using namespace ext_plug; class XPluginContext_Impl : public ::cppu::WeakAggImplHelper1< ::com::sun::star::plugin::XPluginContext > { - Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xSMgr; - rtl_TextEncoding m_aEncoding; + Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xSMgr; + rtl_TextEncoding m_aEncoding; public: XPluginContext_Impl( const Reference< ::com::sun::star::lang::XMultiServiceFactory > & ); @@ -137,7 +137,7 @@ void XPluginContext_Impl::getURL(const Reference< ::com::sun::star::plugin::XPlu 0, 0, (sal_Bool)(aUrl.compareToAscii( "file:", 5 ) == 0) ); return; } - + Reference< ::com::sun::star::frame::XComponentLoader > xLoader( xInst, UNO_QUERY ); XPlugin_Impl* pPlugin = XPluginManager_Impl::getPluginImplementation( plugin ); @@ -146,9 +146,9 @@ void XPluginContext_Impl::getURL(const Reference< ::com::sun::star::plugin::XPlu try { ::com::sun::star::beans::PropertyValue aValue; - aValue.Name = ::rtl::OUString::createFromAscii( "Referer" ); + aValue.Name = ::rtl::OUString::createFromAscii( "Referer" ); aValue.Value <<= pPlugin->getRefererURL(); - + Sequence< ::com::sun::star::beans::PropertyValue > aArgs( &aValue, 1 ); Reference< ::com::sun::star::lang::XComponent > xComp = xLoader->loadComponentFromURL( @@ -223,10 +223,10 @@ void XPluginContext_Impl::postURL(const Reference< ::com::sun::star::plugin::XPl try { ::com::sun::star::beans::PropertyValue aValues[2]; - aValues[0].Name = ::rtl::OUString::createFromAscii( "Referer" ); + aValues[0].Name = ::rtl::OUString::createFromAscii( "Referer" ); aValues[0].Value <<= pPlugin->getRefererURL(); - - aValues[1].Name = ::rtl::OUString::createFromAscii( "PostString" ); + + aValues[1].Name = ::rtl::OUString::createFromAscii( "PostString" ); aValues[1].Value <<= ::rtl::OStringToOUString( (char*)( file ? aBuf : buf ).getConstArray(), m_aEncoding ); Sequence< ::com::sun::star::beans::PropertyValue > aArgs( aValues, 2 ); Reference< ::com::sun::star::lang::XComponent > xComp = @@ -308,7 +308,7 @@ void FileSink::closeOutput() throw() ::com::sun::star::beans::PropertyValue aValue; aValue.Name = ::rtl::OUString::createFromAscii( "Referer" ); aValue.Value <<= pPlugin->getRefererURL(); - + Sequence< ::com::sun::star::beans::PropertyValue > aArgs( &aValue, 1 ); Reference< ::com::sun::star::lang::XComponent > xComp = xLoader->loadComponentFromURL( diff --git a/extensions/source/plugin/base/evtlstnr.cxx b/extensions/source/plugin/base/evtlstnr.cxx index fda829f99b72..bcb597db7230 100644 --- a/extensions/source/plugin/base/evtlstnr.cxx +++ b/extensions/source/plugin/base/evtlstnr.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/extensions/source/plugin/base/manager.cxx b/extensions/source/plugin/base/manager.cxx index 0526f3ed881b..7b4e4df292f1 100644 --- a/extensions/source/plugin/base/manager.cxx +++ b/extensions/source/plugin/base/manager.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/extensions/source/plugin/base/multiplx.cxx b/extensions/source/plugin/base/multiplx.cxx index 1957a9c19115..17fc499f4741 100644 --- a/extensions/source/plugin/base/multiplx.cxx +++ b/extensions/source/plugin/base/multiplx.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -30,9 +30,9 @@ #include <vos/diagnose.hxx> #include <plugin/multiplx.hxx> -// --------------------------------------------------------------------- -// class MRCListenerMultiplexerHelper -// --------------------------------------------------------------------- +// --------------------------------------------------------------------- +// class MRCListenerMultiplexerHelper +// --------------------------------------------------------------------- MRCListenerMultiplexerHelper::MRCListenerMultiplexerHelper ( const Reference< ::com::sun::star::awt::XWindow > & rControl @@ -171,32 +171,32 @@ void MRCListenerMultiplexerHelper::disposing(const ::com::sun::star::lang::Event xPeer = Reference< ::com::sun::star::awt::XWindow > (); } -#define MULTIPLEX( InterfaceName, MethodName, EventName ) \ -::cppu::OInterfaceContainerHelper * pCont; \ -pCont = aListenerHolder.getContainer( ::getCppuType((const Reference< InterfaceName >*)0) ); \ -if( pCont ) \ -{ \ - ::cppu::OInterfaceIteratorHelper aIt( *pCont ); \ - EventName aEvt = e; \ - /* Remark: The control is the event source not the peer. We must change */ \ - /* the source of the event */ \ +#define MULTIPLEX( InterfaceName, MethodName, EventName ) \ +::cppu::OInterfaceContainerHelper * pCont; \ +pCont = aListenerHolder.getContainer( ::getCppuType((const Reference< InterfaceName >*)0) ); \ +if( pCont ) \ +{ \ + ::cppu::OInterfaceIteratorHelper aIt( *pCont ); \ + EventName aEvt = e; \ + /* Remark: The control is the event source not the peer. We must change */ \ + /* the source of the event */ \ aEvt.Source = xControl;\ - /*.is the control not destroyed */ \ - if( aEvt.Source.is() ) \ - { \ - if( aIt.hasMoreElements() ) \ - { \ - InterfaceName * pListener = (InterfaceName *)aIt.next(); \ - try \ - { \ - pListener->MethodName( aEvt ); \ - } \ - catch( RuntimeException& ) \ - { \ - /* ignore all usr system exceptions from the listener */ \ - } \ - } \ - } \ + /*.is the control not destroyed */ \ + if( aEvt.Source.is() ) \ + { \ + if( aIt.hasMoreElements() ) \ + { \ + InterfaceName * pListener = (InterfaceName *)aIt.next(); \ + try \ + { \ + pListener->MethodName( aEvt ); \ + } \ + catch( RuntimeException& ) \ + { \ + /* ignore all usr system exceptions from the listener */ \ + } \ + } \ + } \ } // ::com::sun::star::awt::XFocusListener diff --git a/extensions/source/plugin/base/nfuncs.cxx b/extensions/source/plugin/base/nfuncs.cxx index f4164fd71a46..b67756dd67cd 100644 --- a/extensions/source/plugin/base/nfuncs.cxx +++ b/extensions/source/plugin/base/nfuncs.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -151,9 +151,9 @@ static ::rtl::OString normalizeURL( XPlugin_Impl* plugin, const ::rtl::OString& struct AsynchronousGetURL { - OUString aUrl; - OUString aTarget; - Reference< XEventListener > xListener; + OUString aUrl; + OUString aTarget; + Reference< XEventListener > xListener; DECL_LINK( getURL, XPlugin_Impl* ); }; @@ -280,9 +280,9 @@ extern "C" { pImpl->addPluginEventListener( pListener ); pListener = NULL; } - pAsync->aUrl = OStringToOUString( aLoadURL, pImpl->getTextEncoding() ); - pAsync->aTarget = OStringToOUString( target, pImpl->getTextEncoding() ); - pAsync->xListener = pListener; + pAsync->aUrl = OStringToOUString( aLoadURL, pImpl->getTextEncoding() ); + pAsync->aTarget = OStringToOUString( target, pImpl->getTextEncoding() ); + pAsync->xListener = pListener; pImpl->setLastGetUrl( aLoadURL ); Application::PostUserEvent( LINK( pAsync, AsynchronousGetURL, getURL ), pImpl ); @@ -543,7 +543,7 @@ NPError SAL_CALL NP_LOADDS NPN_GetValue( NPP instance, NPNVariable variable, vo if( ! pImpl ) return 0; - + NPError aResult( NPERR_NO_ERROR ); switch( variable ) @@ -615,9 +615,9 @@ NPError SAL_CALL NP_LOADDS NPN_SetValue( NPP instance, case (NPPVariable)1000: // NPNVpluginDrawingModel { int nDrawingModel = (int)value; // ugly, but that's the way we need to do it - + TRACEN( "drawing model: ", nDrawingModel ); - + XPlugin_Impl* pImpl = XPluginManager_Impl::getXPluginFromNPP( instance ); if( pImpl ) pImpl->getSysPlugData().m_nDrawingModel = nDrawingModel; diff --git a/extensions/source/plugin/base/plcom.cxx b/extensions/source/plugin/base/plcom.cxx index 09b4f1913d13..339768df83b2 100644 --- a/extensions/source/plugin/base/plcom.cxx +++ b/extensions/source/plugin/base/plcom.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/extensions/source/plugin/base/plctrl.cxx b/extensions/source/plugin/base/plctrl.cxx index cad58711b394..6825b408810d 100644 --- a/extensions/source/plugin/base/plctrl.cxx +++ b/extensions/source/plugin/base/plctrl.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -98,11 +98,11 @@ void PluginControl_Impl::dispose(void) void PluginControl_Impl::setPosSize( sal_Int32 nX_, sal_Int32 nY_, sal_Int32 nWidth_, sal_Int32 nHeight_, sal_Int16 nFlags ) throw( RuntimeException ) { - _nX = nX_ >=0 ? nX_ : 0; - _nY = nY_ >=0 ? nY_ : 0; - _nWidth = nWidth_ >=0 ? nWidth_ : 0; - _nHeight = nHeight_ >=0 ? nHeight_ : 0; - _nFlags = nFlags; + _nX = nX_ >=0 ? nX_ : 0; + _nY = nY_ >=0 ? nY_ : 0; + _nWidth = nWidth_ >=0 ? nWidth_ : 0; + _nHeight = nHeight_ >=0 ? nHeight_ : 0; + _nFlags = nFlags; if (_xPeerWindow.is()) _xPeerWindow->setPosSize( _nX, _nY, _nWidth, _nHeight, nFlags ); @@ -123,7 +123,7 @@ void PluginControl_Impl::setVisible( sal_Bool bVisible ) if (_xPeerWindow.is()) _xPeerWindow->setVisible( _bVisible && !_bInDesignMode ); } - + //---- ::com::sun::star::awt::XWindow ------------------------------------------------------------------------------------- void PluginControl_Impl::setEnable( sal_Bool bEnable ) throw( RuntimeException ) @@ -132,7 +132,7 @@ void PluginControl_Impl::setEnable( sal_Bool bEnable ) if (_xPeerWindow.is()) _xPeerWindow->setEnable( _bEnable ); } - + //---- ::com::sun::star::awt::XWindow ------------------------------------------------------------------------------------- void PluginControl_Impl::setFocus(void) throw( RuntimeException ) { @@ -148,9 +148,9 @@ void PluginControl_Impl::releasePeer() { _xParentWindow->removeFocusListener( this ); _xPeerWindow->dispose(); - _pSysChild = NULL; - _xPeerWindow = Reference< ::com::sun::star::awt::XWindow > (); - _xPeer = Reference< ::com::sun::star::awt::XWindowPeer > (); + _pSysChild = NULL; + _xPeerWindow = Reference< ::com::sun::star::awt::XWindow > (); + _xPeer = Reference< ::com::sun::star::awt::XWindowPeer > (); getMultiplexer()->setPeer( Reference< ::com::sun::star::awt::XWindow > () ); } } @@ -168,20 +168,20 @@ void PluginControl_Impl::createPeer( const Reference< ::com::sun::star::awt::XTo _xParentPeer = xParentPeer; _xParentWindow = Reference< ::com::sun::star::awt::XWindow > ( xParentPeer, UNO_QUERY ); DBG_ASSERT( _xParentWindow.is(), "### no parent peer window!" ); - + Window* pImpl = VCLUnoHelper::GetWindow( xParentPeer ); if (pImpl) { _pSysChild = new SystemChildWindow( pImpl, WB_CLIPCHILDREN ); if (pImpl->HasFocus()) _pSysChild->GrabFocus(); - + // get peer - _xPeer = Reference< ::com::sun::star::awt::XWindowPeer > ( _pSysChild->GetComponentInterface() ); - _xPeerWindow = Reference< ::com::sun::star::awt::XWindow > ( _xPeer, UNO_QUERY ); + _xPeer = Reference< ::com::sun::star::awt::XWindowPeer > ( _pSysChild->GetComponentInterface() ); + _xPeerWindow = Reference< ::com::sun::star::awt::XWindow > ( _xPeer, UNO_QUERY ); // !_BOTH_ MUST BE VALID! DBG_ASSERT( (_xPeer.is() && _xPeerWindow.is()), "### no peer!" ); - + _xParentWindow->addFocusListener( this ); _xPeerWindow->setPosSize( _nX, _nY, _nWidth, _nHeight, _nFlags ); _xPeerWindow->setEnable( _bEnable ); @@ -219,7 +219,7 @@ void PluginControl_Impl::removePaintListener( const Reference< ::com::sun::star: } //---- ::com::sun::star::awt::XWindow ------------------------------------------------------------------------------------- -void PluginControl_Impl::addWindowListener( const Reference< ::com::sun::star::awt::XWindowListener > & l ) +void PluginControl_Impl::addWindowListener( const Reference< ::com::sun::star::awt::XWindowListener > & l ) throw( RuntimeException ) { getMultiplexer()->advise( ::getCppuType((const Reference< ::com::sun::star::awt::XWindowListener >*)0), l ); diff --git a/extensions/source/plugin/base/plmodel.cxx b/extensions/source/plugin/base/plmodel.cxx index 7e14ecd45d70..52fa9a676c5f 100644 --- a/extensions/source/plugin/base/plmodel.cxx +++ b/extensions/source/plugin/base/plmodel.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -114,13 +114,13 @@ Reference< ::com::sun::star::beans::XPropertySetInfo > PluginModel::getProperty } sal_Bool PluginModel::convertFastPropertyValue( Any & rConvertedValue, - Any & rOldValue, + Any & rOldValue, sal_Int32 nHandle, const Any& rValue ) throw() { if( nHandle == 1 || nHandle == 2 ) { - if( rValue.getValueTypeClass() == TypeClass_STRING ) + if( rValue.getValueTypeClass() == TypeClass_STRING ) { rConvertedValue = rValue; if( nHandle == 2 ) @@ -181,7 +181,7 @@ void PluginModel::dispose(void) throw() (*it)->disposing( aEvt ); m_aDisposeListeners.clear(); - + disposing(); } diff --git a/extensions/source/plugin/base/service.cxx b/extensions/source/plugin/base/service.cxx index de74d05060db..3a4b8b78eacd 100644 --- a/extensions/source/plugin/base/service.cxx +++ b/extensions/source/plugin/base/service.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -61,17 +61,17 @@ extern "C" { try { Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pXUnoKey ) ); - + ::rtl::OUString aImplName = ::rtl::OUString::createFromAscii( "/" ); aImplName += XPluginManager_Impl::getImplementationName_Static(); aImplName += ::rtl::OUString::createFromAscii( "/UNO/SERVICES/com.sun.star.plugin.PluginManager" ); xKey->createKey( aImplName ); - + aImplName = ::rtl::OUString::createFromAscii( "/" ); aImplName += PluginModel::getImplementationName_Static(); aImplName += ::rtl::OUString::createFromAscii( "/UNO/SERVICES/com.sun.star.plugin.PluginModel" ); xKey->createKey( aImplName ); - + return sal_True; } catch( ::com::sun::star::registry::InvalidRegistryException& ) diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index a501d23f269b..b9c400d07553 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -277,14 +277,14 @@ void XPlugin_Impl::freeArgs() void XPlugin_Impl::prependArg( const char* pName, const char* pValue ) { - const char** pNewNames = new const char*[m_nArgs+1]; - const char** pNewValues = new const char*[m_nArgs+1]; - - pNewNames[0] = strdup( pName ); - pNewValues[0] = strdup( pValue ); + const char** pNewNames = new const char*[m_nArgs+1]; + const char** pNewValues = new const char*[m_nArgs+1]; + + pNewNames[0] = strdup( pName ); + pNewValues[0] = strdup( pValue ); for( int nIndex = 0; nIndex < m_nArgs; ++nIndex ) { - pNewNames[nIndex+1] = m_pArgn[nIndex]; + pNewNames[nIndex+1] = m_pArgn[nIndex]; pNewValues[nIndex+1]= m_pArgv[nIndex]; } // free old arrays @@ -319,7 +319,7 @@ void XPlugin_Impl::handleSpecialArgs() { } } - + if( aURL.getLength() ) { // set new args, old args need not be freed as there were none set @@ -328,23 +328,23 @@ void XPlugin_Impl::handleSpecialArgs() m_pArgv = new const char*[m_nArgs]; // SRC - m_pArgn[0] = strdup( "SRC" ); - m_pArgv[0] = strdup( OUStringToOString( aURL, m_aEncoding ).getStr() ); + m_pArgn[0] = strdup( "SRC" ); + m_pArgv[0] = strdup( OUStringToOString( aURL, m_aEncoding ).getStr() ); // WIDTH - m_pArgn[1] = strdup( "WIDTH" ); - m_pArgv[1] = strdup( "200" ); + m_pArgn[1] = strdup( "WIDTH" ); + m_pArgv[1] = strdup( "200" ); // HEIGHT - m_pArgn[2] = strdup( "HEIGHT" ); - m_pArgv[2] = strdup( "200" ); + m_pArgn[2] = strdup( "HEIGHT" ); + m_pArgv[2] = strdup( "200" ); // CONTROLS - m_pArgn[3] = strdup( "CONTROLS" ); - m_pArgv[3] = strdup( "PlayButton,StopButton,ImageWindow" ); + m_pArgn[3] = strdup( "CONTROLS" ); + m_pArgv[3] = strdup( "PlayButton,StopButton,ImageWindow" ); // AUTOSTART - m_pArgn[4] = strdup( "AUTOSTART" ); - m_pArgv[4] = strdup( "TRUE" ); + m_pArgn[4] = strdup( "AUTOSTART" ); + m_pArgv[4] = strdup( "TRUE" ); // NOJAVA - m_pArgn[5] = strdup( "NOJAVA" ); - m_pArgv[5] = strdup( "TRUE" ); + m_pArgn[5] = strdup( "NOJAVA" ); + m_pArgv[5] = strdup( "TRUE" ); } } // #69333# special for pdf @@ -352,7 +352,7 @@ void XPlugin_Impl::handleSpecialArgs() m_aPluginMode = PluginMode::FULL; // see if we have a TYPE tag - int nIndex; + int nIndex; for( nIndex = 0; nIndex < m_nArgs; ++nIndex ) if( m_pArgn[nIndex][0] == 'T' && m_pArgn[nIndex][1] == 'Y' && @@ -869,15 +869,15 @@ void XPlugin_Impl::setPosSize( sal_Int32 nX_, sal_Int32 nY_, sal_Int32 nWidth_, PluginControl_Impl::setPosSize(nX_, nY_, nWidth_, nHeight_, nFlags); - m_aNPWindow.x = 0; - m_aNPWindow.y = 0; - m_aNPWindow.width = 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.x = 0; + m_aNPWindow.y = 0; + m_aNPWindow.width = 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_ ); + if( getPluginComm() ) getPluginComm()->NPP_SetWindow( this ); } diff --git a/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx b/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx index 941725b1f53d..900deb6a38ec 100644 --- a/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx +++ b/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -69,7 +69,7 @@ rtl::OUString CFURLtoOSLURL( CFURLRef i_xURL ); class MacPluginComm : public PluginComm, public ::vcl::SolarThreadExecutor - + { enum CallType { eNPP_Destroy, @@ -91,13 +91,13 @@ class MacPluginComm : eNP_Initialize }; - void* m_aArgs[ 8 ]; - CallType m_eCall; - - virtual long doIt(); + void* m_aArgs[ 8 ]; + CallType m_eCall; + + virtual long doIt(); public: MacPluginComm( const rtl::OUString& rMIME, const rtl::OUString& rName, NSView* pView ); - virtual ~MacPluginComm(); + virtual ~MacPluginComm(); // FIXME: // this actually should be from the NP headers @@ -110,39 +110,39 @@ public: } NP_CGContext; public: - virtual NPError NPP_Destroy( NPP instance, NPSavedData** save ); - virtual NPError NPP_DestroyStream( NPP instance, NPStream* stream, NPError reason ); - virtual void * NPP_GetJavaClass(); - virtual NPError NPP_Initialize(); - virtual NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, + virtual NPError NPP_Destroy( NPP instance, NPSavedData** save ); + virtual NPError NPP_DestroyStream( NPP instance, NPStream* stream, NPError reason ); + virtual void * NPP_GetJavaClass(); + virtual NPError NPP_Initialize(); + virtual NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData *saved ); - virtual NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream, + virtual NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype ); - virtual void NPP_Print( NPP instance, NPPrint* platformPrint ); - virtual NPError NPP_SetWindow( NPP instance, NPWindow* window ); - virtual void NPP_Shutdown(); - virtual void NPP_StreamAsFile( NPP instance, NPStream* stream, const char* fname ); - virtual void NPP_URLNotify( NPP instance, const char* url, + virtual void NPP_Print( NPP instance, NPPrint* platformPrint ); + virtual NPError NPP_SetWindow( NPP instance, NPWindow* window ); + virtual void NPP_Shutdown(); + virtual void NPP_StreamAsFile( NPP instance, NPStream* stream, const char* fname ); + virtual void NPP_URLNotify( NPP instance, const char* url, NPReason reason, void* notifyData ); - virtual int32 NPP_Write( NPP instance, NPStream* stream, int32 offset, + virtual int32 NPP_Write( NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer ); - virtual int32 NPP_WriteReady( NPP instance, NPStream* stream ); - virtual NPError NPP_GetValue( NPP instance, NPPVariable variable, void *ret_value ); - virtual NPError NPP_SetValue( NPP instance, NPNVariable variable, void *ret_value ); + virtual int32 NPP_WriteReady( NPP instance, NPStream* stream ); + virtual NPError NPP_GetValue( NPP instance, NPPVariable variable, void *ret_value ); + virtual NPError NPP_SetValue( NPP instance, NPNVariable variable, void *ret_value ); virtual int16 NPP_HandleEvent( NPP instance, void* event ); virtual NPError NPP_SetWindow( XPlugin_Impl* ); virtual NPError NPP_Destroy( XPlugin_Impl*, NPSavedData** save ); - + void drawView( XPlugin_Impl* ); private: - BOOL retrieveFunction( const char* i_pName, void** i_ppFunc ) const; + BOOL retrieveFunction( const char* i_pName, void** i_ppFunc ) const; DECL_LINK( NullTimerHdl, void* ); - + private: CFBundleRef m_xBundle; - oslModule m_hPlugLib; - NPPluginFuncs m_aNPPfuncs; + oslModule m_hPlugLib; + NPPluginFuncs m_aNPPfuncs; // timer for sending nullEvents AutoTimer* m_pNullTimer; diff --git a/extensions/source/plugin/inc/plugin/impl.hxx b/extensions/source/plugin/inc/plugin/impl.hxx index 6aa7ec7cca14..df44a793e8ee 100644 --- a/extensions/source/plugin/inc/plugin/impl.hxx +++ b/extensions/source/plugin/inc/plugin/impl.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -68,11 +68,11 @@ #include <list> -#ifdef WNT +#ifdef WNT #include "plugin/win/sysplug.hxx" #endif -#ifdef WNT +#ifdef WNT #include <plugin/win/sysplug.hxx> #elif defined(OS2) #include "plugin/os2/sysplug.hxx" @@ -99,9 +99,9 @@ typedef int SysPlugData; using namespace com::sun::star::uno; -#define PROVIDING_NONE 0 -#define PROVIDING_NOW 1 -#define PROVIDING_MODEL_UPDATE 2 +#define PROVIDING_NONE 0 +#define PROVIDING_NOW 1 +#define PROVIDING_MODEL_UPDATE 2 // forwards namespace ucbhelper { class Content; } @@ -117,36 +117,36 @@ class XPlugin_Impl : public com::sun::star::plugin::XPlugin, public com::sun::star::beans::XPropertyChangeListener { private: - ::osl::Mutex m_aMutex; - Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr; - Reference< com::sun::star::plugin::XPluginContext > m_rBrowserContext; + ::osl::Mutex m_aMutex; + Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr; + Reference< com::sun::star::plugin::XPluginContext > m_rBrowserContext; - PluginComm* m_pPluginComm; - NPP_t m_aInstance; - NPWindow m_aNPWindow; + PluginComm* m_pPluginComm; + NPP_t m_aInstance; + NPWindow m_aNPWindow; SysPlugData m_aSysPlugData; - rtl_TextEncoding m_aEncoding; + rtl_TextEncoding m_aEncoding; - const char** m_pArgv; - const char** m_pArgn; - int m_nArgs; - rtl::OString m_aLastGetUrl; + const char** m_pArgv; + const char** m_pArgn; + int m_nArgs; + rtl::OString m_aLastGetUrl; - Reference< com::sun::star::awt::XControlModel > m_xModel; + Reference< com::sun::star::awt::XControlModel > m_xModel; - ::com::sun::star::plugin::PluginDescription m_aDescription; - sal_Int16 m_aPluginMode; + ::com::sun::star::plugin::PluginDescription m_aDescription; + sal_Int16 m_aPluginMode; - int m_nProvidingState; - int m_nCalledFromPlugin; - PluginDisposer* m_pDisposer; + int m_nProvidingState; + int m_nCalledFromPlugin; + PluginDisposer* m_pDisposer; - ::std::list<PluginInputStream*> m_aInputStreams; - ::std::list<PluginOutputStream*> m_aOutputStreams; - ::std::list<PluginEventListener*> m_aPEventListeners; - ::rtl::OUString m_aURL; + ::std::list<PluginInputStream*> m_aInputStreams; + ::std::list<PluginOutputStream*> m_aOutputStreams; + ::std::list<PluginEventListener*> m_aPEventListeners; + ::rtl::OUString m_aURL; - sal_Bool m_bIsDisposed; + sal_Bool m_bIsDisposed; void prependArg( const char* pName, const char* pValue ); // arguments will be strdup'ed void initArgs( const Sequence< rtl::OUString >& argn, @@ -154,7 +154,7 @@ private: sal_Int16 mode ); void freeArgs(); void handleSpecialArgs(); - + void loadPlugin(); void destroyInstance(); void modelChanged(); @@ -164,7 +164,7 @@ public: virtual ~XPlugin_Impl(); ::osl::Mutex& getMutex() { return m_aMutex; } - + void destroyStreams(); void setLastGetUrl( const rtl::OString& rUrl ) { m_aLastGetUrl = rUrl; } @@ -173,8 +173,8 @@ public: ::std::list<PluginInputStream*>& getInputStreams() { return m_aInputStreams; } ::std::list<PluginOutputStream*>& getOutputStreams() { return m_aOutputStreams; } - PluginComm* getPluginComm() { return m_pPluginComm; } - void setPluginComm( PluginComm* comm ) + PluginComm* getPluginComm() { return m_pPluginComm; } + void setPluginComm( PluginComm* comm ) { if( ! m_pPluginComm ) { @@ -185,32 +185,32 @@ public: Reference< com::sun::star::lang::XMultiServiceFactory > getServiceManager() { return m_xSMgr; } const com::sun::star::plugin::PluginDescription& getDescription() const { return m_aDescription; } rtl_TextEncoding getTextEncoding() { return m_aEncoding; } - NPP getNPPInstance() { return &m_aInstance; } - NPWindow* getNPWindow() { return &m_aNPWindow; } + NPP getNPPInstance() { return &m_aInstance; } + NPWindow* getNPWindow() { return &m_aNPWindow; } SysPlugData& getSysPlugData() { return m_aSysPlugData; } - void enterPluginCallback() { m_nCalledFromPlugin++; } - void leavePluginCallback() { m_nCalledFromPlugin--; } - sal_Bool isDisposable() { return m_nCalledFromPlugin < 1 ? sal_True : sal_False; } - DECL_LINK( secondLevelDispose, XPlugin_Impl* ); + void enterPluginCallback() { m_nCalledFromPlugin++; } + void leavePluginCallback() { m_nCalledFromPlugin--; } + sal_Bool isDisposable() { return m_nCalledFromPlugin < 1 ? sal_True : sal_False; } + DECL_LINK( secondLevelDispose, XPlugin_Impl* ); void addPluginEventListener( PluginEventListener* pListener ) { m_aPEventListeners.push_back( pListener ); } void checkListeners( const char* normalizedURL ); - - void initInstance( + + void initInstance( const com::sun::star::plugin::PluginDescription& rDescription, const Sequence< rtl::OUString >& argn, const Sequence< rtl::OUString >& argv, sal_Int16 mode ); - void initInstance( + void initInstance( const rtl::OUString& rURL, const Sequence< rtl::OUString >& argn, const Sequence< rtl::OUString >& argv, sal_Int16 mode ); - const rtl::OUString& getRefererURL() { return m_aURL; } - ::rtl::OUString getCreationURL(); + const rtl::OUString& getRefererURL() { return m_aURL; } + ::rtl::OUString getCreationURL(); PluginStream* getStreamFromNPStream( NPStream* ); @@ -222,11 +222,11 @@ public: void setPluginContext( const Reference< com::sun::star::plugin::XPluginContext > & ); void secondLevelDispose(); - -// static const Reference< com::sun::star::reflection::XIdlClass > & staticGetIdlClass(); + +// static const Reference< com::sun::star::reflection::XIdlClass > & staticGetIdlClass(); // XInterface - virtual Any SAL_CALL queryInterface( const Type& ) throw( com::sun::star::uno::RuntimeException ); + virtual Any SAL_CALL queryInterface( const Type& ) throw( com::sun::star::uno::RuntimeException ); virtual void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } virtual void SAL_CALL release() throw() @@ -257,12 +257,12 @@ public: class PluginManager { private: - Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr; - ::std::list<PluginComm*> m_aPluginComms; - ::std::list<XPlugin_Impl*> m_aAllPlugins; - ::osl::Mutex m_aPluginMutex; + Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr; + ::std::list<PluginComm*> m_aPluginComms; + ::std::list<XPlugin_Impl*> m_aAllPlugins; + ::osl::Mutex m_aPluginMutex; - static PluginManager* pManager; + static PluginManager* pManager; PluginManager(); public: @@ -279,7 +279,7 @@ public: class XPluginManager_Impl : public cppu::WeakAggImplHelper1< com::sun::star::plugin::XPluginManager > { - Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr; + Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr; public: XPluginManager_Impl( const Reference< com::sun::star::lang::XMultiServiceFactory > & ); virtual ~XPluginManager_Impl(); @@ -301,10 +301,10 @@ public: virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw(); virtual rtl::OUString SAL_CALL getImplementationName() throw(); - + Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ); static Sequence< rtl::OUString > getSupportedServiceNames_Static(void) throw( ); - static rtl::OUString getImplementationName_Static() throw( ) + static rtl::OUString getImplementationName_Static() throw( ) { /** the soplayer uses this name in its source! maybe not after 5.2 */ return rtl::OUString::createFromAscii( "com.sun.star.extensions.PluginManager" ); @@ -317,8 +317,8 @@ enum PluginStreamType { InputStream, OutputStream }; class PluginStream { protected: - XPlugin_Impl* m_pPlugin; - NPStream m_aNPStream; + XPlugin_Impl* m_pPlugin; + NPStream m_aNPStream; public: PluginStream( XPlugin_Impl* pPlugin, const char* url, sal_uInt32 len, sal_uInt32 lastmod ); @@ -338,26 +338,26 @@ class PluginInputStream : > { private: - ::ucbhelper::Content* m_pContent; - sal_Int32 m_nMode; - UINT32 m_nWritePos; + ::ucbhelper::Content* m_pContent; + sal_Int32 m_nMode; + UINT32 m_nWritePos; - Reference< com::sun::star::io::XActiveDataSource > m_xSource; + Reference< com::sun::star::io::XActiveDataSource > m_xSource; // hold a reference on input until closeOutput is called - - Reference< com::sun::star::io::XConnectable > m_xPredecessor; - Reference< com::sun::star::io::XConnectable > m_xSuccessor; + + Reference< com::sun::star::io::XConnectable > m_xPredecessor; + Reference< com::sun::star::io::XConnectable > m_xSuccessor; // needed to hold a reference to self in NP_SEEK mode - Reference< com::sun::star::io::XOutputStream > m_xSelf; - - SvFileStream m_aFileStream; + Reference< com::sun::star::io::XOutputStream > m_xSelf; + + SvFileStream m_aFileStream; public: PluginInputStream( XPlugin_Impl* pPlugin, const char* url, UINT32 len, UINT32 lastmod ); PluginInputStream() : PluginStream( NULL, NULL, 0, 0 ) {} - + virtual ~PluginInputStream(); virtual PluginStreamType getStreamType(); @@ -369,7 +369,7 @@ public: void load(); // clear reference - bool releaseSelf() + bool releaseSelf() { bool bRet = m_xSelf.is(); m_xSelf.clear(); return bRet; } // XOutputStream @@ -392,7 +392,7 @@ public: class PluginOutputStream : public PluginStream { private: - Reference< com::sun::star::io::XOutputStream > m_xStream; + Reference< com::sun::star::io::XOutputStream > m_xStream; public: PluginOutputStream( XPlugin_Impl* pPlugin, const char* url, sal_uInt32 len, sal_uInt32 lastmod ); @@ -407,11 +407,11 @@ class PluginEventListener : public cppu::WeakAggImplHelper1< com::sun::star::lang::XEventListener > { private: - XPlugin_Impl* m_pPlugin; - Reference< com::sun::star::plugin::XPlugin > m_xPlugin; // just to hold the plugin - char* m_pUrl; - char* m_pNormalizedUrl; - void* m_pNotifyData; + XPlugin_Impl* m_pPlugin; + Reference< com::sun::star::plugin::XPlugin > m_xPlugin; // just to hold the plugin + char* m_pUrl; + char* m_pNormalizedUrl; + void* m_pNotifyData; public: PluginEventListener( XPlugin_Impl*, const char* url, @@ -421,8 +421,8 @@ public: const char* getURL() { return m_pUrl; } const char* getNormalizedURL() { return m_pNormalizedUrl; } - void* getNotifyData() { return m_pNotifyData; } - + void* getNotifyData() { return m_pNotifyData; } + // com::sun::star::lang::XEventListener virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw(); }; diff --git a/extensions/source/plugin/inc/plugin/model.hxx b/extensions/source/plugin/inc/plugin/model.hxx index 9f9ac01f0ac3..b21bd1f7dc58 100644 --- a/extensions/source/plugin/inc/plugin/model.hxx +++ b/extensions/source/plugin/inc/plugin/model.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -55,7 +55,7 @@ public: ~BroadcasterHelperHolder() {} ::cppu::OBroadcastHelper& getHelper() { return m_aHelper; } - + }; class PluginModel : public BroadcasterHelperHolder, @@ -110,7 +110,7 @@ class PluginModel : public BroadcasterHelperHolder, // OPropertySetHelper virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); virtual sal_Bool SAL_CALL convertFastPropertyValue( Any & rConvertedValue, - Any & rOldValue, + Any & rOldValue, sal_Int32 nHandle, const Any& rValue ) throw(); virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, diff --git a/extensions/source/plugin/inc/plugin/multiplx.hxx b/extensions/source/plugin/inc/plugin/multiplx.hxx index 45b60c12313d..7892155e7292 100644 --- a/extensions/source/plugin/inc/plugin/multiplx.hxx +++ b/extensions/source/plugin/inc/plugin/multiplx.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -62,7 +62,7 @@ struct MRCListenerMultiplexerHelper_Mutex ::osl::Mutex aMutex; }; -class MRCListenerMultiplexerHelper : +class MRCListenerMultiplexerHelper : public MRCListenerMultiplexerHelper_Mutex, public ::cppu::WeakAggImplHelper7< @@ -78,17 +78,17 @@ public: /** * Create a Multiplexer of XWindowEvents. * - * @param rControl The control. All listeners think that this is the original - * broadcaster. - * @param rPeer The peer from which the original events are dispatched. Null is - * allowed. + * @param rControl The control. All listeners think that this is the original + * broadcaster. + * @param rPeer The peer from which the original events are dispatched. Null is + * allowed. */ MRCListenerMultiplexerHelper( const Reference< ::com::sun::star::awt::XWindow > & rControl, const Reference< ::com::sun::star::awt::XWindow > & rPeer ); /** * Remove all listeners from the previous set peer and add the needed listeners to rPeer. - * @param rPeer The peer from which the original events are dispatched. Null is - * allowed. + * @param rPeer The peer from which the original events are dispatched. Null is + * allowed. */ void setPeer( const Reference< ::com::sun::star::awt::XWindow > & rPeer ); @@ -107,61 +107,61 @@ public: void unadvise(const Type& type, const Reference< XInterface > & listener); // ::com::sun::star::lang::XEventListener - void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(); + void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw(); // ::com::sun::star::awt::XFocusListener - void SAL_CALL focusGained(const ::com::sun::star::awt::FocusEvent& e) throw(); - void SAL_CALL focusLost(const ::com::sun::star::awt::FocusEvent& e) throw(); + void SAL_CALL focusGained(const ::com::sun::star::awt::FocusEvent& e) throw(); + void SAL_CALL focusLost(const ::com::sun::star::awt::FocusEvent& e) throw(); // ::com::sun::star::awt::XWindowListener - void SAL_CALL windowResized(const ::com::sun::star::awt::WindowEvent& e) throw(); - void SAL_CALL windowMoved(const ::com::sun::star::awt::WindowEvent& e) throw(); - void SAL_CALL windowShown(const ::com::sun::star::lang::EventObject& e) throw(); - void SAL_CALL windowHidden(const ::com::sun::star::lang::EventObject& e) throw(); + void SAL_CALL windowResized(const ::com::sun::star::awt::WindowEvent& e) throw(); + void SAL_CALL windowMoved(const ::com::sun::star::awt::WindowEvent& e) throw(); + void SAL_CALL windowShown(const ::com::sun::star::lang::EventObject& e) throw(); + void SAL_CALL windowHidden(const ::com::sun::star::lang::EventObject& e) throw(); // ::com::sun::star::awt::XKeyListener - void SAL_CALL keyPressed( const ::com::sun::star::awt::KeyEvent& e ) throw(); - void SAL_CALL keyReleased( const ::com::sun::star::awt::KeyEvent& e ) throw(); + void SAL_CALL keyPressed( const ::com::sun::star::awt::KeyEvent& e ) throw(); + void SAL_CALL keyReleased( const ::com::sun::star::awt::KeyEvent& e ) throw(); // ::com::sun::star::awt::XMouseListener - void SAL_CALL mousePressed(const ::com::sun::star::awt::MouseEvent& e) throw(); - void SAL_CALL mouseReleased(const ::com::sun::star::awt::MouseEvent& e) throw(); - void SAL_CALL mouseEntered(const ::com::sun::star::awt::MouseEvent& e) throw(); - void SAL_CALL mouseExited(const ::com::sun::star::awt::MouseEvent& e) throw(); + void SAL_CALL mousePressed(const ::com::sun::star::awt::MouseEvent& e) throw(); + void SAL_CALL mouseReleased(const ::com::sun::star::awt::MouseEvent& e) throw(); + void SAL_CALL mouseEntered(const ::com::sun::star::awt::MouseEvent& e) throw(); + void SAL_CALL mouseExited(const ::com::sun::star::awt::MouseEvent& e) throw(); // ::com::sun::star::awt::XMouseMotionListener - void SAL_CALL mouseDragged(const ::com::sun::star::awt::MouseEvent& e) throw(); - void SAL_CALL mouseMoved(const ::com::sun::star::awt::MouseEvent& e) throw(); + void SAL_CALL mouseDragged(const ::com::sun::star::awt::MouseEvent& e) throw(); + void SAL_CALL mouseMoved(const ::com::sun::star::awt::MouseEvent& e) throw(); // ::com::sun::star::awt::XPaintListener - void SAL_CALL windowPaint(const ::com::sun::star::awt::PaintEvent& e) throw(); + void SAL_CALL windowPaint(const ::com::sun::star::awt::PaintEvent& e) throw(); // ::com::sun::star::awt::XTopWindowListener - void SAL_CALL windowOpened( const ::com::sun::star::lang::EventObject& e ) throw(); - void SAL_CALL windowClosing( const ::com::sun::star::lang::EventObject& e ) throw(); - void SAL_CALL windowClosed( const ::com::sun::star::lang::EventObject& e ) throw(); - void SAL_CALL windowMinimized( const ::com::sun::star::lang::EventObject& e ) throw(); - void SAL_CALL windowNormalized( const ::com::sun::star::lang::EventObject& e ) throw(); - void SAL_CALL windowActivated( const ::com::sun::star::lang::EventObject& e ) throw(); - void SAL_CALL windowDeactivated( const ::com::sun::star::lang::EventObject& e ) throw(); + void SAL_CALL windowOpened( const ::com::sun::star::lang::EventObject& e ) throw(); + void SAL_CALL windowClosing( const ::com::sun::star::lang::EventObject& e ) throw(); + void SAL_CALL windowClosed( const ::com::sun::star::lang::EventObject& e ) throw(); + void SAL_CALL windowMinimized( const ::com::sun::star::lang::EventObject& e ) throw(); + void SAL_CALL windowNormalized( const ::com::sun::star::lang::EventObject& e ) throw(); + void SAL_CALL windowActivated( const ::com::sun::star::lang::EventObject& e ) throw(); + void SAL_CALL windowDeactivated( const ::com::sun::star::lang::EventObject& e ) throw(); protected: /** * Remove the listener with the uik rUik from the peer rPeer. - * @param rPeer the peer from which the listener is removed. - * @param rUik the listener uik, which specify the type of the listener. + * @param rPeer the peer from which the listener is removed. + * @param rUik the listener uik, which specify the type of the listener. */ - void adviseToPeer( const Reference< ::com::sun::star::awt::XWindow > & rPeer, const Type & type ); + void adviseToPeer( const Reference< ::com::sun::star::awt::XWindow > & rPeer, const Type & type ); /** * Add the listener with the uik rUik to the peer rPeer. - * @param rPeer the peer to which the listener is added. - * @param rUik the listener uik, which specify the type of the listener. + * @param rPeer the peer to which the listener is added. + * @param rUik the listener uik, which specify the type of the listener. */ - void unadviseFromPeer( const Reference< ::com::sun::star::awt::XWindow > & rPeer, const Type & type ); + void unadviseFromPeer( const Reference< ::com::sun::star::awt::XWindow > & rPeer, const Type & type ); private: /** The source of the events. Normally this is the peer object.*/ - Reference< ::com::sun::star::awt::XWindow > xPeer; - WeakReference< ::com::sun::star::awt::XControl > xControl; - ::cppu::OMultiTypeInterfaceContainerHelper aListenerHolder; + Reference< ::com::sun::star::awt::XWindow > xPeer; + WeakReference< ::com::sun::star::awt::XControl > xControl; + ::cppu::OMultiTypeInterfaceContainerHelper aListenerHolder; MRCListenerMultiplexerHelper( const MRCListenerMultiplexerHelper & ); MRCListenerMultiplexerHelper & operator = ( const MRCListenerMultiplexerHelper & ); }; -#endif // _MRC_MULTIPLX_HXX +#endif // _MRC_MULTIPLX_HXX diff --git a/extensions/source/plugin/inc/plugin/plcom.hxx b/extensions/source/plugin/inc/plugin/plcom.hxx index f0c4d54c02c3..056016e0b3fa 100644 --- a/extensions/source/plugin/inc/plugin/plcom.hxx +++ b/extensions/source/plugin/inc/plugin/plcom.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -35,9 +35,9 @@ class XPlugin_Impl; class PluginComm { protected: - int m_nRefCount; - ::rtl::OString m_aLibName; - std::list< String > m_aFilesToDelete; + int m_nRefCount; + ::rtl::OString m_aLibName; + std::list< String > m_aFilesToDelete; public: PluginComm( const ::rtl::OString& rLibName, bool bReusable = true ); virtual ~PluginComm(); @@ -77,7 +77,7 @@ public: virtual NPError NPP_GetValue( NPP instance, NPPVariable variable, void* value ) = 0; virtual NPError NPP_SetValue( NPP instance, NPNVariable variable, void *value) = 0; - + virtual NPError NPP_SetWindow( XPlugin_Impl* ); virtual NPError NPP_Destroy( XPlugin_Impl*, NPSavedData** save ); }; diff --git a/extensions/source/plugin/inc/plugin/plctrl.hxx b/extensions/source/plugin/inc/plugin/plctrl.hxx index 1980fa7b6725..1592b8220c8c 100644 --- a/extensions/source/plugin/inc/plugin/plctrl.hxx +++ b/extensions/source/plugin/inc/plugin/plctrl.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -79,33 +79,33 @@ public: { _xContext = xContext; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getContext() throw( ::com::sun::star::uno::RuntimeException ) { return _xContext; } - + virtual sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & Model ) throw( ::com::sun::star::uno::RuntimeException ) = 0; -// { DBG_ERROR( "### setModel() illegal on plugincontrol!" ); return sal_False; } +// { DBG_ERROR( "### setModel() illegal on plugincontrol!" ); return sal_False; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel() throw( ::com::sun::star::uno::RuntimeException ) = 0; virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XView > SAL_CALL getView() throw( ::com::sun::star::uno::RuntimeException ) { return (::com::sun::star::awt::XView*)this; } - + virtual sal_Bool SAL_CALL isTransparent() throw( ::com::sun::star::uno::RuntimeException ) { return sal_False; } - + virtual void SAL_CALL setDesignMode( sal_Bool bOn ) throw( ::com::sun::star::uno::RuntimeException ); virtual sal_Bool SAL_CALL isDesignMode() throw( ::com::sun::star::uno::RuntimeException ) { return _bInDesignMode; } - + virtual void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > & xToolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > & Parent) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL getPeer() throw( ::com::sun::star::uno::RuntimeException ) { return _xPeer; } - + // ::com::sun::star::awt::XWindow virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL setEnable( sal_Bool bEnable ) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL setFocus(void) throw( ::com::sun::star::uno::RuntimeException ); - + virtual void SAL_CALL setPosSize( sal_Int32 nX_, sal_Int32 nY_, sal_Int32 nWidth_, sal_Int32 nHeight_, sal_Int16 nFlags ) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::awt::Rectangle SAL_CALL getPosSize(void) throw( ::com::sun::star::uno::RuntimeException ); - + virtual void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener > & l ) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener > & l ) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener > & l ) throw( ::com::sun::star::uno::RuntimeException ); @@ -124,11 +124,11 @@ public: // ::com::sun::star::awt::XFocusListener virtual void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent & rEvt ) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent & rEvt ) throw( ::com::sun::star::uno::RuntimeException ); - + // ::com::sun::star::lang::XComponent virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & l ) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & l ) throw( ::com::sun::star::uno::RuntimeException ); - + virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException ); // ::com::sun::star::awt::XView @@ -136,44 +136,44 @@ public: { return sal_False; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL getGraphics(void) throw( ::com::sun::star::uno::RuntimeException ) { return ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > (); } - - virtual ::com::sun::star::awt::Size SAL_CALL getSize(void) throw( ::com::sun::star::uno::RuntimeException ) + + virtual ::com::sun::star::awt::Size SAL_CALL getSize(void) throw( ::com::sun::star::uno::RuntimeException ) { return ::com::sun::star::awt::Size(_nWidth, _nHeight); } - + virtual void SAL_CALL draw( sal_Int32 x, sal_Int32 y ) throw( ::com::sun::star::uno::RuntimeException ); virtual void SAL_CALL setZoom( float ZoomX, float ZoomY ) throw( ::com::sun::star::uno::RuntimeException ); public: PluginControl_Impl(); - virtual ~PluginControl_Impl(); - + virtual ~PluginControl_Impl(); + MRCListenerMultiplexerHelper* getMultiplexer(); protected: - void releasePeer(); - + void releasePeer(); + protected: - ::std::list< Reference< ::com::sun::star::lang::XEventListener > > _aDisposeListeners; - MRCListenerMultiplexerHelper* _pMultiplexer; - - Reference< XInterface > _xContext; - - sal_Int32 _nX; - sal_Int32 _nY; - sal_Int32 _nWidth; - sal_Int32 _nHeight; - sal_Int16 _nFlags; - - sal_Bool _bVisible; - sal_Bool _bInDesignMode; - sal_Bool _bEnable; - - SystemChildWindow* _pSysChild; - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > _xPeer; - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > _xPeerWindow; - - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > _xParentWindow; - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > _xParentPeer; + ::std::list< Reference< ::com::sun::star::lang::XEventListener > > _aDisposeListeners; + MRCListenerMultiplexerHelper* _pMultiplexer; + + Reference< XInterface > _xContext; + + sal_Int32 _nX; + sal_Int32 _nY; + sal_Int32 _nWidth; + sal_Int32 _nHeight; + sal_Int16 _nFlags; + + sal_Bool _bVisible; + sal_Bool _bInDesignMode; + sal_Bool _bEnable; + + SystemChildWindow* _pSysChild; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > _xPeer; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > _xPeerWindow; + + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > _xParentWindow; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > _xParentPeer; }; #endif diff --git a/extensions/source/plugin/inc/plugin/unx/mediator.hxx b/extensions/source/plugin/inc/plugin/unx/mediator.hxx index 68619db54cad..800e06aa1c77 100644 --- a/extensions/source/plugin/inc/plugin/unx/mediator.hxx +++ b/extensions/source/plugin/inc/plugin/unx/mediator.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -43,10 +43,10 @@ struct MediatorMessage { - ULONG m_nID; - ULONG m_nBytes; - char* m_pBytes; - char* m_pRun; + ULONG m_nID; + ULONG m_nBytes; + char* m_pBytes; + char* m_pRun; MediatorMessage() : m_nID( 0 ), m_nBytes( 0 ), m_pBytes( NULL ), m_pRun( NULL ) {} @@ -72,13 +72,13 @@ struct MediatorMessage memcpy( m_pBytes, pBytes, (size_t)m_nBytes ); } - ULONG ExtractULONG(); - char* GetString(); - UINT32 GetUINT32(); - void* GetBytes( ULONG& ); - void* GetBytes() { ULONG nBytes; return GetBytes( nBytes ); } + ULONG ExtractULONG(); + char* GetString(); + UINT32 GetUINT32(); + void* GetBytes( ULONG& ); + void* GetBytes() { ULONG nBytes; return GetBytes( nBytes ); } - void Rewind() { m_pRun = NULL; } + void Rewind() { m_pRun = NULL; } }; class MediatorListener; @@ -87,22 +87,22 @@ class Mediator { friend class MediatorListener; protected: - int m_nSocket; + int m_nSocket; - std::vector<MediatorMessage*> m_aMessageQueue; - NAMESPACE_VOS(OMutex) m_aQueueMutex; - NAMESPACE_VOS(OMutex) m_aSendMutex; + std::vector<MediatorMessage*> m_aMessageQueue; + NAMESPACE_VOS(OMutex) m_aQueueMutex; + NAMESPACE_VOS(OMutex) m_aSendMutex; // only one thread can send a message at any given time - NAMESPACE_VOS(OCondition) m_aNewMessageCdtn; - MediatorListener* m_pListener; + NAMESPACE_VOS(OCondition) m_aNewMessageCdtn; + MediatorListener* m_pListener; // thread to fill the queue - ULONG m_nCurrentID; + ULONG m_nCurrentID; // will be constantly increased with each message sent - bool m_bValid; + bool m_bValid; - Link m_aConnectionLostHdl; - Link m_aNewMessageHdl; + Link m_aConnectionLostHdl; + Link m_aNewMessageHdl; public: Mediator( int nSocket ); ~Mediator(); @@ -154,8 +154,8 @@ class MediatorListener : public NAMESPACE_VOS( OThread ) { friend class Mediator; private: - Mediator* m_pMediator; - ::vos::OMutex m_aMutex; + Mediator* m_pMediator; + ::vos::OMutex m_aMutex; MediatorListener( Mediator* ); ~MediatorListener(); diff --git a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx index 9044a14a9cbc..c347fed29a75 100644 --- a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx +++ b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -38,15 +38,15 @@ #define USE_MOTIF #endif -#define Window XLIB_Window -#define Font XLIB_Font -#define KeyCode XLIB_KeyCode -#define Time XLIB_Time -#define Cursor XLIB_Cursor -#define Region XLIB_Region -#define String XLIB_String -#define Boolean XLIB_Boolean -#define XPointer XLIB_XPointer +#define Window XLIB_Window +#define Font XLIB_Font +#define KeyCode XLIB_KeyCode +#define Time XLIB_Time +#define Cursor XLIB_Cursor +#define Region XLIB_Region +#define String XLIB_String +#define Boolean XLIB_Boolean +#define XPointer XLIB_XPointer #include <X11/Xlib.h> extern "C" { #include <X11/Intrinsic.h> @@ -136,17 +136,17 @@ extern "C" { class ConnectorInstance { public: - NPP instance; - NPWindow window; - NPSetWindowCallbackStruct ws_info; - char* pMimeType; - void* pShell; - void* pWidget; - void* pForm; - + NPP instance; + NPWindow window; + NPSetWindowCallbackStruct ws_info; + char* pMimeType; + void* pShell; + void* pWidget; + void* pForm; + GtkWidget* pGtkWindow; GtkWidget* pGtkWidget; - + bool bShouldUseXEmbed; int nArg; @@ -169,29 +169,29 @@ protected: NAMESPACE_VOS(OMutex) m_aUserEventMutex; static std::vector<PluginConnector*> allConnectors; - + DECL_LINK( NewMessageHdl, Mediator* ); DECL_LINK( WorkOnNewMessageHdl, Mediator* ); - + std::vector<NPStream*> m_aNPWrapStreams; std::vector<ConnectorInstance*> m_aInstances; - - ULONG FillBuffer( char*&, const char*, ULONG, va_list ); + + ULONG FillBuffer( char*&, const char*, 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, ... ); + MediatorMessage* Transact( const char*, ULONG, ... ); + MediatorMessage* Transact( UINT32, ... ); + void Respond( ULONG nID, char*, ULONG, ... ); + ULONG Send( UINT32, ... ); static const UINT32 UnknownStreamID = 0xffffffff; static const UINT32 UnknownNPPID = 0xffffffff; - UINT32 GetStreamID( NPStream* pStream ); - UINT32 GetNPPID( NPP ); + UINT32 GetStreamID( NPStream* pStream ); + UINT32 GetNPPID( NPP ); std::vector<NPStream*>& getStreamList() { return m_aNPWrapStreams; } @@ -208,7 +208,7 @@ public: LINK( this, PluginConnector, WorkOnNewMessageHdl ). Call( (Mediator*)this ); } - + ConnectorInstance* getInstance( NPP ); ConnectorInstance* getInstanceById( UINT32 ); }; diff --git a/extensions/source/plugin/inc/plugin/unx/sysplug.hxx b/extensions/source/plugin/inc/plugin/unx/sysplug.hxx index 70b01d3fc69c..aea98029ef0d 100644 --- a/extensions/source/plugin/inc/plugin/unx/sysplug.hxx +++ b/extensions/source/plugin/inc/plugin/unx/sysplug.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -36,9 +36,9 @@ class UnxPluginComm : public PluginComm, public PluginConnector { private: - static int nConnCounter; + static int nConnCounter; - pid_t m_nCommPID; + pid_t m_nCommPID; public: UnxPluginComm( const String& mimetype, const String& library, diff --git a/extensions/source/plugin/inc/plugin/win/sysplug.hxx b/extensions/source/plugin/inc/plugin/win/sysplug.hxx index 9dd25d34dd06..6e41f553fca2 100644 --- a/extensions/source/plugin/inc/plugin/win/sysplug.hxx +++ b/extensions/source/plugin/inc/plugin/win/sysplug.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -57,7 +57,7 @@ class PluginComm_Impl : public PluginComm, public ::vcl::SolarThreadExecutor - + { enum CallType { eNPP_Destroy, @@ -78,45 +78,45 @@ class PluginComm_Impl : eNP_Initialize }; - void* m_aArgs[ 8 ]; - CallType m_eCall; - - virtual long doIt(); + void* m_aArgs[ 8 ]; + CallType m_eCall; + + virtual long doIt(); public: PluginComm_Impl( const rtl::OUString& rMIME, const rtl::OUString& rName, HWND hWnd ); - virtual ~PluginComm_Impl(); - + virtual ~PluginComm_Impl(); + public: using PluginComm::NPP_Destroy; - virtual NPError NPP_Destroy( NPP instance, NPSavedData** save ); - virtual NPError NPP_DestroyStream( NPP instance, NPStream* stream, NPError reason ); - virtual void * NPP_GetJavaClass(); - virtual NPError NPP_Initialize(); - virtual NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, + virtual NPError NPP_Destroy( NPP instance, NPSavedData** save ); + virtual NPError NPP_DestroyStream( NPP instance, NPStream* stream, NPError reason ); + virtual void * NPP_GetJavaClass(); + virtual NPError NPP_Initialize(); + virtual NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData *saved ); - virtual NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream, + virtual NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype ); - virtual void NPP_Print( NPP instance, NPPrint* platformPrint ); - + virtual void NPP_Print( NPP instance, NPPrint* platformPrint ); + using PluginComm::NPP_SetWindow; - virtual NPError NPP_SetWindow( NPP instance, NPWindow* window ); - virtual void NPP_Shutdown(); - virtual void NPP_StreamAsFile( NPP instance, NPStream* stream, const char* fname ); - virtual void NPP_URLNotify( NPP instance, const char* url, + virtual NPError NPP_SetWindow( NPP instance, NPWindow* window ); + virtual void NPP_Shutdown(); + virtual void NPP_StreamAsFile( NPP instance, NPStream* stream, const char* fname ); + virtual void NPP_URLNotify( NPP instance, const char* url, NPReason reason, void* notifyData ); - virtual int32 NPP_Write( NPP instance, NPStream* stream, int32 offset, + virtual int32 NPP_Write( NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer ); - virtual int32 NPP_WriteReady( NPP instance, NPStream* stream ); - virtual NPError NPP_GetValue( NPP instance, NPPVariable variable, void *ret_alue ); - virtual NPError NPP_SetValue( NPP instance, NPNVariable variable, void *ret_alue ); - + virtual int32 NPP_WriteReady( NPP instance, NPStream* stream ); + virtual NPError NPP_GetValue( NPP instance, NPPVariable variable, void *ret_alue ); + virtual NPError NPP_SetValue( NPP instance, NPNVariable variable, void *ret_alue ); + private: - BOOL retrieveFunction( TCHAR* pName, void** ppFunc ) const; - + BOOL retrieveFunction( TCHAR* pName, void** ppFunc ) const; + private: - HINSTANCE _plDLL; + HINSTANCE _plDLL; - NPPluginFuncs _NPPfuncs; + NPPluginFuncs _NPPfuncs; }; diff --git a/extensions/source/plugin/unx/mediator.cxx b/extensions/source/plugin/unx/mediator.cxx index 6191fa5e897a..9ddc0d740922 100644 --- a/extensions/source/plugin/unx/mediator.cxx +++ b/extensions/source/plugin/unx/mediator.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -197,7 +197,7 @@ void MediatorListener::run() { ULONG nHeader[ 3 ]; int nBytes; - + if( m_pMediator && ( nBytes = read( m_pMediator->m_nSocket, nHeader, sizeof( nHeader ) ) ) == sizeof( nHeader ) && nHeader[2] == MEDIATOR_MAGIC) { if( nHeader[ 0 ] == 0 && nHeader[ 1 ] == 0 ) diff --git a/extensions/source/plugin/unx/npnapi.cxx b/extensions/source/plugin/unx/npnapi.cxx index 003b4d0943a5..87f93d565ffc 100644 --- a/extensions/source/plugin/unx/npnapi.cxx +++ b/extensions/source/plugin/unx/npnapi.cxx @@ -1,10 +1,29 @@ /************************************************************************* - - Source Code Control System - Header - - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/extensions/source/plugin/unx/npnapi.cxx,v 1.11 2008-01-14 14:53:25 ihi Exp $ - -*************************************************************************/ + * + * 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. + * + ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" @@ -34,12 +53,12 @@ static void* l_NPN_MemAlloc( uint32 nBytes ) void* pMem = new char[nBytes]; return pMem; } - + static void l_NPN_MemFree( void* pMem ) { delete [] (char*)pMem; } - + static uint32 l_NPN_MemFlush( uint32 /*nSize*/ ) { return 0; @@ -50,7 +69,7 @@ static NPError l_NPN_DestroyStream( NPP instance, NPStream* stream, NPError reas UINT32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; - + UINT32 nFileID = pConnector->GetStreamID( stream ); MediatorMessage* pMes= pConnector-> @@ -101,14 +120,14 @@ static NPError l_NPN_GetURL( NPP instance, const char* url, const char* window ) UINT32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; - + MediatorMessage* pMes= pConnector-> Transact( eNPN_GetURL, &nInstance, sizeof( nInstance ), POST_STRING(url), POST_STRING(window), - NULL ); + NULL ); medDebug( !pMes, "geturl: message unaswered\n" ); if( ! pMes ) return NPERR_GENERIC_ERROR; @@ -173,7 +192,7 @@ static NPError l_NPN_NewStream( NPP instance, NPMIMEType type, const char* targe pStream->end = pMes->GetUINT32(); pStream->lastmodified = pMes->GetUINT32(); pStream->ndata = pStream->pdata = pStream->notifyData = NULL; - + pConnector->getStreamList().push_back( pStream ); *stream = pStream; } @@ -241,7 +260,7 @@ static NPError l_NPN_RequestRead( NPStream* stream, NPByteRange* rangeList ) nRanges++; pRange = pRange->next; } - + UINT32* pArray = new UINT32[ 2 * nRanges ]; pRange = rangeList; UINT32 n = 0; @@ -278,7 +297,7 @@ static void l_NPN_Status( NPP instance, const char* message ) pConnector->Send( eNPN_Status, &nInstance, sizeof( nInstance ), POST_STRING( message ), - NULL ); + NULL ); } static const char* l_NPN_UserAgent( NPP instance ) @@ -355,7 +374,7 @@ static int32 l_NPN_Write( NPP instance, NPStream* stream, int32 len, void* buffe return 0; INT32 nRet = pMes->GetUINT32(); - return nRet; + return nRet; } static void l_NPN_ReloadPlugins( NPBool /*reloadPages*/ ) @@ -492,9 +511,9 @@ static NPPluginFuncs aPluginFuncs = oslModule pPluginLib = NULL; -char*(*pNPP_GetMIMEDescription)() = NULL; -NPError (*pNP_Initialize)(NPNetscapeFuncs*,NPPluginFuncs*) = NULL; -NPError (*pNP_Shutdown)() = NULL; +char*(*pNPP_GetMIMEDescription)() = NULL; +NPError (*pNP_Initialize)(NPNetscapeFuncs*,NPPluginFuncs*) = NULL; +NPError (*pNP_Shutdown)() = NULL; std::vector< PluginConnector* > PluginConnector::allConnectors; @@ -520,11 +539,11 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) { case eNPP_DestroyStream: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); - NPStream* pStream = m_aNPWrapStreams[ nFileID ]; - NPError aReason = GetNPError( pMessage ); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + UINT32 nFileID = pMessage->GetUINT32(); + NPStream* pStream = m_aNPWrapStreams[ nFileID ]; + NPError aReason = GetNPError( pMessage ); m_aNPWrapStreams.erase( m_aNPWrapStreams.begin() + nFileID ); aReason = aPluginFuncs.destroystream( instance, pStream, aReason ); @@ -538,7 +557,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_Destroy: { - UINT32 nInstance = pMessage->GetUINT32(); + UINT32 nInstance = pMessage->GetUINT32(); ConnectorInstance* pInst= m_aInstances[ nInstance ]; // some plugin rely on old netscapes behaviour @@ -546,9 +565,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) // the instance, so mimic that behaviour here if( pInst->pShell ) XtDestroyWidget( (Widget)pInst->pShell ); - + pInst->pWidget = pInst->pShell = NULL; - + // the other side will call eNPP_DestroyPhase2 after this NPError aReason = NPERR_NO_ERROR; Respond( pMessage->m_nID, (char*)&aReason, sizeof( aReason ), NULL ); @@ -557,9 +576,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) case eNPP_DestroyPhase2: { // now really destroy the instance - UINT32 nInstance = pMessage->GetUINT32(); + UINT32 nInstance = pMessage->GetUINT32(); ConnectorInstance* pInst= m_aInstances[ nInstance ]; - NPP instance = pInst->instance; + NPP instance = pInst->instance; NPSavedData* pSave = NULL; NPError aRet = aPluginFuncs.destroy( instance, &pSave ); @@ -592,15 +611,15 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_NewStream: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - char* pType = pMessage->GetString(); - NPStream* pStream = new NPStream; - pStream->url = pMessage->GetString(); - pStream->end = pMessage->GetUINT32(); - pStream->lastmodified = pMessage->GetUINT32(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + char* pType = pMessage->GetString(); + NPStream* pStream = new NPStream; + pStream->url = pMessage->GetString(); + pStream->end = pMessage->GetUINT32(); + pStream->lastmodified = pMessage->GetUINT32(); pStream->pdata = pStream->ndata = pStream->notifyData = NULL; - NPBool* pSeekable = (NPBool*)pMessage->GetBytes(); + NPBool* pSeekable = (NPBool*)pMessage->GetBytes(); m_aNPWrapStreams.push_back( pStream ); uint16 nStype = NP_ASFILE; NPError aRet = aPluginFuncs.newstream( instance, pType, pStream, @@ -619,10 +638,10 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_New: { - char* pType = pMessage->GetString(); - uint16* pMode = (uint16*)pMessage->GetBytes(); - int16* pArgc = (int16*)pMessage->GetBytes(); - NPP instance = new NPP_t; + char* pType = pMessage->GetString(); + uint16* pMode = (uint16*)pMessage->GetBytes(); + int16* pArgc = (int16*)pMessage->GetBytes(); + NPP instance = new NPP_t; instance->pdata = instance->ndata = NULL; ULONG nArgnBytes, nArgvBytes; char* pArgn = (char*)pMessage->GetBytes( nArgnBytes ); @@ -665,7 +684,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) medDebug( 1, "should use xembed = %s\n", pInst->bShouldUseXEmbed ? "true" : "false" ); } #endif - + Respond( pMessage->m_nID, (char*)&aRet, sizeof( aRet ), NULL ); @@ -676,10 +695,10 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_SetWindow: { - UINT32 nInstance = pMessage->GetUINT32(); + UINT32 nInstance = pMessage->GetUINT32(); ConnectorInstance* pInst= m_aInstances[ nInstance ]; - NPWindow* pWindow = (NPWindow*)pMessage->GetBytes(); - + NPWindow* pWindow = (NPWindow*)pMessage->GetBytes(); + if( pWindow->width < 1 ) pWindow->width = 1; if( pWindow->height < 1 ) @@ -691,7 +710,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) if( ! pInst->pGtkWidget ) { medDebug( 1, "creating gtk plug and socket\n" ); - + pInst->pGtkWindow = gtk_plug_new((GdkNativeWindow)reinterpret_cast<sal_uIntPtr>(pWindow->window)); gtk_widget_show( pInst->pGtkWindow ); pInst->pGtkWidget = gtk_socket_new(); @@ -706,56 +725,56 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) XSync( pAppDisplay, False ); } - + // update widget size; alas out parent is not yet really XEMBED conformant gtk_widget_set_size_request( pInst->pGtkWidget, pWindow->width, pWindow->height ); gtk_window_resize( GTK_WINDOW(pInst->pGtkWindow), pWindow->width, pWindow->height ); - + GdkScreen* pGdkScreen = gtk_widget_get_screen( pInst->pGtkWidget ); Screen* pScreen = ScreenOfDisplay( pAppDisplay, gdk_screen_get_number( pGdkScreen ) ); - pInst->window.x = 0; - pInst->window.y = 0; - pInst->window.width = pWindow->width; - pInst->window.height = pWindow->height; - pInst->window.clipRect.left = 0; - pInst->window.clipRect.top = 0; - pInst->window.clipRect.right = pWindow->width; - pInst->window.clipRect.bottom = pWindow->height; - pInst->window.ws_info = &pInst->ws_info; - pInst->window.type = NPWindowTypeWindow; - pInst->ws_info.type = NP_SETWINDOW; - pInst->ws_info.display = pAppDisplay; - pInst->ws_info.visual = DefaultVisualOfScreen( pScreen ); - pInst->ws_info.colormap = DefaultColormapOfScreen( pScreen ); - pInst->ws_info.depth = DefaultDepthOfScreen( pScreen ); + pInst->window.x = 0; + pInst->window.y = 0; + pInst->window.width = pWindow->width; + pInst->window.height = pWindow->height; + pInst->window.clipRect.left = 0; + pInst->window.clipRect.top = 0; + pInst->window.clipRect.right = pWindow->width; + pInst->window.clipRect.bottom = pWindow->height; + pInst->window.ws_info = &pInst->ws_info; + pInst->window.type = NPWindowTypeWindow; + pInst->ws_info.type = NP_SETWINDOW; + pInst->ws_info.display = pAppDisplay; + pInst->ws_info.visual = DefaultVisualOfScreen( pScreen ); + pInst->ws_info.colormap = DefaultColormapOfScreen( pScreen ); + pInst->ws_info.depth = DefaultDepthOfScreen( pScreen ); } else #endif { if( ! pInst->pWidget ) { - pInst->pWidget = CreateNewShell( &(pInst->pShell), (XLIB_Window)pWindow->window ); + pInst->pWidget = CreateNewShell( &(pInst->pShell), (XLIB_Window)pWindow->window ); } - + // fill in NPWindow and NPCallbackStruct - pInst->window.window = (void*)XtWindow( (Widget)pInst->pWidget ); - pInst->window.x = 0; - pInst->window.y = 0; - pInst->window.width = pWindow->width; - pInst->window.height = pWindow->height; - pInst->window.clipRect.left = 0; - pInst->window.clipRect.top = 0; - pInst->window.clipRect.right = pWindow->width; - pInst->window.clipRect.bottom = pWindow->height; - pInst->window.ws_info = &pInst->ws_info; - pInst->window.type = NPWindowTypeWindow; - pInst->ws_info.type = NP_SETWINDOW; - pInst->ws_info.display = XtDisplay( (Widget)pInst->pWidget ); - pInst->ws_info.visual = DefaultVisualOfScreen( XtScreen( (Widget)pInst->pWidget ) ); - pInst->ws_info.colormap = DefaultColormapOfScreen( XtScreen( (Widget)pInst->pWidget ) ); - pInst->ws_info.depth = DefaultDepthOfScreen( XtScreen( (Widget)pInst->pWidget ) ); - + pInst->window.window = (void*)XtWindow( (Widget)pInst->pWidget ); + pInst->window.x = 0; + pInst->window.y = 0; + pInst->window.width = pWindow->width; + pInst->window.height = pWindow->height; + pInst->window.clipRect.left = 0; + pInst->window.clipRect.top = 0; + pInst->window.clipRect.right = pWindow->width; + pInst->window.clipRect.bottom = pWindow->height; + pInst->window.ws_info = &pInst->ws_info; + pInst->window.type = NPWindowTypeWindow; + pInst->ws_info.type = NP_SETWINDOW; + pInst->ws_info.display = XtDisplay( (Widget)pInst->pWidget ); + pInst->ws_info.visual = DefaultVisualOfScreen( XtScreen( (Widget)pInst->pWidget ) ); + pInst->ws_info.colormap = DefaultColormapOfScreen( XtScreen( (Widget)pInst->pWidget ) ); + pInst->ws_info.depth = DefaultDepthOfScreen( XtScreen( (Widget)pInst->pWidget ) ); + XtResizeWidget( (Widget)pInst->pShell, pInst->window.width, pInst->window.height, @@ -776,11 +795,11 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_StreamAsFile: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); - NPStream* pStream = m_aNPWrapStreams[ nFileID ]; - char* fname = pMessage->GetString(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + UINT32 nFileID = pMessage->GetUINT32(); + NPStream* pStream = m_aNPWrapStreams[ nFileID ]; + char* fname = pMessage->GetString(); medDebug( 1, "pluginapp: NPP_StreamAsFile %s\n", fname ); aPluginFuncs.asfile( instance, pStream, fname ); delete [] fname; @@ -788,11 +807,11 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_URLNotify: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - char* url = pMessage->GetString(); - NPReason* pReason = (NPReason*)pMessage->GetBytes(); - void** notifyData = (void**)pMessage->GetBytes(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + char* url = pMessage->GetString(); + NPReason* pReason = (NPReason*)pMessage->GetBytes(); + void** notifyData = (void**)pMessage->GetBytes(); aPluginFuncs.urlnotify( instance, url, *pReason, *notifyData ); delete [] url; delete [] pReason; @@ -801,15 +820,15 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_WriteReady: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); - NPStream* pStream = m_aNPWrapStreams[ nFileID ]; + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + UINT32 nFileID = pMessage->GetUINT32(); + NPStream* pStream = m_aNPWrapStreams[ nFileID ]; int32 nRet = aPluginFuncs.writeready( instance, pStream ); - + medDebug( 1, "pluginapp: NPP_WriteReady( %p, %p ) (stream id = %d) returns %d\n", instance, pStream, nFileID, nRet ); - + Respond( pMessage->m_nID, (char*)&nRet, sizeof( nRet ), NULL ); @@ -817,15 +836,15 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_Write: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); - NPStream* pStream = m_aNPWrapStreams[ nFileID ]; - int32 offset = pMessage->GetUINT32(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + UINT32 nFileID = pMessage->GetUINT32(); + NPStream* pStream = m_aNPWrapStreams[ nFileID ]; + int32 offset = pMessage->GetUINT32(); ULONG len; - char* buffer = (char*)pMessage->GetBytes( len ); + char* buffer = (char*)pMessage->GetBytes( len ); int32 nRet = aPluginFuncs.write( instance, pStream, offset, len, buffer ); - + medDebug( 1,"pluginapp: NPP_Write( %p, %p, %d, %d, %p ) returns %d\n" "stream = { pdata = %p, ndata = %p, url = %s, end = %d, lastmodified = %d, notifyData = %p }\n", instance, pStream, offset, len, buffer, nRet, diff --git a/extensions/source/plugin/unx/nppapi.cxx b/extensions/source/plugin/unx/nppapi.cxx index 6dc1b7a30407..58b31bcc4276 100644 --- a/extensions/source/plugin/unx/nppapi.cxx +++ b/extensions/source/plugin/unx/nppapi.cxx @@ -1,10 +1,29 @@ /************************************************************************* - - Source Code Control System - Header - - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/extensions/source/plugin/unx/nppapi.cxx,v 1.7 2008-01-14 14:53:38 ihi Exp $ - -*************************************************************************/ + * + * 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. + * + ************************************************************************/ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" @@ -83,10 +102,10 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) { case eNPN_GetURL: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - char* pUrl = pMessage->GetString(); - char* pWindow = pMessage->GetString(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + char* pUrl = pMessage->GetString(); + char* pWindow = pMessage->GetString(); NPError aRet = NPN_GetURL( instance, pUrl, pWindow ); Respond( pMessage->m_nID, (char*)(&aRet), sizeof( NPError ), NULL ); @@ -96,11 +115,11 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_GetURLNotify: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - char* pUrl = pMessage->GetString(); - char* pWindow = pMessage->GetString(); - void** pNotifyData = (void**)pMessage->GetBytes(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + char* pUrl = pMessage->GetString(); + char* pWindow = pMessage->GetString(); + void** pNotifyData = (void**)pMessage->GetBytes(); NPError aRet = NPN_GetURLNotify( instance, pUrl, pWindow, *pNotifyData ); Respond( pMessage->m_nID, @@ -112,11 +131,11 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_DestroyStream: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); - char* pUrl = pMessage->GetString(); - NPError* pReason = (NPError*)pMessage->GetBytes(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + 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()) ) { @@ -143,10 +162,10 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_NewStream: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - NPMIMEType pType = pMessage->GetString(); - char* pTarget = pMessage->GetString(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + NPMIMEType pType = pMessage->GetString(); + char* pTarget = pMessage->GetString(); NPStream* pStream = NULL; @@ -174,21 +193,21 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) &pStream->lastmodified, sizeof(UINT32), NULL ); } - + delete [] pTarget; delete [] pType; } break; case eNPN_PostURLNotify: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - char* pUrl = pMessage->GetString(); - char* pTarget = pMessage->GetString(); - UINT32 nLen = pMessage->GetUINT32(); - char* pBuf = (char*)pMessage->GetBytes(); - NPBool* pFile = (NPBool*)pMessage->GetBytes(); - void** pNData = (void**)pMessage->GetBytes(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + char* pUrl = pMessage->GetString(); + char* pTarget = pMessage->GetString(); + UINT32 nLen = pMessage->GetUINT32(); + char* pBuf = (char*)pMessage->GetBytes(); + NPBool* pFile = (NPBool*)pMessage->GetBytes(); + void** pNData = (void**)pMessage->GetBytes(); NPError aRet = NPN_PostURLNotify( instance, pUrl, pTarget, nLen, pBuf, *pFile, *pNData ); Respond( pMessage->m_nID, (char*)&aRet, sizeof( aRet ), NULL ); @@ -201,13 +220,13 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_PostURL: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - char* pUrl = pMessage->GetString(); - char* pWindow = pMessage->GetString(); - UINT32 nLen = pMessage->GetUINT32(); - char* pBuf = (char*)pMessage->GetBytes(); - NPBool* pFile = (NPBool*)pMessage->GetBytes(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + char* pUrl = pMessage->GetString(); + char* pWindow = pMessage->GetString(); + UINT32 nLen = pMessage->GetUINT32(); + char* pBuf = (char*)pMessage->GetBytes(); + NPBool* pFile = (NPBool*)pMessage->GetBytes(); NPError aRet = NPN_PostURL( instance, pUrl, pWindow, nLen, pBuf, *pFile ); Respond( pMessage->m_nID, (char*)&aRet, sizeof( aRet ), NULL ); @@ -219,13 +238,13 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_RequestRead: { - UINT32 nFileID = pMessage->GetUINT32(); - NPStream* pStream = m_aNPWrapStreams[ nFileID ]; - UINT32 nRanges = pMessage->GetUINT32(); - UINT32* pArray = (UINT32*)pMessage->GetBytes(); + UINT32 nFileID = pMessage->GetUINT32(); + NPStream* pStream = m_aNPWrapStreams[ nFileID ]; + UINT32 nRanges = pMessage->GetUINT32(); + UINT32* pArray = (UINT32*)pMessage->GetBytes(); // build ranges table NPByteRange* pFirst = new NPByteRange; - NPByteRange* pRun = pFirst; + NPByteRange* pRun = pFirst; for( UINT32 n = 0; n < nRanges; n++ ) { pRun->offset = pArray[ 2*n ]; @@ -246,9 +265,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_Status: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - char* pString = pMessage->GetString(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + char* pString = pMessage->GetString(); NPN_Status( instance, pString ); delete [] pString; } @@ -267,12 +286,12 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_Write: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); - NPStream* pStream = m_aNPWrapStreams[ nFileID ]; - INT32 nLen = pMessage->GetUINT32(); - void* pBuffer = pMessage->GetBytes(); + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; + UINT32 nFileID = pMessage->GetUINT32(); + NPStream* pStream = m_aNPWrapStreams[ nFileID ]; + INT32 nLen = pMessage->GetUINT32(); + void* pBuffer = pMessage->GetBytes(); INT32 nRet = NPN_Write( instance, pStream, nLen, pBuffer ); Respond( pMessage->m_nID, (char*)&nRet, sizeof( nRet ), @@ -283,8 +302,8 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_UserAgent: { - UINT32 nInstance = pMessage->GetUINT32(); - NPP instance = m_aInstances[ nInstance ]->instance; + UINT32 nInstance = pMessage->GetUINT32(); + NPP instance = m_aInstances[ nInstance ]->instance; const char* pAnswer = NPN_UserAgent( instance ); Respond( pMessage->m_nID, (char*)pAnswer, strlen( pAnswer ), @@ -294,7 +313,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) default: medDebug( 1, "caught unknown NPN request %d\n", nCommand ); } - + delete pMessage; } return 0; @@ -316,7 +335,7 @@ NPError UnxPluginComm::NPP_Destroy( NPP instance, NPSavedData** save ) { NPError aRet = NPERR_GENERIC_ERROR; GET_INSTANCE_RET( aRet ); - MediatorMessage* pMes = + MediatorMessage* pMes = Transact( eNPP_Destroy, POST_INSTANCE(), NULL ); @@ -353,8 +372,8 @@ NPError UnxPluginComm::NPP_DestroyStream( NPP instance, NPStream* stream, NPErro UINT32 nFileID = GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return NPERR_GENERIC_ERROR; - - MediatorMessage* pMes = + + MediatorMessage* pMes = Transact( eNPP_DestroyStream, POST_INSTANCE(), &nFileID, sizeof( nFileID ), @@ -376,7 +395,7 @@ void* UnxPluginComm::NPP_GetJavaClass() NPError UnxPluginComm::NPP_Initialize() { - MediatorMessage* pMes = + MediatorMessage* pMes = Transact( eNPP_Initialize, NULL ); if( ! pMes ) @@ -418,7 +437,7 @@ NPError UnxPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode MediatorMessage* pMes; if( saved ) - pMes = + pMes = Transact( eNPP_New, pluginType, strlen( pluginType ), &mode, sizeof( mode ), @@ -428,7 +447,7 @@ NPError UnxPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode saved->buf, static_cast<size_t>(saved->len), NULL ); else - pMes = + pMes = Transact( eNPP_New, pluginType, strlen( pluginType ), &mode, sizeof( mode ), @@ -455,7 +474,7 @@ NPError UnxPluginComm::NPP_NewStream( NPP instance, NPMIMEType type, NPStream* s GET_INSTANCE_RET( aRet ); m_aNPWrapStreams.push_back( stream ); - MediatorMessage* pMes = + MediatorMessage* pMes = Transact( eNPP_NewStream, POST_INSTANCE(), type, strlen( type ), @@ -479,14 +498,14 @@ NPError UnxPluginComm::NPP_NewStream( NPP instance, NPMIMEType type, NPStream* s void UnxPluginComm::NPP_Print( NPP /*instance*/, NPPrint* /*platformPrint*/ ) { -} +} NPError UnxPluginComm::NPP_SetWindow( NPP instance, NPWindow* window ) { NPError aRet = NPERR_GENERIC_ERROR; GET_INSTANCE_RET( aRet ); - MediatorMessage* pMes = + MediatorMessage* pMes = Transact( eNPP_SetWindow, POST_INSTANCE(), window, sizeof( NPWindow ), @@ -521,7 +540,7 @@ void UnxPluginComm::NPP_StreamAsFile( NPP instance, NPStream* stream, const char void UnxPluginComm::NPP_URLNotify( NPP instance, const char* url, NPReason reason, void* notifyData ) { GET_INSTANCE(); - + Send( eNPP_URLNotify, POST_INSTANCE(), url, strlen( url ), @@ -537,7 +556,7 @@ int32 UnxPluginComm::NPP_Write( NPP instance, NPStream* stream, int32 offset, in if( nFileID == PluginConnector::UnknownStreamID ) return -1; - MediatorMessage* pMes = + MediatorMessage* pMes = Transact( eNPP_Write, POST_INSTANCE(), &nFileID, sizeof( nFileID ), @@ -549,7 +568,7 @@ int32 UnxPluginComm::NPP_Write( NPP instance, NPStream* stream, int32 offset, in int32 aRet = pMes->GetUINT32(); delete pMes; - + return aRet; } @@ -560,7 +579,7 @@ int32 UnxPluginComm::NPP_WriteReady( NPP instance, NPStream* stream ) if( nFileID == PluginConnector::UnknownStreamID ) return -1; - MediatorMessage* pMes = + MediatorMessage* pMes = Transact( eNPP_WriteReady, POST_INSTANCE(), &nFileID, sizeof( nFileID ), @@ -571,14 +590,14 @@ int32 UnxPluginComm::NPP_WriteReady( NPP instance, NPStream* stream ) int32 aRet = pMes->GetUINT32(); delete pMes; - + return aRet; } char* UnxPluginComm::NPP_GetMIMEDescription() { static char* pDesc = NULL; - MediatorMessage* pMes = + MediatorMessage* pMes = Transact( eNPP_GetMIMEDescription, NULL ); if( ! pMes ) diff --git a/extensions/source/plugin/unx/npwrap.cxx b/extensions/source/plugin/unx/npwrap.cxx index 387de8cde24d..d37635784a06 100644 --- a/extensions/source/plugin/unx/npwrap.cxx +++ b/extensions/source/plugin/unx/npwrap.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -41,9 +41,9 @@ PluginConnector* pConnector = NULL; -int nAppArguments = 0; -char** pAppArguments = NULL; -Display* pAppDisplay = NULL; +int nAppArguments = 0; +char** pAppArguments = NULL; +Display* pAppDisplay = NULL; Display* pXtAppDisplay = NULL; extern oslModule pPluginLib; @@ -59,7 +59,7 @@ static bool bPluginAppQuit = false; static long GlobalConnectionLostHdl( void* /*pInst*/, void* /*pArg*/ ) { medDebug( 1, "pluginapp exiting due to connection lost\n" ); - + write( wakeup_fd[1], "xxxx", 4 ); return 0; } @@ -70,14 +70,14 @@ extern "C" { return 0; } - + #ifndef ENABLE_GTK static void ThreadEventHandler( XtPointer /*client_data*/, int* /*source*/, XtInputId* id ) { char buf[256]; // clear pipe int len, nLast = -1; - + while( (len = read( wakeup_fd[0], buf, sizeof( buf ) ) ) > 0 ) nLast = len-1; if( ! bPluginAppQuit ) @@ -108,7 +108,7 @@ IMPL_LINK( PluginConnector, NewMessageHdl, Mediator*, /*pMediator*/ ) medDebug( 1, "new message handler\n" ); write( wakeup_fd[1], "cccc", 4 ); return 0; - + } Widget createSubWidget( char* /*pPluginText*/, Widget shell, XLIB_Window aParentWindow ) @@ -139,7 +139,7 @@ Widget createSubWidget( char* /*pPluginText*/, Widget shell, XLIB_Window aParent 0, 0 ); XtMapWidget( shell ); XtMapWidget( newWidget ); - XRaiseWindow( pXtAppDisplay, XtWindow( shell ) ); + XRaiseWindow( pXtAppDisplay, XtWindow( shell ) ); XSync( pXtAppDisplay, False ); return newWidget; @@ -186,7 +186,7 @@ static oslModule LoadModule( const char* pPath ) static void CheckPlugin( const char* pPath ) { oslModule pLib = LoadModule( pPath ); - + char*(*pNP_GetMIMEDescription)() = (char*(*)()) osl_getAsciiFunctionSymbol( pLib, "NP_GetMIMEDescription" ); if( pNP_GetMIMEDescription ) @@ -273,7 +273,7 @@ static gboolean pollXtTimerCallback(gpointer) static gboolean prepareWakeupEvent( GSource*, gint* ) { struct pollfd aPoll = { wakeup_fd[0], POLLIN, 0 }; - poll( &aPoll, 1, 0 ); + poll( &aPoll, 1, 0 ); return (aPoll.revents & POLLIN ) != 0; } @@ -288,7 +288,7 @@ static gboolean dispatchWakeupEvent( GSource*, GSourceFunc, gpointer ) char buf[256]; // clear pipe int len, nLast = -1; - + while( (len = read( wakeup_fd[0], buf, sizeof( buf ) ) ) > 0 ) nLast = len-1; if( ( nLast == -1 || buf[nLast] != 'x' ) && pConnector ) @@ -301,7 +301,7 @@ static gboolean dispatchWakeupEvent( GSource*, GSourceFunc, gpointer ) delete pConnector; pConnector = NULL; } - + return TRUE; } @@ -353,7 +353,7 @@ int main( int argc, char **argv) } // initialize 'wakeup' pipe. int flags; - + // set close-on-exec descriptor flag. if ((flags = fcntl (wakeup_fd[0], F_GETFD)) != -1) { @@ -365,7 +365,7 @@ int main( int argc, char **argv) flags |= FD_CLOEXEC; fcntl (wakeup_fd[1], F_SETFD, flags); } - + // set non-blocking I/O flag. if ((flags = fcntl (wakeup_fd[0], F_GETFL)) != -1) { @@ -384,7 +384,7 @@ int main( int argc, char **argv) exit(255); } int nSocket = atol( argv[1] ); - + #ifdef ENABLE_GTK g_thread_init(NULL); gtk_init(&argc, &argv); @@ -410,7 +410,7 @@ int main( int argc, char **argv) medDebug( 1, "could not get Xt GSource" ); return 1; } - + g_source_set_priority( pXTSource, GDK_PRIORITY_EVENTS ); g_source_set_can_recurse( pXTSource, TRUE ); g_source_attach( pXTSource, NULL ); @@ -418,7 +418,7 @@ int main( int argc, char **argv) aXtPollDesc.events = G_IO_IN; aXtPollDesc.revents = 0; g_source_add_poll( pXTSource, &aXtPollDesc ); - + gint xt_polling_timer_id = g_timeout_add( 25, pollXtTimerCallback, NULL); // Initialize wakeup events listener GSource *pWakeupSource = g_source_new( &aWakeupEventFuncs, sizeof(GSource) ); @@ -485,7 +485,7 @@ int main( int argc, char **argv) #ifdef ENABLE_GTK g_source_remove(xt_polling_timer_id); #endif - + pNP_Shutdown(); medDebug( 1, "NP_Shutdown done\n" ); osl_unloadModule( pPluginLib ); diff --git a/extensions/source/plugin/unx/plugcon.cxx b/extensions/source/plugin/unx/plugcon.cxx index 74d8fa8bd2da..d2cadb7070f7 100644 --- a/extensions/source/plugin/unx/plugcon.cxx +++ b/extensions/source/plugin/unx/plugcon.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -74,7 +74,7 @@ struct PtrStruct { char* pData; ULONG nBytes; - + PtrStruct( char* i_pData, ULONG i_nBytes ) : pData( i_pData ), nBytes( i_nBytes ) {} }; @@ -86,7 +86,7 @@ ULONG PluginConnector::FillBuffer( char*& rpBuffer, { std::vector< PtrStruct > aList; aList.reserve( 5 ); - + ULONG nDataSize = nFunctionLen + sizeof( ULONG ); char* pNext; @@ -156,7 +156,7 @@ void PluginConnector::Respond( ULONG nID, { va_list ap; char* pBuffer; - + va_start( ap, nFunctionLen ); ULONG nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); va_end( ap ); @@ -249,34 +249,34 @@ const char* GetCommandName( CommandAtoms eCommand ) { switch( eCommand ) { - case eNPN_GetURL: return "NPN_GetURL"; - case eNPN_GetURLNotify: return "NPN_GetURLNotify"; - case eNPN_DestroyStream: return "NPN_DestroyStream"; - case eNPN_NewStream: return "NPN_NewStream"; - case eNPN_PostURLNotify: return "NPN_PostURLNotify"; - case eNPN_PostURL: return "NPN_PostURL"; - case eNPN_RequestRead: return "NPN_RequestRead"; - case eNPN_Status: return "NPN_Status"; - case eNPN_Version: return "NPN_Version"; - case eNPN_Write: return "NPN_Write"; - case eNPN_UserAgent: return "NPN_UserAgent"; + case eNPN_GetURL: return "NPN_GetURL"; + case eNPN_GetURLNotify: return "NPN_GetURLNotify"; + case eNPN_DestroyStream: return "NPN_DestroyStream"; + case eNPN_NewStream: return "NPN_NewStream"; + case eNPN_PostURLNotify: return "NPN_PostURLNotify"; + case eNPN_PostURL: return "NPN_PostURL"; + case eNPN_RequestRead: return "NPN_RequestRead"; + case eNPN_Status: return "NPN_Status"; + case eNPN_Version: return "NPN_Version"; + case eNPN_Write: return "NPN_Write"; + case eNPN_UserAgent: return "NPN_UserAgent"; - case eNPP_DestroyStream: return "NPP_DestroyStream"; - case eNPP_Destroy: return "NPP_Destroy"; - case eNPP_DestroyPhase2: return "NPP_DestroyPhase2"; - case eNPP_NewStream: return "NPP_NewStream"; - case eNPP_New: return "NPP_New"; - case eNPP_SetWindow: return "NPP_SetWindow"; - case eNPP_StreamAsFile: return "NPP_StreamAsFile"; - case eNPP_URLNotify: return "NPP_URLNotify"; - case eNPP_WriteReady: return "NPP_WriteReady"; - case eNPP_Write: return "NPP_Write"; - case eNPP_GetMIMEDescription: return "NPP_GetMIMEDescription"; - case eNPP_Initialize: return "NPP_Initialize"; - case eNPP_Shutdown: return "NPP_Shutdown"; + case eNPP_DestroyStream: return "NPP_DestroyStream"; + case eNPP_Destroy: return "NPP_Destroy"; + case eNPP_DestroyPhase2: return "NPP_DestroyPhase2"; + case eNPP_NewStream: return "NPP_NewStream"; + case eNPP_New: return "NPP_New"; + case eNPP_SetWindow: return "NPP_SetWindow"; + case eNPP_StreamAsFile: return "NPP_StreamAsFile"; + case eNPP_URLNotify: return "NPP_URLNotify"; + case eNPP_WriteReady: return "NPP_WriteReady"; + case eNPP_Write: return "NPP_Write"; + case eNPP_GetMIMEDescription: return "NPP_GetMIMEDescription"; + case eNPP_Initialize: return "NPP_Initialize"; + case eNPP_Shutdown: return "NPP_Shutdown"; - case eMaxCommand: return "eMaxCommand"; - default: return "unknown command"; + case eMaxCommand: return "eMaxCommand"; + default: return "unknown command"; } return NULL; } diff --git a/extensions/source/plugin/unx/sysplug.cxx b/extensions/source/plugin/unx/sysplug.cxx index fbcf9b7497eb..c14bc72c38ad 100644 --- a/extensions/source/plugin/unx/sysplug.cxx +++ b/extensions/source/plugin/unx/sysplug.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 diff --git a/extensions/source/plugin/unx/unxmgr.cxx b/extensions/source/plugin/unx/unxmgr.cxx index 1a3736e87e0b..c95d2ad18527 100644 --- a/extensions/source/plugin/unx/unxmgr.cxx +++ b/extensions/source/plugin/unx/unxmgr.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -113,18 +113,18 @@ static bool CheckPlugin( const ByteString& rPath, list< PluginDescription* >& rD if( aMIME.getLength() > 0 ) { OString aLine = aMIME.makeStringAndClear(); - + sal_Int32 nIndex = 0; while( nIndex != -1 ) { OString aType = aLine.getToken( 0, ';', nIndex ); sal_Int32 nTypeIndex = 0; - OString aMimetype = aType.getToken( 0, ':', nTypeIndex ); - OString aExtLine = aType.getToken( 0, ':', nTypeIndex ); + OString aMimetype = aType.getToken( 0, ':', nTypeIndex ); + OString aExtLine = aType.getToken( 0, ':', nTypeIndex ); if( nTypeIndex < 0 ) // ensure at least three tokens continue; - OString aDesc = aType.getToken( 0, ':', nTypeIndex ); + OString aDesc = aType.getToken( 0, ':', nTypeIndex ); // create extension list string sal_Int32 nExtIndex = 0; @@ -141,11 +141,11 @@ static bool CheckPlugin( const ByteString& rPath, list< PluginDescription* >& rD PluginDescription* pNew = new PluginDescription; // set plugin name (path to library) - pNew->PluginName = OStringToOUString( rPath, aEncoding ); + pNew->PluginName = OStringToOUString( rPath, aEncoding ); // set mimetype - pNew->Mimetype = OStringToOUString( aMimetype, aEncoding ); + pNew->Mimetype = OStringToOUString( aMimetype, aEncoding ); // set extension line - pNew->Extension = OStringToOUString( aExtension.makeStringAndClear(), aEncoding ); + pNew->Extension = OStringToOUString( aExtension.makeStringAndClear(), aEncoding ); // set description pNew->Description= OStringToOUString( aDesc, aEncoding ); rDescriptions.push_back( pNew ); @@ -201,7 +201,7 @@ static void CheckPluginRegistryFiles( const rtl::OString& rPath, list< PluginDes } fclose( fp ); } - + // check subdirectories DIR* pDIR = opendir( rPath.getStr() ); struct dirent* pDirEnt = NULL; @@ -216,7 +216,7 @@ static void CheckPluginRegistryFiles( const rtl::OString& rPath, list< PluginDes aBuf.append( rPath ); aBuf.append( '/' ); aBuf.append( pBaseName ); - + if( ! stat( aBuf.getStr(), &aStat ) ) { if( S_ISDIR( aStat.st_mode ) ) diff --git a/extensions/source/plugin/win/sysplug.cxx b/extensions/source/plugin/win/sysplug.cxx index 1d117f6927d5..05ab01550a1d 100644 --- a/extensions/source/plugin/win/sysplug.cxx +++ b/extensions/source/plugin/win/sysplug.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -101,7 +101,7 @@ PluginComm_Impl::~PluginComm_Impl() { if (_plDLL) { -// NPP_Shutdown(); +// NPP_Shutdown(); NPError (WINAPI * pShutdown)(); if (retrieveFunction( _T("NP_Shutdown"), (void**)&pShutdown )) diff --git a/extensions/source/plugin/win/winmgr.cxx b/extensions/source/plugin/win/winmgr.cxx index e4a9d9732c24..a4144c51f36d 100644 --- a/extensions/source/plugin/win/winmgr.cxx +++ b/extensions/source/plugin/win/winmgr.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -410,7 +410,7 @@ Sequence< PluginDescription > XPluginManager_Impl::impl_getPluginDescriptions(vo OString aExtToken2( aExt.getToken( 0, '|', nIndex2 ) ); if( aMIMEToken.getLength() == 0 || aExtToken2.getLength() == 0 ) continue; - + rDescr.Mimetype = OUString( aMIMEToken.getStr(), aMIMEToken.getLength(), RTL_TEXTENCODING_MS_1252 ); if (! rDescr.Mimetype.getLength()) |