diff options
Diffstat (limited to 'extensions/source/nsplugin')
-rw-r--r-- | extensions/source/nsplugin/source/npshell.cxx | 2 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/npshell.hxx | 2 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/ns_debug.hxx | 2 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/nsp_func.hxx | 8 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/nsp_windows.cxx | 16 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/nsp_windows.hxx | 4 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/so_closelistener.cxx | 2 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/so_closelistener.hxx | 4 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/so_env.cxx | 6 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/so_env.hxx | 6 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/so_instance.cxx | 130 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/so_instance.hxx | 14 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/so_main.cxx | 38 | ||||
-rw-r--r-- | extensions/source/nsplugin/source/so_msg.hxx | 4 |
14 files changed, 119 insertions, 119 deletions
diff --git a/extensions/source/nsplugin/source/npshell.cxx b/extensions/source/nsplugin/source/npshell.cxx index 94edb1b0e48c..03d4b771e6d7 100644 --- a/extensions/source/nsplugin/source/npshell.cxx +++ b/extensions/source/nsplugin/source/npshell.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/nsplugin/source/npshell.hxx b/extensions/source/nsplugin/source/npshell.hxx index 2f9cfb5bf4d1..588782bd5405 100644 --- a/extensions/source/nsplugin/source/npshell.hxx +++ b/extensions/source/nsplugin/source/npshell.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 diff --git a/extensions/source/nsplugin/source/ns_debug.hxx b/extensions/source/nsplugin/source/ns_debug.hxx index e1782c5da5e7..bf191a655eb4 100644 --- a/extensions/source/nsplugin/source/ns_debug.hxx +++ b/extensions/source/nsplugin/source/ns_debug.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 diff --git a/extensions/source/nsplugin/source/nsp_func.hxx b/extensions/source/nsplugin/source/nsp_func.hxx index e132235ec4b6..3dddd99611b7 100644 --- a/extensions/source/nsplugin/source/nsp_func.hxx +++ b/extensions/source/nsplugin/source/nsp_func.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 @@ -48,7 +48,7 @@ typedef int NSP_PIPE_FD; #define NSP_Write_Pipe(a, b, c, d) write(a, b, c) #define NSP_Read_Pipe(a, b, c, d) read(a, b, c) -//for socket +//for socket #define NSP_CloseSocket close //for sleep @@ -85,13 +85,13 @@ SECURITY_ATTRIBUTES NSP_pipe_access = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE //for execl() #define NSP_CreateProcess(a, b ) CreateProcess(a, b, NULL, NULL, TRUE, 0, NULL, NULL, NULL, NULL) -//for socket +//for socket #define NSP_CloseSocket closesocket //for sleep #define NSP_Sleep(a) Sleep(a*1000) //for mutex -#define NSP_Mute_Obj HANDLE +#define NSP_Mute_Obj HANDLE #define NSP_New_Mute_Obj() CreateMutex (NULL, FALSE, NULL) #define NSP_Lock_Mute_Obj(a) WaitForSingleObject(a, INFINITE) #define NSP_Unlock_Mute_Obj(a) ReleaseMutex(a) diff --git a/extensions/source/nsplugin/source/nsp_windows.cxx b/extensions/source/nsplugin/source/nsp_windows.cxx index 58a56b7c82e5..60cf172a1669 100644 --- a/extensions/source/nsplugin/source/nsp_windows.cxx +++ b/extensions/source/nsplugin/source/nsp_windows.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 @@ -38,26 +38,26 @@ int NSP_ResetWinStyl(long hParent) { int ret = 0; -#ifdef WNT +#ifdef WNT LONG dOldStyl = GetWindowLong( (HWND)hParent, GWL_STYLE); ret = dOldStyl; - + if(ret != 0) { LONG dNewStyl = dOldStyl|WS_CLIPCHILDREN; if(0 == SetWindowLong((HWND)hParent, GWL_STYLE, dNewStyl)) ret = 0; } -#endif +#endif return ret; - + } int NSP_RestoreWinStyl(long hParent, long dOldStyle) { int ret = 0; -#ifdef WNT +#ifdef WNT ret = SetWindowLong((HWND)hParent, GWL_STYLE, dOldStyle); -#endif - return ret; +#endif + return ret; } diff --git a/extensions/source/nsplugin/source/nsp_windows.hxx b/extensions/source/nsplugin/source/nsp_windows.hxx index 707bb8bf515d..b6ddfcf72903 100644 --- a/extensions/source/nsplugin/source/nsp_windows.hxx +++ b/extensions/source/nsplugin/source/nsp_windows.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 @@ -28,7 +28,7 @@ #ifndef __NSP_WINDOWS_HXX__ #define __NSP_WINDOWS_HXX__ - + int NSP_ResetWinStyl(long hParent); int NSP_RestoreWinStyl(long hParent, long dOldStyle); diff --git a/extensions/source/nsplugin/source/so_closelistener.cxx b/extensions/source/nsplugin/source/so_closelistener.cxx index 8836b9f3dc17..b4ea10702a6e 100644 --- a/extensions/source/nsplugin/source/so_closelistener.cxx +++ b/extensions/source/nsplugin/source/so_closelistener.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/nsplugin/source/so_closelistener.hxx b/extensions/source/nsplugin/source/so_closelistener.hxx index 7ce20c9eaaf6..276b6f9ea128 100644 --- a/extensions/source/nsplugin/source/so_closelistener.hxx +++ b/extensions/source/nsplugin/source/so_closelistener.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 @@ -48,7 +48,7 @@ public: virtual void SAL_CALL notifyClosing( const ::com::sun::star::lang::EventObject& aEvent ) throw ( ::com::sun::star::uno::RuntimeException ) ; virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) throw ( ::com::sun::star::uno::RuntimeException ) ; -}; +}; #endif diff --git a/extensions/source/nsplugin/source/so_env.cxx b/extensions/source/nsplugin/source/so_env.cxx index 5e86da9726b9..325c64cf84aa 100644 --- a/extensions/source/nsplugin/source/so_env.cxx +++ b/extensions/source/nsplugin/source/so_env.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 @@ -109,7 +109,7 @@ restoreUTF8(char *pPath) unsigned char *s, *d; #define XDIGIT(c) ((c) <= '9' ? (c) - '0' : ((c) & 0x4F) - 'A' + 10) - + s = d = (unsigned char *)pPath; do { if (*s == '%' && s[1] && s[2]) { @@ -224,7 +224,7 @@ int nspluginOOoModuleHook (void** aResult) *aResult = realFileName; fprintf (stderr, "OpenOffice path is '%s'\n", realFileName); - + return 0; } #endif diff --git a/extensions/source/nsplugin/source/so_env.hxx b/extensions/source/nsplugin/source/so_env.hxx index 0cf1194c2dc2..18853f35faac 100644 --- a/extensions/source/nsplugin/source/so_env.hxx +++ b/extensions/source/nsplugin/source/so_env.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 @@ -52,7 +52,7 @@ #ifdef UNIX #define STAROFFICE_VERSION_FILE "/.sversionrc" #define STAROFFICE_EXE_FILE_NAME "soffice" -#endif +#endif #ifdef WNT #define STAROFFICE_VERSION_FILE "\\sversion.ini" #define STAROFFICE_EXE_FILE_NAME "soffice.exe" @@ -71,7 +71,7 @@ const char* findInstallDir(); // return SO program dir absolute path, like "/home/build/staroffice/program" const char* findProgramDir(); - + #ifdef WNT // return SO executable absolute path, like "/home/build/staroffice/program/soffice" const char* findSofficeExecutable(); diff --git a/extensions/source/nsplugin/source/so_instance.cxx b/extensions/source/nsplugin/source/so_instance.cxx index 4b1e41f724bd..0c462a41e704 100644 --- a/extensions/source/nsplugin/source/so_instance.cxx +++ b/extensions/source/nsplugin/source/so_instance.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 @@ -35,15 +35,15 @@ #include <com/sun/star/awt/XVclWindowPeer.hpp> #include <com/sun/star/util/XCloseable.hpp> #include <com/sun/star/lang/DisposedException.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess.hpp> -#include <com/sun/star/presentation/XPresentation.hpp> -#include <com/sun/star/presentation/XPresentationSupplier.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/presentation/XPresentation.hpp> +#include <com/sun/star/presentation/XPresentationSupplier.hpp> #include <tools/debug.hxx> #include <tools/color.hxx> #include <vcl/window.hxx> #include <rtl/textenc.h> #include <rtl/locale.h> -#include <osl/nlsupport.h> +#include <osl/nlsupport.h> #include <stdio.h> #include <stdlib.h> @@ -83,12 +83,12 @@ SoPluginInstance::SoPluginInstance(long pParent, Reference< XMultiServiceFactory m_nHeight = 0; m_nX = 0; m_nY = 0; - m_nFlag = 15; + m_nFlag = 15; m_bInit = sal_False; m_sURL = rtl::OUString::createFromAscii(""); m_hParent = 0; m_pParent = pParent; - m_dParentStyl = 0; + m_dParentStyl = 0; mxRemoteMSF = xMSF; } @@ -101,8 +101,8 @@ sal_Bool SoPluginInstance::SetURL(char* aURL) debug_fprintf(NSP_LOG_APPEND, "SoPluginInstance::SetURL %s\n", aURL); sal_uInt16 encoding = 11; - rtl_Locale* pLocale = NULL; - osl_getProcessLocale(&pLocale); + rtl_Locale* pLocale = NULL; + osl_getProcessLocale(&pLocale); encoding = osl_getTextEncodingFromLocale(pLocale); m_sURL = ::rtl::OUString(aURL, strlen(aURL), encoding); @@ -119,7 +119,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) { debug_fprintf(NSP_LOG_APPEND, "only reset windows size\n"); m_xUnoWin->setPosSize( m_nX, m_nY, m_nWidth, m_nHeight, m_nFlag ); - debug_fprintf(NSP_LOG_APPEND, "set windows to x:%d y:%d w:%d h%d falg:%d\n", + debug_fprintf(NSP_LOG_APPEND, "set windows to x:%d y:%d w:%d h%d falg:%d\n", m_nX, m_nY, m_nWidth, m_nHeight, m_nFlag); return sal_True; } @@ -134,7 +134,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) try { // try to create netscape plugin window - Reference< awt::XToolkit > xToolkit( + Reference< awt::XToolkit > xToolkit( mxRemoteMSF->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY ); if( !xToolkit.is() ) @@ -142,7 +142,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) debug_fprintf(NSP_LOG_APPEND, "Can not create Toolkit!\n"); return sal_False; } - + // prepare parameters for plugin window css::uno::Any hwndParent = css::uno::makeAny((sal_Int32)hParent); #ifdef UNIX @@ -151,10 +151,10 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) #ifdef WNT sal_Int16 nWindowType = css::lang::SystemDependent::SYSTEM_WIN32; #endif //end of WNT - + Reference< awt::XSystemChildFactory > xToolkitSystemChildFactory(xToolkit, uno::UNO_QUERY); if (!xToolkitSystemChildFactory.is()) - { + { debug_fprintf(NSP_LOG_APPEND, "print by Nsplugin, get xToolkitSystemChildFactory failure.\n"); return sal_False; } @@ -162,8 +162,8 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) debug_fprintf(NSP_LOG_APPEND, "print by Nsplugin, try to create plugin container window HWIN:%ld.\n", hParent); // create the plugin window - Reference< awt::XWindowPeer > xNewWinPeer = - xToolkitSystemChildFactory->createSystemChild( hwndParent, + Reference< awt::XWindowPeer > xNewWinPeer = + xToolkitSystemChildFactory->createSystemChild( hwndParent, css::uno::Sequence<sal_Int8>(), nWindowType ); if ( !xNewWinPeer.is() ) { @@ -183,7 +183,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) xNewWinPeer->setBackground( COL_GRAY ); m_xUnoWin->setVisible( sal_True ); m_xUnoWin->setPosSize( m_nX, m_nY, m_nWidth, m_nHeight, m_nFlag ); - debug_fprintf(NSP_LOG_APPEND, "set windows to x:%d y:%d w:%d h%d falg:%d\n", + debug_fprintf(NSP_LOG_APPEND, "set windows to x:%d y:%d w:%d h%d falg:%d\n", m_nX, m_nY, m_nWidth, m_nHeight, m_nFlag); // create frame @@ -198,7 +198,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) // initialize frame m_xFrame->initialize( m_xUnoWin ); - + try { // currently ignore errors in this code @@ -210,9 +210,9 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) } catch( uno::Exception& ) {} - + // get frames supplier - Reference< frame::XFramesSupplier > m_xFramesSupplier( + Reference< frame::XFramesSupplier > m_xFramesSupplier( mxRemoteMSF->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop") ), uno::UNO_QUERY ); if ( !m_xFramesSupplier.is() ) @@ -220,7 +220,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) debug_fprintf(NSP_LOG_APPEND, "can not get desktop\n"); return sal_False; } - + // get frames m_xFrames = m_xFramesSupplier->getFrames(); if ( !m_xFrames.is() ) @@ -228,10 +228,10 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) debug_fprintf(NSP_LOG_APPEND, "can not get frames from FramesSupplier\n"); return sal_False; } - + // append m_xFrame to m_xFrames m_xFrames->append( m_xFrame ); - + // create XComponentLoader Reference< frame::XComponentLoader > xLoader( m_xFrame, uno::UNO_QUERY ); if ( !xLoader.is() ) @@ -239,7 +239,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) debug_fprintf(NSP_LOG_APPEND, "can not get ComponentLoader to load URL\n"); return sal_False; } - + //create stream for the document Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSimpleFileAccess( mxRemoteMSF->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.ucb.SimpleFileAccess") ), @@ -247,14 +247,14 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) if(!xSimpleFileAccess.is()) { debug_fprintf(NSP_LOG_APPEND, "can not create SimpleFileAccess to load URL\n"); - return sal_False; + return sal_False; } - Reference<io::XInputStream> xInputStream = xSimpleFileAccess->openFileRead( m_sURL ); - + Reference<io::XInputStream> xInputStream = xSimpleFileAccess->openFileRead( m_sURL ); + if(!xInputStream.is()) { debug_fprintf(NSP_LOG_APPEND, "can not create XInputStream for URL\n"); - return sal_False; + return sal_False; } // prepare to load document @@ -270,35 +270,35 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) setPropValues[ 3 ].Name = "FilterName"; setPropValues[ 3 ].Value = "Flat XML File";*/ - debug_fprintf(NSP_LOG_APPEND, "try to load copy of URL from local file %s:%d\n", - ::rtl::OUStringToOString( m_sURL, RTL_TEXTENCODING_ASCII_US ).getStr( ), + debug_fprintf(NSP_LOG_APPEND, "try to load copy of URL from local file %s:%d\n", + ::rtl::OUStringToOString( m_sURL, RTL_TEXTENCODING_ASCII_US ).getStr( ), m_sURL.getLength() ); - + // load document -/* +/* m_xComponent = xLoader->loadComponentFromURL( - OUString(RTL_CONSTASCII_USTRINGPARAM("private:stream")), //m_sURL, + OUString(RTL_CONSTASCII_USTRINGPARAM("private:stream")), //m_sURL, m_xFrame->getName(), 0, setPropValues ); - */ + */ Sequence< ::com::sun::star::beans::PropertyValue > setPropValues2(3); setPropValues2[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("ViewOnly") ); setPropValues2[0].Value <<= sal_True; setPropValues2[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ); - setPropValues2[1].Value <<= sal_True; + setPropValues2[1].Value <<= sal_True; setPropValues2[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("AsTemplate") ); - setPropValues2[2].Value <<= sal_False; + setPropValues2[2].Value <<= sal_False; m_xComponent = xLoader->loadComponentFromURL( - m_sURL, - m_xFrame->getName(), 0, setPropValues2 ); - + m_sURL, + m_xFrame->getName(), 0, setPropValues2 ); + if ( !m_xComponent.is() ) { debug_fprintf(NSP_LOG_APPEND, "print by Nsplugin, Load Componment error\n"); return sal_False; - } - + } + // register the closelistener that will prevent closing of the component Reference< util::XCloseable > xCloseable( m_xFrame, uno::UNO_QUERY ); if ( xCloseable.is() ) @@ -314,7 +314,7 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) debug_fprintf(NSP_LOG_APPEND, "load document success\n"); // create frame::XDispatchHelper and frame::XDispatchProvider - m_xDispatcher = Reference< frame::XDispatchHelper > ( + m_xDispatcher = Reference< frame::XDispatchHelper > ( mxRemoteMSF->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.DispatchHelper")), uno::UNO_QUERY ); if(!m_xDispatcher.is()) @@ -326,23 +326,23 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) if(!m_xDispatchProvider.is()) { debug_fprintf(NSP_LOG_APPEND, "m_xDispatchProvider can not be getten\n"); - return sal_False; + return sal_False; } //try to enable toolbar and tool windows Sequence< ::com::sun::star::beans::PropertyValue > propertyValue(1); propertyValue[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM("FunctionBarVisible") ); propertyValue[0].Value <<= sal_True; - m_xDispatcher->executeDispatch(m_xDispatchProvider, - ::rtl::OUString::createFromAscii(".uno:FunctionBarVisible"), + m_xDispatcher->executeDispatch(m_xDispatchProvider, + ::rtl::OUString::createFromAscii(".uno:FunctionBarVisible"), m_xFrame->getName(), 0, - propertyValue ); - + propertyValue ); + // reset window style of parent window #ifdef WNT - m_dParentStyl = ::NSP_ResetWinStyl (m_hParent); + m_dParentStyl = ::NSP_ResetWinStyl (m_hParent); #endif - m_bInit = sal_True; + m_bInit = sal_True; try { @@ -381,10 +381,10 @@ sal_Bool SoPluginInstance::SetWindow(NSP_HWND hParent, int x, int y, int w, int { m_hParent = hParent; - debug_fprintf(NSP_LOG_APPEND, "SoPluginInstance::SetWindow %s : %d\n", - ::rtl::OUStringToOString(m_sURL, RTL_TEXTENCODING_ASCII_US).getStr(), + debug_fprintf(NSP_LOG_APPEND, "SoPluginInstance::SetWindow %s : %d\n", + ::rtl::OUStringToOString(m_sURL, RTL_TEXTENCODING_ASCII_US).getStr(), m_sURL.getLength() ); - m_nWidth = w; + m_nWidth = w; m_nHeight =h; m_nX = x; m_nY = y; @@ -405,7 +405,7 @@ sal_Bool SoPluginInstance::SetWindow(NSP_HWND hParent, int x, int y, int w, int mxRemoteMSF = Reference< XMultiServiceFactory >(); m_bInit = sal_False; bRetval = LoadDocument(hParent); - debug_fprintf(NSP_LOG_APPEND, "load document again, return %d\n", bRetval); + debug_fprintf(NSP_LOG_APPEND, "load document again, return %d\n", bRetval); } } @@ -414,16 +414,16 @@ sal_Bool SoPluginInstance::SetWindow(NSP_HWND hParent, int x, int y, int w, int sal_Bool SoPluginInstance::Destroy(void) { -#ifdef WNT +#ifdef WNT if(m_dParentStyl != 0) NSP_RestoreWinStyl(m_hParent, m_dParentStyl); #endif -// if(m_xDispatcher.is()){ -// m_xDispatcher->executeDispatch(m_xDispatchProvider, -// ::rtl::OUString::createFromAscii(".uno:CloseFrame"), +// if(m_xDispatcher.is()){ +// m_xDispatcher->executeDispatch(m_xDispatchProvider, +// ::rtl::OUString::createFromAscii(".uno:CloseFrame"), // ::rtl::OUString::createFromAscii("_top"), 0, // Sequence< ::com::sun::star::beans::PropertyValue >() ); -// } +// } uno::Reference< util::XCloseable > xCloseable( m_xFrame, uno::UNO_QUERY ); @@ -450,7 +450,7 @@ sal_Bool SoPluginInstance::Destroy(void) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.DocumentCloser" ) ), aArgs ), uno::UNO_QUERY_THROW ); - + xDocumentCloser->dispose(); // this call should close the document } catch( uno::Exception& ) @@ -478,18 +478,18 @@ sal_Bool SoPluginInstance::Destroy(void) m_xFrames = Reference< frame::XFrames >(); m_xDispatcher = Reference< frame::XDispatchHelper >(); m_xDispatchProvider = Reference< frame::XDispatchProvider >(); - return sal_True; -} + return sal_True; +} sal_Bool SoPluginInstance::Print(void) { if(!m_xDispatcher.is()) return sal_False; - + Sequence< ::com::sun::star::beans::PropertyValue > propertyValue(1); - m_xDispatcher->executeDispatch(m_xDispatchProvider, - ::rtl::OUString::createFromAscii(".uno:PrintDefault"), + m_xDispatcher->executeDispatch(m_xDispatchProvider, + ::rtl::OUString::createFromAscii(".uno:PrintDefault"), m_xFrame->getName(), 0, - propertyValue ); + propertyValue ); return sal_True; } diff --git a/extensions/source/nsplugin/source/so_instance.hxx b/extensions/source/nsplugin/source/so_instance.hxx index e95bb7c024ec..97d65a966ee0 100644 --- a/extensions/source/nsplugin/source/so_instance.hxx +++ b/extensions/source/nsplugin/source/so_instance.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 @@ -54,7 +54,7 @@ typedef sal_Int32 NSP_HWND; class PluginDocumentClosePreventer; -class SoPluginInstance +class SoPluginInstance { private: @@ -62,7 +62,7 @@ private: static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxRemoteMSF; // Dir where Soffice is in, ie. /Soffice7/program static char sSO_Dir[NPP_PATH_MAX]; - int m_nWidth; + int m_nWidth; int m_nHeight; int m_nX; int m_nY; @@ -70,7 +70,7 @@ private: ::rtl::OUString m_sURL; // URL of the document to be loaded sal_Bool m_bInit; // If the Plugin instance is initilaized. NSP_HWND m_hParent; // Windows handle of parent window - long m_pParent; // ID of this instance - get from NPP + long m_pParent; // ID of this instance - get from NPP // StarOffice window ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xUnoWin; // StarOffice component window @@ -89,14 +89,14 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener > m_xCloseListener; sal_Bool LoadDocument(NSP_HWND hParent); - + long m_dParentStyl; // Old Windows style of parent window - + public: SoPluginInstance(long iInstance, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF); virtual ~SoPluginInstance(void); - virtual sal_Bool SetURL(char* aURL); + virtual sal_Bool SetURL(char* aURL); virtual sal_Bool IsInit(void){return m_bInit;}; virtual sal_Bool SetWindow(NSP_HWND hParent, int x, int y, int w, int h) ; virtual sal_Bool Destroy(void) ; diff --git a/extensions/source/nsplugin/source/so_main.cxx b/extensions/source/nsplugin/source/so_main.cxx index 49c899994424..2525fe1d1d15 100644 --- a/extensions/source/nsplugin/source/so_main.cxx +++ b/extensions/source/nsplugin/source/so_main.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,7 +41,7 @@ #endif #pragma warning (push,1) #pragma warning (disable:4668) -#define WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN #include <windows.h> #include <winsock2.h> #include <stdlib.h> @@ -97,23 +97,23 @@ using namespace ::com::sun::star::uno; SoPluginInstance* lpInstance[MAX_NODE_NUM]; -static NSP_PIPE_FD la_read_fd = 0; +static NSP_PIPE_FD la_read_fd = 0; static char const * progdir = NULL; long int NSP_ReadFromPipe(NSP_PIPE_FD fp, void* buf, unsigned long int len) { unsigned long int len_unix = 0, len_wnt = 0; - + len_unix = NSP_Read_Pipe(fp, buf, len, &len_wnt); #ifdef UNIX (void)len_wnt; return len_unix; -#endif //end of UNIX +#endif //end of UNIX #ifdef WNT - return len_wnt; -#endif //end of WNT - + return len_wnt; +#endif //end of WNT + } int find_free_node() @@ -130,7 +130,7 @@ int find_cur_node(long cur_id) { for(int i=0; i<MAX_NODE_NUM; i++) { - if(lpInstance[i] == NULL) + if(lpInstance[i] == NULL) continue; if(cur_id == lpInstance[i]->GetParent()) return i; @@ -143,9 +143,9 @@ sal_Bool dump_plugin_message(PLUGIN_MSG* pMsg) if (!pMsg) return sal_False; debug_fprintf(NSP_LOG_APPEND, "NSPlugin Message: msg_id:%d; instance_id:%d;wnd_id:%d;wnd_x:%d;wnd_y:%d;wnd_w:%d;wnd_h:%d; url:%s\n", - pMsg->msg_id, pMsg->instance_id, pMsg->wnd_id, + pMsg->msg_id, pMsg->instance_id, pMsg->wnd_id, pMsg->wnd_x, pMsg->wnd_y, pMsg->wnd_w, pMsg->wnd_h, pMsg->url); - return sal_True; + return sal_True; } int Set_Window(PLUGIN_MSG* pMsg) @@ -158,7 +158,7 @@ int Set_Window(PLUGIN_MSG* pMsg) pMsg->wnd_x, pMsg->wnd_y, pMsg->wnd_w, pMsg->wnd_h)) return 0; else - return -1; + return -1; } int Set_URL(PLUGIN_MSG* pMsg) @@ -170,7 +170,7 @@ int Set_URL(PLUGIN_MSG* pMsg) if(lpInstance[cur_no]->SetURL(pMsg->url)) return 0; else - return -1; + return -1; } int New_Instance(PLUGIN_MSG* pMsg, Reference< lang::XMultiServiceFactory > xMSF) @@ -293,7 +293,7 @@ Reference< lang::XMultiServiceFactory > SAL_CALL start_office(NSP_PIPE_FD read_f #endif //end of WNT // create default local component context - Reference< XComponentContext > xLocalContext( + Reference< XComponentContext > xLocalContext( defaultBootstrap_InitialComponentContext() ); if ( !xLocalContext.is() ) { @@ -340,14 +340,14 @@ Reference< lang::XMultiServiceFactory > SAL_CALL start_office(NSP_PIPE_FD read_f OSL_ASSERT( buf.getLength() == 0 ); buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "uno:pipe,name=" ) ); buf.append( aPluginPipeName ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( + buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( ";urp;StarOffice.ComponentContext" ) ); OUString sConnectString( buf.makeStringAndClear() ); try { // try to connect to office, no need to start instance again if office already started - xRemoteContext.set( + xRemoteContext.set( xUrlResolver->resolve( sConnectString ), UNO_QUERY_THROW ); debug_fprintf(NSP_LOG_APPEND, "Staroffice already start\n"); return Reference< lang::XMultiServiceFactory >(xRemoteContext->getServiceManager(), UNO_QUERY); @@ -374,7 +374,7 @@ Reference< lang::XMultiServiceFactory > SAL_CALL start_office(NSP_PIPE_FD read_f NULL); _exit(255); } -#else +#else (void) read_fd; /* avoid warning about unused parameter */ Security sec; oslProcess hProcess = 0; @@ -412,7 +412,7 @@ Reference< lang::XMultiServiceFactory > SAL_CALL start_office(NSP_PIPE_FD read_f try { // try to connect to office - xRemoteContext.set( + xRemoteContext.set( xUrlResolver->resolve( sConnectString ), UNO_QUERY_THROW ); return Reference< lang::XMultiServiceFactory >(xRemoteContext->getServiceManager(), UNO_QUERY); } @@ -458,7 +458,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) fd_pipe[0] = (NSP_PIPE_FD) iPipe[0] ; fd_pipe[1] = (NSP_PIPE_FD) iPipe[1] ; NSP_Close_Pipe(fd_pipe[1]); - + la_read_fd = fd_pipe[0]; if(la_read_fd < 0) { diff --git a/extensions/source/nsplugin/source/so_msg.hxx b/extensions/source/nsplugin/source/so_msg.hxx index ee3d5fff75f8..7f2228d543dd 100644 --- a/extensions/source/nsplugin/source/so_msg.hxx +++ b/extensions/source/nsplugin/source/so_msg.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 @@ -33,7 +33,7 @@ enum msg_type SO_SET_WINDOW, // 1 SO_SET_URL, // 2 SO_NEW_INSTANCE, // 3 - SO_DESTROY, // 4 + SO_DESTROY, // 4 SO_SHUTDOWN, // 5 SO_PRINT // 6 }; |