LCOV - code coverage report
Current view: top level - svx/source/form - fmscriptingenv.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 620 659 94.1 %
Date: 2014-11-03 Functions: 28 31 90.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <config_features.h>
      21             : 
      22             : #include "fmscriptingenv.hxx"
      23             : #include "svx/fmmodel.hxx"
      24             : 
      25             : #include <com/sun/star/lang/IllegalArgumentException.hpp>
      26             : #include <com/sun/star/script/XScriptListener.hpp>
      27             : #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
      28             : #include <com/sun/star/reflection/XInterfaceMethodTypeDescription.hpp>
      29             : #include <com/sun/star/lang/DisposedException.hpp>
      30             : #include <com/sun/star/lang/EventObject.hpp>
      31             : #include <com/sun/star/awt/XControl.hpp>
      32             : 
      33             : #include <tools/diagnose_ex.h>
      34             : #include <cppuhelper/implbase1.hxx>
      35             : #include <comphelper/processfactory.hxx>
      36             : #include <vcl/svapp.hxx>
      37             : #include <osl/mutex.hxx>
      38             : #include <sfx2/objsh.hxx>
      39             : #include <sfx2/app.hxx>
      40             : #include <basic/basmgr.hxx>
      41             : 
      42             : #include <boost/noncopyable.hpp>
      43             : #include <boost/shared_ptr.hpp>
      44             : #include <boost/assign/list_of.hpp>
      45             : #include <utility>
      46             : using std::pair;
      47             : #include <set>
      48             : 
      49             : 
      50             : namespace svxform
      51             : {
      52             : 
      53             : 
      54             :     using ::com::sun::star::uno::Reference;
      55             :     using ::com::sun::star::script::XEventAttacherManager;
      56             :     using ::com::sun::star::lang::IllegalArgumentException;
      57             :     using ::com::sun::star::script::XScriptListener;
      58             :     using ::com::sun::star::script::ScriptEvent;
      59             :     using ::com::sun::star::lang::EventObject;
      60             :     using ::com::sun::star::reflection::InvocationTargetException;
      61             :     using ::com::sun::star::uno::Any;
      62             :     using ::com::sun::star::container::XHierarchicalNameAccess;
      63             :     using ::com::sun::star::reflection::XInterfaceMethodTypeDescription;
      64             :     using ::com::sun::star::uno::UNO_QUERY_THROW;
      65             :     using ::com::sun::star::lang::DisposedException;
      66             :     using ::com::sun::star::uno::RuntimeException;
      67             :     using ::com::sun::star::uno::Exception;
      68             :     using ::com::sun::star::uno::Sequence;
      69             :     using ::com::sun::star::uno::XInterface;
      70             :     using ::com::sun::star::awt::XControl;
      71             :     using ::com::sun::star::beans::XPropertySet;
      72             : 
      73             :     class FormScriptingEnvironment;
      74             : 
      75             : 
      76             :     //= FormScriptListener
      77             : 
      78             :     typedef ::cppu::WeakImplHelper1 <   XScriptListener
      79             :                                     >   FormScriptListener_Base;
      80             : 
      81             :     /** implements the XScriptListener interface, is used by FormScriptingEnvironment
      82             :     */
      83             :     class FormScriptListener    :public FormScriptListener_Base
      84             :     {
      85             :     private:
      86             :         ::osl::Mutex m_aMutex;
      87             :         FormScriptingEnvironment *m_pScriptExecutor;
      88             : 
      89             :     public:
      90             :         FormScriptListener( FormScriptingEnvironment * pScriptExecutor );
      91             : 
      92             :         // XScriptListener
      93             :         virtual void SAL_CALL firing( const ScriptEvent& aEvent ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
      94             :         virtual Any SAL_CALL approveFiring( const ScriptEvent& aEvent ) throw (InvocationTargetException, RuntimeException, std::exception) SAL_OVERRIDE;
      95             :         // XEventListener
      96             :         virtual void SAL_CALL disposing( const EventObject& Source ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
      97             : 
      98             :         // lifetime control
      99             :         void SAL_CALL dispose();
     100             : 
     101             :     protected:
     102             :         virtual ~FormScriptListener();
     103             : 
     104             :     private:
     105             :         /** determines whether calling a given method at a given listener interface can be done asynchronously
     106             : 
     107             :             @param _rListenerType
     108             :                 the name of the UNO type whose method is to be checked
     109             :             @param _rMethodName
     110             :                 the name of the method at the interface determined by _rListenerType
     111             : 
     112             :             @return
     113             :                 <TRUE/> if and only if the method is declared <code>oneway</code>, i.e. can be called asynchronously
     114             :         */
     115             :         bool    impl_allowAsynchronousCall_nothrow( const OUString& _rListenerType, const OUString& _rMethodName ) const;
     116             : 
     117             :         /** determines whether the instance is already disposed
     118             :         */
     119           4 :         bool    impl_isDisposed_nothrow() const { return !m_pScriptExecutor; }
     120             : 
     121             :         /** fires the given script event in a thread-safe manner
     122             : 
     123             :             This methods calls our script executor's doFireScriptEvent, with previously releasing the given mutex guard,
     124             :             but ensuring that our script executor is not deleted between this release and the actual call.
     125             : 
     126             :             @param _rGuard
     127             :                 a clearable guard to our mutex. Must be the only active guard to our mutex.
     128             :             @param _rEvent
     129             :                 the event to fire
     130             :             @param _pSyncronousResult
     131             :                 a place to take a possible result of the script call.
     132             : 
     133             :             @precond
     134             :                 m_pScriptExecutor is not <NULL/>.
     135             :         */
     136             :         void    impl_doFireScriptEvent_nothrow( ::osl::ClearableMutexGuard& _rGuard, const ScriptEvent& _rEvent, Any* _pSyncronousResult );
     137             : 
     138             :     private:
     139             :         DECL_LINK( OnAsyncScriptEvent, ScriptEvent* );
     140             :     };
     141             : 
     142             :     class FormScriptingEnvironment:
     143             :         public IFormScriptingEnvironment, private boost::noncopyable
     144             :     {
     145             :     private:
     146             :         typedef rtl::Reference<FormScriptListener> ListenerImplementation;
     147             : 
     148             :     private:
     149             :         ::osl::Mutex            m_aMutex;
     150             :         ListenerImplementation  m_pScriptListener;
     151             :         FmFormModel&            m_rFormModel;
     152             :         bool                    m_bDisposed;
     153             : 
     154             :     public:
     155             :         FormScriptingEnvironment( FmFormModel& _rModel );
     156             :         virtual ~FormScriptingEnvironment();
     157             : 
     158             :         // callback for FormScriptListener
     159             :         void doFireScriptEvent( const ScriptEvent& _rEvent, Any* _pSyncronousResult );
     160             : 
     161             :         // IFormScriptingEnvironment
     162             :         virtual void registerEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager ) SAL_OVERRIDE;
     163             :         virtual void revokeEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager ) SAL_OVERRIDE;
     164             :         virtual void dispose() SAL_OVERRIDE;
     165             : 
     166             :     private:
     167             :         void impl_registerOrRevoke_throw( const Reference< XEventAttacherManager >& _rxManager, bool _bRegister );
     168             :     };
     169             : 
     170        6320 :     FormScriptListener::FormScriptListener( FormScriptingEnvironment* pScriptExecutor )
     171        6320 :         :m_pScriptExecutor( pScriptExecutor )
     172             :     {
     173        6320 :     }
     174             : 
     175             : 
     176       12622 :     FormScriptListener::~FormScriptListener()
     177             :     {
     178       12622 :     }
     179             : 
     180             : 
     181           2 :     bool FormScriptListener::impl_allowAsynchronousCall_nothrow( const OUString& _rListenerType, const OUString& _rMethodName ) const
     182             :     {
     183             :         // This used to be implemented as:
     184             :         // is (_rListenerType + "::" + _rMethodName) a oneway function?
     185             :         // since we got rid of the notion of oneway, this is the list
     186             :         // of oneway methods, autogenerated by postprocessing of
     187             :         // commitdiff 90eac3e69749a9227c4b6902b1f3cef1e338c6d1
     188             :         static std::set< pair< OUString, OUString > > delayed_event_listeners =
     189             :             boost::assign::list_of
     190             :             (pair<OUString,OUString>("com.sun.star.accessibility.XAccessibleComponent","grabFocus"))
     191           4 :             (pair<OUString,OUString>("com.sun.star.accessibility.XAccessibleEventBroadcaster","addAccessibleEventListener"))
     192           6 :             (pair<OUString,OUString>("com.sun.star.accessibility.XAccessibleEventBroadcaster","removeAccessibleEventListener"))
     193           6 :             (pair<OUString,OUString>("com.sun.star.accessibility.XAccessibleSelection","clearAccessibleSelection"))
     194           6 :             (pair<OUString,OUString>("com.sun.star.accessibility.XAccessibleSelection","selectAllAccessibleChildren"))
     195           6 :             (pair<OUString,OUString>("com.sun.star.awt.XActionListener","actionPerformed"))
     196           6 :             (pair<OUString,OUString>("com.sun.star.awt.XActivateListener","windowActivated"))
     197           6 :             (pair<OUString,OUString>("com.sun.star.awt.XActivateListener","windowDeactivated"))
     198           6 :             (pair<OUString,OUString>("com.sun.star.awt.XAdjustmentListener","adjustmentValueChanged"))
     199           6 :             (pair<OUString,OUString>("com.sun.star.awt.XButton","addActionListener"))
     200           6 :             (pair<OUString,OUString>("com.sun.star.awt.XButton","removeActionListener"))
     201           6 :             (pair<OUString,OUString>("com.sun.star.awt.XButton","setLabel"))
     202           6 :             (pair<OUString,OUString>("com.sun.star.awt.XButton","setActionCommand"))
     203           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCheckBox","addItemListener"))
     204           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCheckBox","removeItemListener"))
     205           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCheckBox","setState"))
     206           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCheckBox","setLabel"))
     207           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCheckBox","enableTriState"))
     208           6 :             (pair<OUString,OUString>("com.sun.star.awt.XComboBox","addItemListener"))
     209           6 :             (pair<OUString,OUString>("com.sun.star.awt.XComboBox","removeItemListener"))
     210           6 :             (pair<OUString,OUString>("com.sun.star.awt.XComboBox","addActionListener"))
     211           6 :             (pair<OUString,OUString>("com.sun.star.awt.XComboBox","removeActionListener"))
     212           6 :             (pair<OUString,OUString>("com.sun.star.awt.XComboBox","addItem"))
     213           6 :             (pair<OUString,OUString>("com.sun.star.awt.XComboBox","addItems"))
     214           6 :             (pair<OUString,OUString>("com.sun.star.awt.XComboBox","removeItems"))
     215           6 :             (pair<OUString,OUString>("com.sun.star.awt.XComboBox","setDropDownLineCount"))
     216           6 :             (pair<OUString,OUString>("com.sun.star.awt.XControl","setContext"))
     217           6 :             (pair<OUString,OUString>("com.sun.star.awt.XControl","createPeer"))
     218           6 :             (pair<OUString,OUString>("com.sun.star.awt.XControl","setDesignMode"))
     219           6 :             (pair<OUString,OUString>("com.sun.star.awt.XControlContainer","setStatusText"))
     220           6 :             (pair<OUString,OUString>("com.sun.star.awt.XControlContainer","addControl"))
     221           6 :             (pair<OUString,OUString>("com.sun.star.awt.XControlContainer","removeControl"))
     222           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setValue"))
     223           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setMin"))
     224           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setMax"))
     225           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setFirst"))
     226           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setLast"))
     227           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setSpinSize"))
     228           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setDecimalDigits"))
     229           6 :             (pair<OUString,OUString>("com.sun.star.awt.XCurrencyField","setStrictFormat"))
     230           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDateField","setDate"))
     231           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDateField","setMin"))
     232           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDateField","setMax"))
     233           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDateField","setFirst"))
     234           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDateField","setLast"))
     235           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDateField","setLongFormat"))
     236           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDateField","setStrictFormat"))
     237           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDialog","setTitle"))
     238           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDisplayConnection","addEventHandler"))
     239           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDisplayConnection","removeEventHandler"))
     240           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDisplayConnection","addErrorHandler"))
     241           6 :             (pair<OUString,OUString>("com.sun.star.awt.XDisplayConnection","removeErrorHandler"))
     242           6 :             (pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","addTopWindowListener"))
     243           6 :             (pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","removeTopWindowListener"))
     244           6 :             (pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","addKeyHandler"))
     245           6 :             (pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","removeKeyHandler"))
     246           6 :             (pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","addFocusListener"))
     247           6 :             (pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","removeFocusListener"))
     248           6 :             (pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","fireFocusGained"))
     249           6 :             (pair<OUString,OUString>("com.sun.star.awt.XExtendedToolkit","fireFocusLost"))
     250           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFileDialog","setPath"))
     251           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFileDialog","setFilters"))
     252           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFileDialog","setCurrentFilter"))
     253           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFixedHyperlink","setText"))
     254           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFixedHyperlink","setURL"))
     255           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFixedHyperlink","setAlignment"))
     256           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFixedHyperlink","addActionListener"))
     257           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFixedHyperlink","removeActionListener"))
     258           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFixedText","setText"))
     259           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFixedText","setAlignment"))
     260           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFocusListener","focusGained"))
     261           6 :             (pair<OUString,OUString>("com.sun.star.awt.XFocusListener","focusLost"))
     262           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","setFont"))
     263           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","selectFont"))
     264           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","setTextColor"))
     265           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","setTextFillColor"))
     266           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","setLineColor"))
     267           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","setFillColor"))
     268           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","setRasterOp"))
     269           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","setClipRegion"))
     270           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","intersectClipRegion"))
     271           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","push"))
     272           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","pop"))
     273           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","copy"))
     274           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","draw"))
     275           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawPixel"))
     276           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawLine"))
     277           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawRect"))
     278           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawRoundedRect"))
     279           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawPolyLine"))
     280           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawPolygon"))
     281           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawPolyPolygon"))
     282           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawEllipse"))
     283           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawArc"))
     284           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawPie"))
     285           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawChord"))
     286           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawGradient"))
     287           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawText"))
     288           6 :             (pair<OUString,OUString>("com.sun.star.awt.XGraphics","drawTextArray"))
     289           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageButton","addActionListener"))
     290           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageButton","removeActionListener"))
     291           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageButton","setActionCommand"))
     292           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageConsumer","init"))
     293           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageConsumer","setColorModel"))
     294           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageConsumer","setPixelsByBytes"))
     295           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageConsumer","setPixelsByLongs"))
     296           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageConsumer","complete"))
     297           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageProducer","addConsumer"))
     298           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageProducer","removeConsumer"))
     299           6 :             (pair<OUString,OUString>("com.sun.star.awt.XImageProducer","startProduction"))
     300           6 :             (pair<OUString,OUString>("com.sun.star.awt.XItemEventBroadcaster","addItemListener"))
     301           6 :             (pair<OUString,OUString>("com.sun.star.awt.XItemEventBroadcaster","removeItemListener"))
     302           6 :             (pair<OUString,OUString>("com.sun.star.awt.XItemListener","itemStateChanged"))
     303           6 :             (pair<OUString,OUString>("com.sun.star.awt.XKeyListener","keyPressed"))
     304           6 :             (pair<OUString,OUString>("com.sun.star.awt.XKeyListener","keyReleased"))
     305           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","addItemListener"))
     306           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","removeItemListener"))
     307           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","addActionListener"))
     308           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","removeActionListener"))
     309           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","addItem"))
     310           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","addItems"))
     311           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","removeItems"))
     312           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","selectItemPos"))
     313           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","selectItemsPos"))
     314           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","selectItem"))
     315           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","setMultipleMode"))
     316           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","setDropDownLineCount"))
     317           6 :             (pair<OUString,OUString>("com.sun.star.awt.XListBox","makeVisible"))
     318           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenu","addMenuListener"))
     319           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenu","removeMenuListener"))
     320           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenu","insertItem"))
     321           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenu","removeItem"))
     322           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenu","enableItem"))
     323           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenu","setItemText"))
     324           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenu","setPopupMenu"))
     325           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenuListener","highlight"))
     326           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenuListener","select"))
     327           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenuListener","activate"))
     328           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMenuListener","deactivate"))
     329           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMessageBox","setCaptionText"))
     330           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMessageBox","setMessageText"))
     331           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMouseListener","mousePressed"))
     332           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMouseListener","mouseReleased"))
     333           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMouseListener","mouseEntered"))
     334           6 :             (pair<OUString,OUString>("com.sun.star.awt.XMouseListener","mouseExited"))
     335           6 :             (pair<OUString,OUString>("com.sun.star.awt.XNumericField","setValue"))
     336           6 :             (pair<OUString,OUString>("com.sun.star.awt.XNumericField","setMin"))
     337           6 :             (pair<OUString,OUString>("com.sun.star.awt.XNumericField","setMax"))
     338           6 :             (pair<OUString,OUString>("com.sun.star.awt.XNumericField","setFirst"))
     339           6 :             (pair<OUString,OUString>("com.sun.star.awt.XNumericField","setLast"))
     340           6 :             (pair<OUString,OUString>("com.sun.star.awt.XNumericField","setSpinSize"))
     341           6 :             (pair<OUString,OUString>("com.sun.star.awt.XNumericField","setDecimalDigits"))
     342           6 :             (pair<OUString,OUString>("com.sun.star.awt.XNumericField","setStrictFormat"))
     343           6 :             (pair<OUString,OUString>("com.sun.star.awt.XPaintListener","windowPaint"))
     344           6 :             (pair<OUString,OUString>("com.sun.star.awt.XPatternField","setMasks"))
     345           6 :             (pair<OUString,OUString>("com.sun.star.awt.XPatternField","setString"))
     346           6 :             (pair<OUString,OUString>("com.sun.star.awt.XPatternField","setStrictFormat"))
     347           6 :             (pair<OUString,OUString>("com.sun.star.awt.XPointer","setType"))
     348           6 :             (pair<OUString,OUString>("com.sun.star.awt.XPopupMenu","insertSeparator"))
     349           6 :             (pair<OUString,OUString>("com.sun.star.awt.XPopupMenu","setDefaultItem"))
     350           6 :             (pair<OUString,OUString>("com.sun.star.awt.XPopupMenu","checkItem"))
     351           6 :             (pair<OUString,OUString>("com.sun.star.awt.XProgressBar","setForegroundColor"))
     352           6 :             (pair<OUString,OUString>("com.sun.star.awt.XProgressBar","setBackgroundColor"))
     353           6 :             (pair<OUString,OUString>("com.sun.star.awt.XProgressBar","setRange"))
     354           6 :             (pair<OUString,OUString>("com.sun.star.awt.XProgressBar","setValue"))
     355           6 :             (pair<OUString,OUString>("com.sun.star.awt.XProgressMonitor","addText"))
     356           6 :             (pair<OUString,OUString>("com.sun.star.awt.XProgressMonitor","removeText"))
     357           6 :             (pair<OUString,OUString>("com.sun.star.awt.XProgressMonitor","updateText"))
     358           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRadioButton","addItemListener"))
     359           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRadioButton","removeItemListener"))
     360           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRadioButton","setState"))
     361           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRadioButton","setLabel"))
     362           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRegion","clear"))
     363           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRegion","move"))
     364           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRegion","unionRectangle"))
     365           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRegion","intersectRectangle"))
     366           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRegion","excludeRectangle"))
     367           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRegion","xOrRectangle"))
     368           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRegion","unionRegion"))
     369           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRegion","intersectRegion"))
     370           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRegion","excludeRegion"))
     371           6 :             (pair<OUString,OUString>("com.sun.star.awt.XRegion","xOrRegion"))
     372           6 :             (pair<OUString,OUString>("com.sun.star.awt.XScrollBar","addAdjustmentListener"))
     373           6 :             (pair<OUString,OUString>("com.sun.star.awt.XScrollBar","removeAdjustmentListener"))
     374           6 :             (pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setValue"))
     375           6 :             (pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setValues"))
     376           6 :             (pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setMaximum"))
     377           6 :             (pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setLineIncrement"))
     378           6 :             (pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setBlockIncrement"))
     379           6 :             (pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setVisibleSize"))
     380           6 :             (pair<OUString,OUString>("com.sun.star.awt.XScrollBar","setOrientation"))
     381           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinField","addSpinListener"))
     382           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinField","removeSpinListener"))
     383           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinField","up"))
     384           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinField","down"))
     385           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinField","first"))
     386           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinField","last"))
     387           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinField","enableRepeat"))
     388           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinListener","up"))
     389           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinListener","down"))
     390           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinListener","first"))
     391           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinListener","last"))
     392           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinValue","addAdjustmentListener"))
     393           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinValue","removeAdjustmentListener"))
     394           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinValue","setValue"))
     395           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinValue","setValues"))
     396           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinValue","setMinimum"))
     397           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinValue","setMaximum"))
     398           6 :             (pair<OUString,OUString>("com.sun.star.awt.XSpinValue","setSpinIncrement"))
     399           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTabController","setModel"))
     400           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTabController","setContainer"))
     401           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTabController","autoTabOrder"))
     402           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTabController","activateTabOrder"))
     403           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTabController","activateFirst"))
     404           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTabController","activateLast"))
     405           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTabControllerModel","setGroupControl"))
     406           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTabControllerModel","setControlModels"))
     407           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTabControllerModel","setGroup"))
     408           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTextComponent","addTextListener"))
     409           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTextComponent","removeTextListener"))
     410           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTextComponent","setText"))
     411           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTextComponent","insertText"))
     412           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTextComponent","setSelection"))
     413           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTextComponent","setEditable"))
     414           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTextComponent","setMaxTextLen"))
     415           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTextEditField","setEchoChar"))
     416           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTextListener","textChanged"))
     417           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTimeField","setTime"))
     418           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTimeField","setMin"))
     419           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTimeField","setMax"))
     420           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTimeField","setFirst"))
     421           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTimeField","setLast"))
     422           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTimeField","setStrictFormat"))
     423           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindow","addTopWindowListener"))
     424           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindow","removeTopWindowListener"))
     425           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindow","toFront"))
     426           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindow","toBack"))
     427           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindow","setMenuBar"))
     428           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowOpened"))
     429           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowClosing"))
     430           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowClosed"))
     431           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowMinimized"))
     432           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowNormalized"))
     433           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowActivated"))
     434           6 :             (pair<OUString,OUString>("com.sun.star.awt.XTopWindowListener","windowDeactivated"))
     435           6 :             (pair<OUString,OUString>("com.sun.star.awt.XUnoControlContainer","setTabControllers"))
     436           6 :             (pair<OUString,OUString>("com.sun.star.awt.XUnoControlContainer","addTabController"))
     437           6 :             (pair<OUString,OUString>("com.sun.star.awt.XUnoControlContainer","removeTabController"))
     438           6 :             (pair<OUString,OUString>("com.sun.star.awt.XUserInputInterception","addKeyHandler"))
     439           6 :             (pair<OUString,OUString>("com.sun.star.awt.XUserInputInterception","removeKeyHandler"))
     440           6 :             (pair<OUString,OUString>("com.sun.star.awt.XUserInputInterception","addMouseClickHandler"))
     441           6 :             (pair<OUString,OUString>("com.sun.star.awt.XUserInputInterception","removeMouseClickHandler"))
     442           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclContainer","addVclContainerListener"))
     443           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclContainer","removeVclContainerListener"))
     444           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclContainerListener","windowAdded"))
     445           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclContainerListener","windowRemoved"))
     446           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclContainerPeer","enableDialogControl"))
     447           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclContainerPeer","setTabOrder"))
     448           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclContainerPeer","setGroup"))
     449           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclWindowPeer","setDesignMode"))
     450           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclWindowPeer","enableClipSiblings"))
     451           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclWindowPeer","setForeground"))
     452           6 :             (pair<OUString,OUString>("com.sun.star.awt.XVclWindowPeer","setControlFont"))
     453           6 :             (pair<OUString,OUString>("com.sun.star.awt.XView","draw"))
     454           6 :             (pair<OUString,OUString>("com.sun.star.awt.XView","setZoom"))
     455           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","setPosSize"))
     456           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","setVisible"))
     457           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","setEnable"))
     458           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","setFocus"))
     459           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","addWindowListener"))
     460           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","removeWindowListener"))
     461           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","addFocusListener"))
     462           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","removeFocusListener"))
     463           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","addKeyListener"))
     464           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","removeKeyListener"))
     465           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","addMouseListener"))
     466           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","removeMouseListener"))
     467           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","addMouseMotionListener"))
     468           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","removeMouseMotionListener"))
     469           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","addPaintListener"))
     470           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindow","removePaintListener"))
     471           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindowListener","windowResized"))
     472           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindowListener","windowMoved"))
     473           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindowListener","windowShown"))
     474           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindowListener","windowHidden"))
     475           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindowListener2","windowEnabled"))
     476           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindowListener2","windowDisabled"))
     477           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindowPeer","setPointer"))
     478           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindowPeer","setBackground"))
     479           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindowPeer","invalidate"))
     480           6 :             (pair<OUString,OUString>("com.sun.star.awt.XWindowPeer","invalidateRect"))
     481           6 :             (pair<OUString,OUString>("com.sun.star.awt.grid.XGridSelectionListener","selectionChanged"))
     482           6 :             (pair<OUString,OUString>("com.sun.star.awt.tab.XTabPageContainer","addTabPageContainerListener"))
     483           6 :             (pair<OUString,OUString>("com.sun.star.awt.tab.XTabPageContainer","removeTabPageContainerListener"))
     484           6 :             (pair<OUString,OUString>("com.sun.star.awt.tab.XTabPageContainerListener","tabPageActivated"))
     485           6 :             (pair<OUString,OUString>("com.sun.star.configuration.backend.XBackendChangesNotifier","addChangesListener"))
     486           6 :             (pair<OUString,OUString>("com.sun.star.configuration.backend.XBackendChangesNotifier","removeChangesListener"))
     487           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.clipboard.XClipboard","setContents"))
     488           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.clipboard.XClipboardListener","changedContents"))
     489           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.clipboard.XClipboardNotifier","addClipboardListener"))
     490           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.clipboard.XClipboardNotifier","removeClipboardListener"))
     491           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.clipboard.XClipboardOwner","lostOwnership"))
     492           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XAutoscroll","autoscroll"))
     493           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragGestureListener","dragGestureRecognized"))
     494           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragGestureRecognizer","addDragGestureListener"))
     495           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragGestureRecognizer","removeDragGestureListener"))
     496           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSource","startDrag"))
     497           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceContext","setCursor"))
     498           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceContext","setImage"))
     499           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceContext","transferablesFlavorsChanged"))
     500           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceListener","dragDropEnd"))
     501           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceListener","dragEnter"))
     502           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceListener","dragExit"))
     503           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceListener","dragOver"))
     504           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDragSourceListener","dropActionChanged"))
     505           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTarget","addDropTargetListener"))
     506           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTarget","removeDropTargetListener"))
     507           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTarget","setDefaultActions"))
     508           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetDragContext","acceptDrag"))
     509           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetDragContext","rejectDrag"))
     510           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetDropContext","acceptDrop"))
     511           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetDropContext","rejectDrop"))
     512           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetDropContext","dropComplete"))
     513           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetListener","dragEnter"))
     514           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetListener","dragExit"))
     515           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetListener","dragOver"))
     516           6 :             (pair<OUString,OUString>("com.sun.star.datatransfer.dnd.XDropTargetListener","dropActionChanged"))
     517           6 :             (pair<OUString,OUString>("com.sun.star.document.XEventBroadcaster","addEventListener"))
     518           6 :             (pair<OUString,OUString>("com.sun.star.document.XEventBroadcaster","removeEventListener"))
     519           6 :             (pair<OUString,OUString>("com.sun.star.document.XEventListener","notifyEvent"))
     520           6 :             (pair<OUString,OUString>("com.sun.star.document.XStorageChangeListener","notifyStorageChange"))
     521           6 :             (pair<OUString,OUString>("com.sun.star.drawing.XControlShape","setControl"))
     522           6 :             (pair<OUString,OUString>("com.sun.star.form.XApproveActionBroadcaster","addApproveActionListener"))
     523           6 :             (pair<OUString,OUString>("com.sun.star.form.XApproveActionBroadcaster","removeApproveActionListener"))
     524           6 :             (pair<OUString,OUString>("com.sun.star.form.XBoundControl","setLock"))
     525           6 :             (pair<OUString,OUString>("com.sun.star.form.XChangeBroadcaster","addChangeListener"))
     526           6 :             (pair<OUString,OUString>("com.sun.star.form.XChangeBroadcaster","removeChangeListener"))
     527           6 :             (pair<OUString,OUString>("com.sun.star.form.XChangeListener","changed"))
     528           6 :             (pair<OUString,OUString>("com.sun.star.form.XConfirmDeleteBroadcaster","addConfirmDeleteListener"))
     529           6 :             (pair<OUString,OUString>("com.sun.star.form.XConfirmDeleteBroadcaster","removeConfirmDeleteListener"))
     530           6 :             (pair<OUString,OUString>("com.sun.star.form.XDatabaseParameterBroadcaster","addParameterListener"))
     531           6 :             (pair<OUString,OUString>("com.sun.star.form.XDatabaseParameterBroadcaster","removeParameterListener"))
     532           6 :             (pair<OUString,OUString>("com.sun.star.form.XDatabaseParameterBroadcaster2","addDatabaseParameterListener"))
     533           6 :             (pair<OUString,OUString>("com.sun.star.form.XDatabaseParameterBroadcaster2","removeDatabaseParameterListener"))
     534           6 :             (pair<OUString,OUString>("com.sun.star.form.XErrorBroadcaster","addErrorListener"))
     535           6 :             (pair<OUString,OUString>("com.sun.star.form.XErrorBroadcaster","removeErrorListener"))
     536           6 :             (pair<OUString,OUString>("com.sun.star.form.XFormController","addActivateListener"))
     537           6 :             (pair<OUString,OUString>("com.sun.star.form.XFormController","removeActivateListener"))
     538           6 :             (pair<OUString,OUString>("com.sun.star.form.XFormControllerListener","formActivated"))
     539           6 :             (pair<OUString,OUString>("com.sun.star.form.XFormControllerListener","formDeactivated"))
     540           6 :             (pair<OUString,OUString>("com.sun.star.form.XGrid","setCurrentColumnPosition"))
     541           6 :             (pair<OUString,OUString>("com.sun.star.form.XGridPeer","setColumns"))
     542           6 :             (pair<OUString,OUString>("com.sun.star.form.XLoadListener","loaded"))
     543           6 :             (pair<OUString,OUString>("com.sun.star.form.XLoadListener","unloading"))
     544           6 :             (pair<OUString,OUString>("com.sun.star.form.XLoadListener","unloaded"))
     545           6 :             (pair<OUString,OUString>("com.sun.star.form.XLoadListener","reloading"))
     546           6 :             (pair<OUString,OUString>("com.sun.star.form.XLoadListener","reloaded"))
     547           6 :             (pair<OUString,OUString>("com.sun.star.form.XLoadable","load"))
     548           6 :             (pair<OUString,OUString>("com.sun.star.form.XLoadable","unload"))
     549           6 :             (pair<OUString,OUString>("com.sun.star.form.XLoadable","reload"))
     550           6 :             (pair<OUString,OUString>("com.sun.star.form.XLoadable","addLoadListener"))
     551           6 :             (pair<OUString,OUString>("com.sun.star.form.XLoadable","removeLoadListener"))
     552           6 :             (pair<OUString,OUString>("com.sun.star.form.XPositioningListener","positioned"))
     553           6 :             (pair<OUString,OUString>("com.sun.star.form.XReset","reset"))
     554           6 :             (pair<OUString,OUString>("com.sun.star.form.XReset","addResetListener"))
     555           6 :             (pair<OUString,OUString>("com.sun.star.form.XReset","removeResetListener"))
     556           6 :             (pair<OUString,OUString>("com.sun.star.form.XResetListener","resetted"))
     557           6 :             (pair<OUString,OUString>("com.sun.star.form.XSubmit","submit"))
     558           6 :             (pair<OUString,OUString>("com.sun.star.form.XSubmit","addSubmitListener"))
     559           6 :             (pair<OUString,OUString>("com.sun.star.form.XSubmit","removeSubmitListener"))
     560           6 :             (pair<OUString,OUString>("com.sun.star.form.XUpdateBroadcaster","addUpdateListener"))
     561           6 :             (pair<OUString,OUString>("com.sun.star.form.XUpdateBroadcaster","removeUpdateListener"))
     562           6 :             (pair<OUString,OUString>("com.sun.star.frame.XBrowseHistoryRegistry","updateViewData"))
     563           6 :             (pair<OUString,OUString>("com.sun.star.frame.XBrowseHistoryRegistry","createNewEntry"))
     564           6 :             (pair<OUString,OUString>("com.sun.star.frame.XConfigManager","addPropertyChangeListener"))
     565           6 :             (pair<OUString,OUString>("com.sun.star.frame.XConfigManager","removePropertyChangeListener"))
     566           6 :             (pair<OUString,OUString>("com.sun.star.frame.XConfigManager","flush"))
     567           6 :             (pair<OUString,OUString>("com.sun.star.frame.XDesktop","addTerminateListener"))
     568           6 :             (pair<OUString,OUString>("com.sun.star.frame.XDesktop","removeTerminateListener"))
     569           6 :             (pair<OUString,OUString>("com.sun.star.frame.XDispatch","dispatch"))
     570           6 :             (pair<OUString,OUString>("com.sun.star.frame.XDispatch","addStatusListener"))
     571           6 :             (pair<OUString,OUString>("com.sun.star.frame.XDispatch","removeStatusListener"))
     572           6 :             (pair<OUString,OUString>("com.sun.star.frame.XDocumentTemplates","update"))
     573           6 :             (pair<OUString,OUString>("com.sun.star.frame.XFrame","setCreator"))
     574           6 :             (pair<OUString,OUString>("com.sun.star.frame.XFrame","setName"))
     575           6 :             (pair<OUString,OUString>("com.sun.star.frame.XFrame","activate"))
     576           6 :             (pair<OUString,OUString>("com.sun.star.frame.XFrame","deactivate"))
     577           6 :             (pair<OUString,OUString>("com.sun.star.frame.XFrame","addFrameActionListener"))
     578           6 :             (pair<OUString,OUString>("com.sun.star.frame.XFrame","removeFrameActionListener"))
     579           6 :             (pair<OUString,OUString>("com.sun.star.frame.XFrameActionListener","frameAction"))
     580           6 :             (pair<OUString,OUString>("com.sun.star.frame.XFrameLoader","load"))
     581           6 :             (pair<OUString,OUString>("com.sun.star.frame.XFrameLoader","cancel"))
     582           6 :             (pair<OUString,OUString>("com.sun.star.frame.XLoadEventListener","loadFinished"))
     583           6 :             (pair<OUString,OUString>("com.sun.star.frame.XLoadEventListener","loadCancelled"))
     584           6 :             (pair<OUString,OUString>("com.sun.star.frame.XModel","connectController"))
     585           6 :             (pair<OUString,OUString>("com.sun.star.frame.XModel","disconnectController"))
     586           6 :             (pair<OUString,OUString>("com.sun.star.frame.XModel","lockControllers"))
     587           6 :             (pair<OUString,OUString>("com.sun.star.frame.XModel","unlockControllers"))
     588           6 :             (pair<OUString,OUString>("com.sun.star.frame.XNotifyingDispatch","dispatchWithNotification"))
     589           6 :             (pair<OUString,OUString>("com.sun.star.frame.XRecordableDispatch","dispatchAndRecord"))
     590           6 :             (pair<OUString,OUString>("com.sun.star.frame.XSessionManagerClient","addSessionManagerListener"))
     591           6 :             (pair<OUString,OUString>("com.sun.star.frame.XSessionManagerClient","removeSessionManagerListener"))
     592           6 :             (pair<OUString,OUString>("com.sun.star.frame.XSessionManagerClient","queryInteraction"))
     593           6 :             (pair<OUString,OUString>("com.sun.star.frame.XSessionManagerClient","interactionDone"))
     594           6 :             (pair<OUString,OUString>("com.sun.star.frame.XSessionManagerClient","saveDone"))
     595           6 :             (pair<OUString,OUString>("com.sun.star.frame.XSessionManagerListener","doSave"))
     596           6 :             (pair<OUString,OUString>("com.sun.star.frame.XSessionManagerListener","approveInteraction"))
     597           6 :             (pair<OUString,OUString>("com.sun.star.frame.XSessionManagerListener","shutdownCanceled"))
     598           6 :             (pair<OUString,OUString>("com.sun.star.frame.XSessionManagerListener2","doQuit"))
     599           6 :             (pair<OUString,OUString>("com.sun.star.frame.XStatusListener","statusChanged"))
     600           6 :             (pair<OUString,OUString>("com.sun.star.frame.XTask","tileWindows"))
     601           6 :             (pair<OUString,OUString>("com.sun.star.frame.XTask","arrangeWindowsVertical"))
     602           6 :             (pair<OUString,OUString>("com.sun.star.frame.XTask","arrangeWindowsHorizontal"))
     603           6 :             (pair<OUString,OUString>("com.sun.star.frame.XWindowArranger","arrange"))
     604           6 :             (pair<OUString,OUString>("com.sun.star.inspection.XPropertyControlContext","activateNextControl"))
     605           6 :             (pair<OUString,OUString>("com.sun.star.inspection.XPropertyControlObserver","focusGained"))
     606           6 :             (pair<OUString,OUString>("com.sun.star.inspection.XPropertyControlObserver","valueChanged"))
     607           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XCloseSessionListener","sessionClosed"))
     608           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XMenuProxy","addMenuProxyListener"))
     609           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XMenuProxy","removeMenuProxyListener"))
     610           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","start"))
     611           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","stop"))
     612           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","destroy"))
     613           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","createWindow"))
     614           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","newStream"))
     615           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstance","newURL"))
     616           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstanceNotifySink","notifyURL"))
     617           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstancePeer","showStatusMessage"))
     618           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstancePeer","enableScripting"))
     619           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstancePeer","newStream"))
     620           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstancePeer","getURL"))
     621           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginInstancePeer","postURL"))
     622           6 :             (pair<OUString,OUString>("com.sun.star.mozilla.XPluginWindowPeer","setChildWindow"))
     623           6 :             (pair<OUString,OUString>("com.sun.star.script.vba.XVBACompatibility","addVBAScriptListener"))
     624           6 :             (pair<OUString,OUString>("com.sun.star.script.vba.XVBACompatibility","removeVBAScriptListener"))
     625           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XDatabaseAccess","addDatabaseAccessListener"))
     626           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XDatabaseAccess","removeDatabaseAccessListener"))
     627           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XDatabaseAccessListener","connectionChanged"))
     628           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XDatabaseAccessListener","connectionClosing"))
     629           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XRowSetApproveBroadcaster","addRowSetApproveListener"))
     630           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XRowSetApproveBroadcaster","removeRowSetApproveListener"))
     631           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XRowSetChangeListener","onRowSetChanged"))
     632           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XRowSetSupplier","setRowSet"))
     633           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XRowsChangeListener","rowsChanged"))
     634           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XSQLErrorBroadcaster","addSQLErrorListener"))
     635           6 :             (pair<OUString,OUString>("com.sun.star.sdb.XSQLErrorBroadcaster","removeSQLErrorListener"))
     636           6 :             (pair<OUString,OUString>("com.sun.star.sdbc.XRowSet","addRowSetListener"))
     637           6 :             (pair<OUString,OUString>("com.sun.star.sdbc.XRowSet","removeRowSetListener"))
     638           6 :             (pair<OUString,OUString>("com.sun.star.sdbc.XRowSetListener","cursorMoved"))
     639           6 :             (pair<OUString,OUString>("com.sun.star.sdbc.XRowSetListener","rowChanged"))
     640           6 :             (pair<OUString,OUString>("com.sun.star.sdbc.XRowSetListener","rowSetChanged"))
     641           6 :             (pair<OUString,OUString>("com.sun.star.sheet.XCalculatable","enableAutomaticCalculation"))
     642           6 :             (pair<OUString,OUString>("com.sun.star.sheet.XVolatileResult","addResultListener"))
     643           6 :             (pair<OUString,OUString>("com.sun.star.sheet.XVolatileResult","removeResultListener"))
     644           6 :             (pair<OUString,OUString>("com.sun.star.task.XJobExecutor","trigger"))
     645           6 :             (pair<OUString,OUString>("com.sun.star.task.XStatusIndicator","start"))
     646           6 :             (pair<OUString,OUString>("com.sun.star.task.XStatusIndicator","end"))
     647           6 :             (pair<OUString,OUString>("com.sun.star.task.XStatusIndicator","setText"))
     648           6 :             (pair<OUString,OUString>("com.sun.star.task.XStatusIndicator","setValue"))
     649           6 :             (pair<OUString,OUString>("com.sun.star.task.XStatusIndicator","reset"))
     650           6 :             (pair<OUString,OUString>("com.sun.star.text.XSimpleText","insertString"))
     651           6 :             (pair<OUString,OUString>("com.sun.star.text.XTextCursor","collapseToStart"))
     652           6 :             (pair<OUString,OUString>("com.sun.star.text.XTextCursor","collapseToEnd"))
     653           6 :             (pair<OUString,OUString>("com.sun.star.text.XTextRange","setString"))
     654           6 :             (pair<OUString,OUString>("com.sun.star.text.XTextViewCursor","setVisible"))
     655           6 :             (pair<OUString,OUString>("com.sun.star.ucb.XCommandProcessor","abort"))
     656           6 :             (pair<OUString,OUString>("com.sun.star.ucb.XCommandProcessor2","releaseCommandIdentifier"))
     657           6 :             (pair<OUString,OUString>("com.sun.star.ucb.XContent","addContentEventListener"))
     658           6 :             (pair<OUString,OUString>("com.sun.star.ucb.XContent","removeContentEventListener"))
     659           6 :             (pair<OUString,OUString>("com.sun.star.ucb.XContentProviderManager","deregisterContentProvider"))
     660           6 :             (pair<OUString,OUString>("com.sun.star.ucb.XContentTransmitter","transmit"))
     661           6 :             (pair<OUString,OUString>("com.sun.star.ucb.XPropertySetRegistry","removePropertySet"))
     662           6 :             (pair<OUString,OUString>("com.sun.star.ui.XUIConfigurationListener","elementInserted"))
     663           6 :             (pair<OUString,OUString>("com.sun.star.ui.XUIConfigurationListener","elementRemoved"))
     664           6 :             (pair<OUString,OUString>("com.sun.star.ui.XUIConfigurationListener","elementReplaced"))
     665           6 :             (pair<OUString,OUString>("com.sun.star.ui.dialogs.XFilePickerNotifier","addFilePickerListener"))
     666           6 :             (pair<OUString,OUString>("com.sun.star.ui.dialogs.XFilePickerNotifier","removeFilePickerListener"))
     667           6 :             (pair<OUString,OUString>("com.sun.star.util.XBroadcaster","lockBroadcasts"))
     668           6 :             (pair<OUString,OUString>("com.sun.star.util.XBroadcaster","unlockBroadcasts"))
     669           6 :             (pair<OUString,OUString>("com.sun.star.util.XChangesListener","changesOccurred"))
     670           6 :             (pair<OUString,OUString>("com.sun.star.util.XChangesNotifier","addChangesListener"))
     671           6 :             (pair<OUString,OUString>("com.sun.star.util.XChangesNotifier","removeChangesListener"))
     672           6 :             (pair<OUString,OUString>("com.sun.star.util.XCloseBroadcaster","addCloseListener"))
     673           6 :             (pair<OUString,OUString>("com.sun.star.util.XCloseBroadcaster","removeCloseListener"))
     674           6 :             (pair<OUString,OUString>("com.sun.star.util.XFlushable","addFlushListener"))
     675           6 :             (pair<OUString,OUString>("com.sun.star.util.XFlushable","removeFlushListener"))
     676           6 :             (pair<OUString,OUString>("com.sun.star.util.XModeChangeListener","modeChanged"))
     677           6 :             (pair<OUString,OUString>("com.sun.star.util.XModifyBroadcaster","addModifyListener"))
     678           6 :             (pair<OUString,OUString>("com.sun.star.util.XModifyBroadcaster","removeModifyListener"))
     679           6 :             (pair<OUString,OUString>("com.sun.star.util.XRefreshable","addRefreshListener"))
     680           6 :             (pair<OUString,OUString>("com.sun.star.util.XRefreshable","removeRefreshListener"))
     681           6 :             (pair<OUString,OUString>("com.sun.star.util.XSearchDescriptor","setSearchString"))
     682           6 :             (pair<OUString,OUString>("com.sun.star.view.XPrintJobBroadcaster","addPrintJobListener"))
     683           6 :             (pair<OUString,OUString>("com.sun.star.view.XPrintJobBroadcaster","removePrintJobListener"))
     684           6 :             (pair<OUString,OUString>("com.sun.star.view.XPrintJobListener","printJobEvent"))
     685           6 :             (pair<OUString,OUString>("com.sun.star.view.XPrintableBroadcaster","addPrintableListener"))
     686           6 :             (pair<OUString,OUString>("com.sun.star.view.XPrintableBroadcaster","removePrintableListener"))
     687           6 :             (pair<OUString,OUString>("com.sun.star.view.XPrintableListener","stateChanged"))
     688           6 :             (pair<OUString,OUString>("com.sun.star.view.XSelectionChangeListener","selectionChanged"))
     689           6 :             (pair<OUString,OUString>("com.sun.star.beans.XMultiPropertySet","addPropertiesChangeListener"))
     690           6 :             (pair<OUString,OUString>("com.sun.star.beans.XMultiPropertySet","removePropertiesChangeListener"))
     691           6 :             (pair<OUString,OUString>("com.sun.star.beans.XMultiPropertySet","firePropertiesChangeEvent"))
     692           6 :             (pair<OUString,OUString>("com.sun.star.beans.XPropertiesChangeNotifier","addPropertiesChangeListener"))
     693           6 :             (pair<OUString,OUString>("com.sun.star.beans.XPropertiesChangeNotifier","removePropertiesChangeListener"))
     694           6 :             (pair<OUString,OUString>("com.sun.star.container.XContainer","addContainerListener"))
     695           6 :             (pair<OUString,OUString>("com.sun.star.container.XContainer","removeContainerListener"))
     696           6 :             (pair<OUString,OUString>("com.sun.star.container.XContainerListener","elementInserted"))
     697           6 :             (pair<OUString,OUString>("com.sun.star.container.XContainerListener","elementRemoved"))
     698           6 :             (pair<OUString,OUString>("com.sun.star.container.XContainerListener","elementReplaced"))
     699           6 :             (pair<OUString,OUString>("com.sun.star.container.XNamed","setName"))
     700           6 :             (pair<OUString,OUString>("com.sun.star.io.XDataExporter","exportData"))
     701           6 :             (pair<OUString,OUString>("com.sun.star.io.XDataExporter","cancel"))
     702           6 :             (pair<OUString,OUString>("com.sun.star.io.XDataImporter","importData"))
     703           6 :             (pair<OUString,OUString>("com.sun.star.io.XDataImporter","cancel"))
     704           6 :             (pair<OUString,OUString>("com.sun.star.io.XDataTransferEventListener","finished"))
     705           6 :             (pair<OUString,OUString>("com.sun.star.io.XDataTransferEventListener","cancelled"))
     706           6 :             (pair<OUString,OUString>("com.sun.star.lang.XConnectionPointContainer","advise"))
     707           6 :             (pair<OUString,OUString>("com.sun.star.lang.XConnectionPointContainer","unadvise"))
     708           6 :             (pair<OUString,OUString>("com.sun.star.script.XAllListener","firing"))
     709           6 :             (pair<OUString,OUString>("com.sun.star.uno.XInterface","acquire"))
     710           6 :             (pair<OUString,OUString>("com.sun.star.uno.XInterface","release"))
     711           6 :             (pair<OUString,OUString>("com.sun.star.uno.XReference","dispose"));
     712             : 
     713           2 :         pair<OUString,OUString> k(_rListenerType, _rMethodName);
     714           2 :         return delayed_event_listeners.find(k) != delayed_event_listeners.end();
     715             :     }
     716             : 
     717             : 
     718           2 :     void FormScriptListener::impl_doFireScriptEvent_nothrow( ::osl::ClearableMutexGuard& _rGuard, const ScriptEvent& _rEvent, Any* _pSyncronousResult )
     719             :     {
     720             :         OSL_PRECOND( m_pScriptExecutor, "FormScriptListener::impl_doFireScriptEvent_nothrow: this will crash!" );
     721             : 
     722           2 :         _rGuard.clear();
     723           2 :         m_pScriptExecutor->doFireScriptEvent( _rEvent, _pSyncronousResult );
     724           2 :     }
     725             : 
     726             : 
     727           2 :     void SAL_CALL FormScriptListener::firing( const ScriptEvent& _rEvent ) throw (RuntimeException, std::exception)
     728             :     {
     729           2 :         ::osl::ClearableMutexGuard aGuard( m_aMutex );
     730           2 :        static const OUString vbaInterOp("VBAInterop");
     731           2 :        if ( _rEvent.ScriptType.equals(vbaInterOp) )
     732           0 :            return; // not handled here
     733             : 
     734           2 :         if ( impl_isDisposed_nothrow() )
     735           0 :             return;
     736             : 
     737           2 :         if ( !impl_allowAsynchronousCall_nothrow( _rEvent.ListenerType.getTypeName(), _rEvent.MethodName ) )
     738             :         {
     739           0 :             impl_doFireScriptEvent_nothrow( aGuard, _rEvent, NULL );
     740           0 :             return;
     741             :         }
     742             : 
     743           2 :         acquire();
     744           2 :         Application::PostUserEvent( LINK( this, FormScriptListener, OnAsyncScriptEvent ), new ScriptEvent( _rEvent ) );
     745             :     }
     746             : 
     747             : 
     748           0 :     Any SAL_CALL FormScriptListener::approveFiring( const ScriptEvent& _rEvent ) throw (InvocationTargetException, RuntimeException, std::exception)
     749             :     {
     750           0 :         Any aResult;
     751             : 
     752           0 :         ::osl::ClearableMutexGuard aGuard( m_aMutex );
     753           0 :         if ( !impl_isDisposed_nothrow() )
     754           0 :             impl_doFireScriptEvent_nothrow( aGuard, _rEvent, &aResult );
     755             : 
     756           0 :         return aResult;
     757             :     }
     758             : 
     759             : 
     760           0 :     void SAL_CALL FormScriptListener::disposing( const EventObject& /*Source*/ ) throw (RuntimeException, std::exception)
     761             :     {
     762             :         // not interested in
     763           0 :     }
     764             : 
     765             : 
     766        6311 :     void SAL_CALL FormScriptListener::dispose()
     767             :     {
     768        6311 :         ::osl::MutexGuard aGuard( m_aMutex );
     769        6311 :         m_pScriptExecutor = NULL;
     770        6311 :     }
     771             : 
     772             : 
     773           4 :     IMPL_LINK( FormScriptListener, OnAsyncScriptEvent, ScriptEvent*, _pEvent )
     774             :     {
     775             :         OSL_PRECOND( _pEvent != NULL, "FormScriptListener::OnAsyncScriptEvent: invalid event!" );
     776           2 :         if ( !_pEvent )
     777           0 :             return 1L;
     778             : 
     779             :         {
     780           2 :             ::osl::ClearableMutexGuard aGuard( m_aMutex );
     781             : 
     782           2 :             if ( !impl_isDisposed_nothrow() )
     783           2 :                 impl_doFireScriptEvent_nothrow( aGuard, *_pEvent, NULL );
     784             :         }
     785             : 
     786           2 :         delete _pEvent;
     787             :         // we acquired ourself immediately before posting the event
     788           2 :         release();
     789           2 :         return 0L;
     790             :     }
     791             : 
     792        6320 :     FormScriptingEnvironment::FormScriptingEnvironment( FmFormModel& _rModel )
     793             :         :m_pScriptListener( NULL )
     794             :         ,m_rFormModel( _rModel )
     795        6320 :         ,m_bDisposed( false )
     796             :     {
     797        6320 :         m_pScriptListener = ListenerImplementation( new FormScriptListener( this ) );
     798             :         // note that this is a cyclic reference between the FormScriptListener and the FormScriptingEnvironment
     799             :         // This cycle is broken up when our instance is disposed.
     800        6320 :     }
     801             : 
     802             : 
     803       12622 :     FormScriptingEnvironment::~FormScriptingEnvironment()
     804             :     {
     805       12622 :     }
     806             : 
     807             : 
     808        1894 :     void FormScriptingEnvironment::impl_registerOrRevoke_throw( const Reference< XEventAttacherManager >& _rxManager, bool _bRegister )
     809             :     {
     810        1894 :         ::osl::MutexGuard aGuard( m_aMutex );
     811             : 
     812        1894 :         if ( !_rxManager.is() )
     813           0 :             throw IllegalArgumentException();
     814        1894 :         if ( m_bDisposed )
     815           0 :             throw DisposedException();
     816             : 
     817             :         try
     818             :         {
     819        1894 :             if ( _bRegister )
     820         948 :                 _rxManager->addScriptListener( m_pScriptListener.get() );
     821             :             else
     822         946 :                 _rxManager->removeScriptListener( m_pScriptListener.get() );
     823             :         }
     824           0 :         catch( const RuntimeException& ) { throw; }
     825           0 :         catch( const Exception& )
     826             :         {
     827             :             DBG_UNHANDLED_EXCEPTION();
     828        1894 :         }
     829        1894 :     }
     830             : 
     831             : 
     832         948 :     void FormScriptingEnvironment::registerEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager )
     833             :     {
     834         948 :         impl_registerOrRevoke_throw( _rxManager, true );
     835         948 :     }
     836             : 
     837             : 
     838         946 :     void FormScriptingEnvironment::revokeEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager )
     839             :     {
     840         946 :         impl_registerOrRevoke_throw( _rxManager, false );
     841         946 :     }
     842             : 
     843             : 
     844        6311 :     IFormScriptingEnvironment::~IFormScriptingEnvironment()
     845             :     {
     846        6311 :     }
     847             : 
     848             : 
     849             :     namespace
     850             :     {
     851             : 
     852             :         //. NewStyleUNOScript
     853             : 
     854           2 :         class SAL_NO_VTABLE IScript
     855             :         {
     856             :         public:
     857             :             virtual void invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult ) = 0;
     858             : 
     859           2 :             virtual ~IScript() { }
     860             :         };
     861             :         typedef ::boost::shared_ptr< IScript >  PScript;
     862             : 
     863           4 :         class NewStyleUNOScript : public IScript
     864             :         {
     865             :             SfxObjectShell&         m_rObjectShell;
     866             :             const OUString   m_sScriptCode;
     867             : 
     868             :         public:
     869           2 :             NewStyleUNOScript( SfxObjectShell& _rObjectShell, const OUString& _rScriptCode )
     870             :                 :m_rObjectShell( _rObjectShell )
     871           2 :                 ,m_sScriptCode( _rScriptCode )
     872             :             {
     873           2 :             }
     874             : 
     875             :             // IScript
     876             :             virtual void invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult ) SAL_OVERRIDE;
     877             :         };
     878             : 
     879             : 
     880           2 :         void NewStyleUNOScript::invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult )
     881             :         {
     882           2 :             Sequence< sal_Int16 > aOutArgsIndex;
     883           4 :             Sequence< Any > aOutArgs;
     884           4 :             EventObject aEvent;
     885           4 :             Any aCaller;
     886           2 :             if ( ( _rArguments.getLength() > 0 ) && ( _rArguments[ 0 ] >>= aEvent ) )
     887             :             {
     888             :                 try
     889             :                 {
     890           2 :                     Reference< XControl > xControl( aEvent.Source, UNO_QUERY_THROW );
     891           4 :                     Reference< XPropertySet > xProps( xControl->getModel(), UNO_QUERY_THROW );
     892           4 :                     aCaller = xProps->getPropertyValue("Name");
     893             :                 }
     894           0 :                 catch( Exception& ) {}
     895             :             }
     896           4 :             m_rObjectShell.CallXScript( m_sScriptCode, _rArguments, _rSynchronousResult, aOutArgsIndex, aOutArgs, true, aCaller.hasValue() ? &aCaller : 0 );
     897           2 :         }
     898             :     }
     899             : 
     900             : 
     901           2 :     void FormScriptingEnvironment::doFireScriptEvent( const ScriptEvent& _rEvent, Any* _pSyncronousResult )
     902             :     {
     903             : #if !HAVE_FEATURE_SCRIPTING
     904             :         (void) _rEvent;
     905             :         (void) _pSyncronousResult;
     906             :         (void) m_rFormModel;
     907             : #else
     908           2 :         SolarMutexClearableGuard aSolarGuard;
     909           4 :         ::osl::ClearableMutexGuard aGuard( m_aMutex );
     910             : 
     911           2 :         if ( m_bDisposed )
     912           0 :             return;
     913             : 
     914             :         // SfxObjectShellRef is good here since the model controls the lifetime of the object
     915           4 :         SfxObjectShellRef xObjectShell = m_rFormModel.GetObjectShell();
     916           2 :         if( !xObjectShell.Is() )
     917           0 :             return;
     918             : 
     919             :         // the script to execute
     920           4 :         PScript pScript;
     921             : 
     922           2 :         if ( _rEvent.ScriptType != "StarBasic" )
     923             :         {
     924           2 :             pScript.reset( new NewStyleUNOScript( *xObjectShell, _rEvent.ScriptCode ) );
     925             :         }
     926             :         else
     927             :         {
     928           0 :             OUString sScriptCode = _rEvent.ScriptCode;
     929           0 :             OUString sMacroLocation;
     930             : 
     931             :             // is there a location in the script name ("application" or "document")?
     932           0 :             sal_Int32 nPrefixLen = sScriptCode.indexOf( ':' );
     933             :             DBG_ASSERT( 0 <= nPrefixLen, "FormScriptingEnvironment::doFireScriptEvent: Basic script name in old format encountered!" );
     934             : 
     935           0 :             if ( 0 <= nPrefixLen )
     936             :             {
     937             :                 // and it has such a prefix
     938           0 :                 sMacroLocation = sScriptCode.copy( 0, nPrefixLen );
     939             :                 DBG_ASSERT( sMacroLocation.equalsAscii( "document" )
     940             :                         ||  sMacroLocation.equalsAscii( "application" ),
     941             :                         "FormScriptingEnvironment::doFireScriptEvent: invalid (unknown) prefix!" );
     942             : 
     943             :                 // strip the prefix: the SfxObjectShell::CallScript knows nothing about such prefixes
     944           0 :                 sScriptCode = sScriptCode.copy( nPrefixLen + 1 );
     945             :             }
     946             : 
     947           0 :             if ( sMacroLocation.isEmpty() )
     948             :             {
     949             :                 // legacy format: use the app-wide Basic, if it has a respective method, otherwise fall back to the doc's Basic
     950           0 :                 if ( SfxGetpApp()->GetBasicManager()->HasMacro( sScriptCode ) )
     951           0 :                     sMacroLocation = "application";
     952             :                 else
     953           0 :                     sMacroLocation = "document";
     954             :             }
     955             : 
     956           0 :             OUStringBuffer aScriptURI;
     957           0 :             aScriptURI.appendAscii( "vnd.sun.star.script:" );
     958           0 :             aScriptURI.append( sScriptCode );
     959           0 :             aScriptURI.appendAscii( "?language=Basic" );
     960           0 :             aScriptURI.appendAscii( "&location=" );
     961           0 :             aScriptURI.append( sMacroLocation );
     962             : 
     963           0 :             const OUString sScriptURI( aScriptURI.makeStringAndClear() );
     964           0 :             pScript.reset( new NewStyleUNOScript( *xObjectShell, sScriptURI ) );
     965             :         }
     966             : 
     967             :         OSL_ENSURE( pScript.get(), "FormScriptingEnvironment::doFireScriptEvent: no script to execute!" );
     968           2 :         if ( !pScript.get() )
     969             :             // this is an internal error in the above code
     970           0 :             throw RuntimeException();
     971             : 
     972           2 :         aGuard.clear();
     973           2 :         aSolarGuard.clear();
     974             : 
     975           4 :         Any aIgnoreResult;
     976           2 :         pScript->invoke( _rEvent.Arguments, _pSyncronousResult ? *_pSyncronousResult : aIgnoreResult );
     977           2 :         pScript.reset();
     978             : 
     979             :         {
     980             :             // object shells are not thread safe, so guard the destruction
     981           2 :             SolarMutexGuard aSolarGuarsReset;
     982           2 :             xObjectShell = NULL;
     983           2 :         }
     984             : #endif
     985             :     }
     986             : 
     987             : 
     988        6311 :     void FormScriptingEnvironment::dispose()
     989             :     {
     990        6311 :         ::osl::MutexGuard aGuard( m_aMutex );
     991        6311 :         m_bDisposed = true;
     992        6311 :         m_pScriptListener->dispose();
     993        6311 :     }
     994             : 
     995             : 
     996        6320 :     PFormScriptingEnvironment createDefaultFormScriptingEnvironment( FmFormModel& _rModel )
     997             :     {
     998        6320 :         return new FormScriptingEnvironment( _rModel );
     999             :     }
    1000             : 
    1001             : 
    1002         651 : } // namespace svxform
    1003             : 
    1004             : 
    1005             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10