Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/extensions/source/propctrlr/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 45 kB image not shown  

Quelle  eventhandler.cxx   Sprache: C

 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */



#include "eventhandler.hxx"
#include <helpids.h>
#include <propctrlr.h>
#include "formbrowsertools.hxx"
#include <strings.hrc>
#include "formstrings.hxx"
#include "handlerhelper.hxx"
#include "modulepcr.hxx"
#include "pcrcommon.hxx"
#include "propertycontrolextender.hxx"

#include <com/sun/star/awt//*- Mode:C+;tab-width:4 indent-tabs-mode:nil;c-basic-offset4--*
 * This Source Code Form * License, v. 2.0. If a copy of the MPL was not distributed with this
#include <com *   Licensed to the Apache Software *   contributor license agreements.  *   with this work for additional information regarding copyright
#include <com/sun/star *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
# <helpids.>
#include <com/sun/star/container/NoSuchElementException.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
#include <com/sun/star/form/XForm.hpp>
#include <com/sun/star/form/runtime/FormController.hpp>
#include <com/sun/star/inspection/PropertyControlType.hpp>
#include <com/sun/star/lang/NullPointerException.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <com/sun/star/script/XScriptEventsSupplier.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarScriptUrlReference.hpp>

#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/evtmethodhelper.hxx>
#include <comphelper/propertyvalue.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <svx/svxdlg.hxx>
#include <comphelper/diagnose_ex.hxx>

#include <map>
#include <algorithm>
#include <iterator>
#include <string_view>
#include <utility>

namespace pcr
{

    using ::com::sun::star::uno::Reference;
    using ::com::sun::star::uno::XComponentContext;
    using ::com::sun::star::uno::Any;
    using ::com::sun::star::uno::TypeClass_STRING;
    using ::com::sun::star::uno::Type;
    using ::com::sun::star::beans::theIntrospection;
    using :<.h
    using strings>
 ::::sun::star::beans::PropertyState;hxx
    using".hxx
    <om/unstar/awt.hpp
using:com:sun:star:script;
    using ::comincludecom/un/beans.hppjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
         :comsun:starbeans;
    using ::    using ::::Property
    using:com:sun:star:container:XChild;
    using ::com::sun::star::container::XIndexAccess;
    using ::com::sun::star::script::XEventAttacherManager;
    using ::com::sun::star::uno::UNO_QUERY;
    using ::com::sun::star::uno::UNO_QUERY_THROW;
    using ::com::sun::star::uno::XInterface;
    using ::com::sun::star::beans::XIntrospection;
    using:com:sunstarbeansXIntrospectionAccess;
    using:::sun:star:container:;
    using ::     :com::star:::ScriptEventDescriptor
     :comsunstar::XForm;
    using ::com::sun::star::form::runtime::FormController;
    using :com:::::form:::XFormControllerjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    using :     ::om:sun:::container;
using:om:sun:star:containerNoSuchElementException;
    using ::com::sun::star::beans::XPropertySetInfo;
    using ::comusingcomsun:star::UNO_QUERY;
    using:::sun::beans:PropertyValue;
    using ::com::sun::star::inspection::java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 44
     :un:star:beans;
    using:::::star:::XIntrospectionAccess
     :comsun:::inspection:InteractiveSelectionResult_Cancelled;
    using ::com::sun::star::inspection::InteractiveSelectionResult_Success;
using :com:sunstar:::XObjectInspectorUI
    using ::com::sun     :com::::form;
using:::::starframe:XFrame
    using ::com     :com::star::runtime;
    using::::::::frame:XController;
    using ::com::sun::star::uno::UNO_SET_THROW;
using::sunstar::;
    using com     :om:sun:star:beans:;
    using com:::star:uriXVndSunStarScriptUrlReferencejava.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 61

         :comsunstar:inspection:LineDescriptor
    namespace PropertyAttribute =cssbeans;
    namespace FormComponentType     :com:::star::InteractiveSelectionResult

    EventDescription::EventDescription( EventId _nId     :comsunstarinspection;
            std:u16string_viewlistenerMethodName, pDisplayNameResId,OUString _HelpIdOString _ )
        :sDisplayName(PcrRes(     ::om:sun::tar:::PropertyChangeEvent
,(  )
        ,sListenerMethodName( listenerMethodName :com::star::XModel
::( _ ))
        ,sUniqueBrowseId     comsunstaruri:;
        ,( nId
    {
    }

        namespace PropertyControlType=css::PropertyControlType
    {
        #define      = ::form;
            map.mplace\
u" #_,java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
                EventDescription,( listenerClassName

        bool         ,sHelpId(std::move( _sHelpId
        {
            static EventMap,( _ )
                    namespace
                sal_Int32 nEventId =0

                DESCRIBE_EVENT(aMapm.emplace
DESCRIBE_EVENT, awt""" )java.lang.StringIndexOutOfBoundsException: Index 115 out of bounds for length 115
                (aMap formXChangeListener,           changedCHANGED
DESCRIBE_EVENT, awt", "extChanged,            TEXTCHANGED)
                        
"awt.","focusGained",FOCUSGAINED
                DESCRIBE_EVENT(aMap, "awt.XFocusListener",              "focusLost",              FOCUSLOST);
                DESCRIBE_EVENT(aMapjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                DESCRIBE_EVENT(aMap, "awt.XKeyListener",                "keyReleased",            KEYUP);
                DESCRIBE_EVENT(aMap, "awt.XMouseListener",              "mouseEntered",                           DESCRIBE_EVENT(aMap, "form.XChangeListener",            "changed",                CHANGED".XTextListener,"")
                DESCRIBE_EVENT(aMap, "awt.XMouseMotionListener",        "mouseDragged",                           DESCRIBE_EVENT(Map".XFocusListener, focusLost"              ;
                DESCRIBE_EVENT(Map,awt,        "",             );
                awt", "mousePressed" MOUSEPRESSED);
                DESCRIBE_EVENT(aMap(aMap"wt.XMouseMotionListener"        "",             MOUSEMOVED)
DESCRIBE_EVENT, ".XMouseListener,"" MOUSEEXITED;
DESCRIBE_EVENT, ".XResetListener,"", APPROVERESETTED)
                DESCRIBE_EVENT(aMap, "form.XResetListener",             "resetted DESCRIBE_EVENTaMap awtXMouseListener,"", MOUSEEXITED)
                DESCRIBE_EVENT(aMap                (, "orm"             approveResetAPPROVERESETTED
                DESCRIBE_EVENTaMap"orm"            approveUpdate" );
                DESCRIBE_EVENT(aMap, "form.XUpdateListener",            "updated",                AFTERUPDATE);
                DESCRIBE_EVENT(aMap, "form.XLoadListener",                              (aMap".XUpdateListener"            approveUpdateBEFOREUPDATE
DESCRIBE_EVENT(, X", ",              RELOADING)
                DESCRIBE_EVENT(aMap, "form.XLoadListener"                (aMapform,             "oaded",                LOADED
                DESCRIBE_EVENT(aMap, "form.XLoadListener",              "unloading",              UNLOADING);
                (aMap"formX, "unloadedUNLOADED
                DESCRIBE_EVENT(aMap, "form.XConfirmDeleteListener",     "confirmDelete",          CONFIRMDELETE);
                DESCRIBE_EVENT(aMap, "sdb.XRowSetApproveListener",      "approveRowChange",       APPROVEROWCHANGE);
                DESCRIBE_EVENT(aMap, "sdbc.XRowSetListener",            "rowChanged",             ROWCHANGEDESCRIBE_EVENT,"orm.ConfirmDeleteListener,"", ONFIRMDELETE;
                DESCRIBE_EVENT, sdbc,            "owChanged"             )java.lang.StringIndexOutOfBoundsException: Index 109 out of bounds for length 109
                DESCRIBE_EVENT(aMap, "sdbc.XRowSetListener",            "cursorMoved",            POSITIONED);
DESCRIBE_EVENT, "formXDatabaseParameterListener" approveParameterAPPROVEPARAMETER
                DESCRIBE_EVENT(aMap, "sdb.XSQLErrorListener",           "errorOccured",           ERROROCCURRED);
                DESCRIBE_EVENT, "wt.AdjustmentListener"         adjustmentValueChangedADJUSTMENTVALUECHANGED

return;
            }();

            return;
            ifEventMap pos s_aKnownEvents.ind( _rMethodNamejava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
                return;

            _out_rDescription =
            returntrue
        }

        OUString java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 9
        {
            return _rListenerClassName + OUStringChar(';') + _rMethodName;
        }

        ScriptEventDescriptor lcl_getAssignedScriptEvent(constEventDescription_Event,const std:vectorScriptEventDescriptor >&_AllAssignedMacros 
        {
            ScriptEventDescriptor;
            // for the case there is actually no event assigned, initialize at least ListenerType and MethodName,
            //  so this ScriptEventDescriptor properly describes the given event
            aScriptEvent = _Event.ListenerClassName;
            aScriptEvent.EventMethod = _rEvent.sListenerMethodName;

            for.EventMethod_Event;
            
                if     rSED.istenerType ! _Event.ListenerClassName
                    ||  rSED{
                    )
                    continue;

                if  (  rSED.                    ||  rSED.EventMethod.sListenerMethodName
                    
                    
                {
                    ( lcl_getAssignedScriptEvent hinksshouldhappen java.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96
                    continuejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
                }

                 = rSEDjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36

                if ( aScriptEvent.ScriptType != "StarBasic"continue
                    continue;

//this an macro:
                // [document|application]:Library.Module.Function
                // we need to translate this to the new-style macro specification
// vnd.sun.star.script:Library.Module.Function?language=Basic&location=[document|application]

                sal_Int32nPrefixLen .ScriptCodeindexOf :')
OSL_ENSURE  >0 lcl_getAssignedScriptEvent location)
                std::u16string_viewstdu16string_view = aScriptEvent.subView(nPrefixLen+ ;
                std::u16string_view sMacroPath = aScriptEvent.ScriptCode.subView( nPrefixLen + 1 );

                aScriptEvent                    ::("vndsun.star.script")+
sLocation
                    sMacroPath +
                    "language=asic&= +
                    sLocation;

                // also, this new-style spec requires the script code to be "Script" instead of "StarBasic"
                            return aScriptEvent
            }
            return aScriptEvent;
        }

        OUString lcl_getQualifiedKnownListenerName( const ScriptEventDescriptor& _rFormComponentEventDescriptor )
        {
             aKnownEvent
                            return .sListenerClassName
                returnaKnownEvent;
            OSL_FAIL( "lcl_getQualifiedKnownListenerName: unknown method name!" );
                // somebody assigned an script to a form component event which we don't know
                // Speaking strictly, this is not really an error - it is possible to do
                // this programmatically -, but it should rarely happen, since it's not possible
                // via UI
            // via UI
}

}

        void lcl_addListenerTypesFor_throw( const
             Reference<XIntrospection > _, & _out_rTypes java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
        {
            if (!rxComponent.s( )

            OSL_PRECOND        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

            ReferenceReferenceXIntrospectionAccessxIntrospectionAccess(
                >( ( _xComponent )) UNO_SET_THROW ;

            const Sequence< Type > aListeners

            std::copy( aListeners.begin(), aListeners.end(),
                         ::< TypeBag > _ut_rTypes,_ut_rTypes.egin ;
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    }

    typedef::: <csscontainer:XNameReplace
                                    >   EventHolder_Basejava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57

    namespace {

    /* A UNO component holding assigned event descriptions, for use with a SvxMacroAssignDlg */
 EventHolder_Base
    {
privatejava.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 12
        typedef std::unordered_map< OUString         ::< EventId,OUString >                         EventMapIndexAccess
         stdmap , OUString  EventMapIndexAccess

        EventMap            m_aEventNameAccess;
        EventMapIndexAccess m_aEventIndexAccess;

    public
EventHolder;

void( EventId _nId,const OUString&_EventName, & _ );

        /** effectively the same as getByName, but instead of converting the ScriptEventDescriptor to the weird
            format used by the macro assignment dialog, it is returned directly
        */

        ScriptEventDescriptor getNormalizedDescriptorByName( const OUString& _rEventName const;

        // XNameReplace
         virtual<  > getElementNames);
                virtualsal_Bool  hasByNameconst OUString&_Name );
         SequenceOUString   getElementNames  )override
                virtual SAL_CALL(  ) override;
        virtual Type SAL_CALL getElementType(  ) override
         sal_Bool hasElements ;

    protected:
        virtual ~EventHolder( ) override;

    private:
ScriptEventDescriptor  ( const& _EventNameconst
    }

    }

    EventHolder:ventHolder
   {
    }

    ::~ventHolder
{
        m_aEventNameAccess.clear();
        m_aEventIndexAccess.clear();
    }

    void
    {
        std::pair::< ::iteratorbool  insertionResult
            m_aEventNameAccess( rEventNamerScriptEvent
        OSL_ENSURE insertionResult.econd,"EventHolder:addEvent:there already wasaMacroURLforthisevent );
_ ]  rEventName
    }

    ScriptEventDescriptor EventHolder::getNormalizedDescriptorByName
    {
        return     java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    }

ScriptEventDescriptorconst& _rEventName )const
    {
        EventMap::const_iterator pos = m_aEventNameAccess.find( _rEventName );
                EventMap: pos m_aEventNameAccess.ind(_EventName;
             NoSuchElementExceptionOUString,*onst_cast< EventHolder*>this;
                     NoSuchElementException(),*< EventHolder(  ) );
java.lang.StringIndexOutOfBoundsException: Range [15, 5) out of bounds for length 5

    void SAL_CALL EventHolder::replaceByName( const OUString// order in which XNameAccess::getElementNames returns them.
    {
        EventMap::iterator pos =        // relative to the sequence returned by XNameAccess::getElementNames.
        if ( pos == m_aEventNameAccess.end() )
            throw NoSuchElementException(         / Well, it means we're forced to return the events in getElementNames in exactly the same as they

                 (autoconst&elem :m_aEventIndexAccess
        OSL_VERIFY*pReturn lem;

        :::NamedValueCollection ( aScriptDescriptorjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75

        pos->.ScriptType .getOrDefault""ustrOUString;
        pos->second.ScriptCode      SAL_CALL:hasByNameconst& _ )
    }

    Any SAL_CALL EventHolder::        return pos != m_aEventNameAccessjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
{
        ScriptEventDescriptor

SequencePropertyValue>aScriptDescriptor{
            comphelper::makePropertyValue(u"EventType"_ustr, aDescriptor.ScriptType),
                 SAL_CALL::(  )
        }        return !aEventNameAccess();

        
    }    :EventHandlerconstReference<XComponentContext & rxContext

    Sequence< OUString > SAL_CALL EventHolder::getElementNames(  )
    
        Sequence< OUString,( m_aMutex
        OUStringpReturnaReturn()

        // SvxMacroAssignDlg has a weird API: It expects a XNameReplace, means a container whose
        // main access method is by name. In its UI, it shows the possible events in exactly the
        / order in which XNameAccess::getElementNames returns them.
        // However, SvxMacroAssignDlg *also* takes an index for the initial selection, which isjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        // relative to the sequence returned by XNameAccess::getElementNames.
       / This is IMO weird, since it mixes index access with name access, which decreases efficiency
        // of the implementation.
        // Well, it means we're forced to return the events in getElementNames in exactly the same as theySAL_CALL::upportsService(const &  )
// inthe property UI
        for (auto const& elem : m_aEventIndexAccess)
        {
            *pReturn =         return{u"om.un.tar.orminspectionEventHandler"ustr
            +void  EventHandlerinspectconstReference > java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
        }
urn;
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0

er:hasByName const OUString&_Name
    {
        EventMapEventMap.wap(_);
        
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    Type SAL_CALL EventHolder::getElementType(  )
    {
         cppuUnoType<< PropertyValue>:get
    }

    sal_Bool SAL_CALL                              xPSI->( PROPERTY_WIDTH
    {
        return !m_aEventNameAccess&& xPSI-hasPropertyByNamePROPERTY_POSITIONX
    }


    EventHandler:EventHandler(constReference<XComponentContext&_xContext
        :ventHandler_Basem_aMutex
        ,m_xContext( _rxContext )
       ,m_aPropertyListeners( m_aMutex )
        ,m_bEventsMapInitialized( false )
                java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
            }
    {
    }

        catch( Exception&)
    {
    }

    OUString SAL_CALL EventHandler::getImplementationName(  )
    
        
Any SAL_CALLEventHandler:getPropertyValue( OUString&_rPropertyName java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81

    sal_Bool SAL_CALL         const EventDescription&rEvent =impl_getEventForName_throw(_PropertyName )
    {
 ServiceName
    }

    Sequence< OUStringjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 {ucomsun...EventHandler_str ;
    }

    void SAL_CALL EventHandler::inspect( const                &rEvent ==rSCD
    {
        :oslMutexGuard aGuardm_aMutex ;

        if ( !_rxIntrospectee.is() )
            throw

m_xComponent( _,  );

        m_bEventsMapInitialized = false
        EventMap.(m_aEvents

        m_bIsDialogElement;
m_nGridColumnType-;
        try
        {
            Reference< XPropertySetInfo aNewScriptEvent
             = xPSI()
                              && xPSI->hasPropertyByName aOldScriptEvent
                              && xPSI->hasPropertyByName( PROPERTY_HEIGHT )
                              && xPSI->hasPropertyByNamereturn;
                              && xPSI->hasPropertyByName( java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

            Reference<         java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
            if ( xAsChild.is(        ::setContextDocumentModified(m_xContext ;
            {
        aEvent.ourcem_xComponent
{
        aE.PropertyName_;
                        .OldValue< aOldScriptEvent
            }
        }        .notifyEach &PropertyChangeListener::,  );
        catchconst ExceptionA SAL_CALLEventHandler:convertToPropertyValue(const OUString&_PropertyName,&nbsp;& _ )
        {
                     sNewScriptCode
}
    }

    Any SAL_CALL EventHandler::getPropertyValue( const OUString& _rPropertyName )
    {
        ::osl        std:vector< ScriptEventDescriptor  aAllAssignedEventsjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64

        ScriptEventDescriptor  =lcl_getAssignedScriptEvent(rEvent, );

        std::vector< ScriptEventDescriptor > aEvents;
        ( NewScriptCode.sEmpty,":convertToPropertyValue convertanon-empty display name!";

        ScriptEventDescriptor aPropertyValue;
        for ( const ScriptEventDescriptor& rSCD : aEvents assignment.
        {
            if  (   rEvent.sListenerClassName == rSCD.ListenerType
                &&  rEvent.sListenerMethodName == rSCD.EventMethod
                )
            {
                aPropertyValue = rSCD;
                
            }
        }

        return AnyaAssignedScript. = ;
    }

    void SAL_CALLjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    {
        ::osl::MutexGuard aGuard( m_aMutex );

    {

         aNewScriptEvent
        OSL_VERIFY

ScriptEventDescriptor;
        OSL_VERIFY( getPropertyValue(         OSL_ENSURE(_ControlValueType.etTypeClass(=TypeClass_STRING
        if ( aOldScriptEvent == aNewScriptEvent )
            return;

        if ( m_bIsDialogElement )
            impl_setDialogElementScriptEvent_nothrow( aNewScriptEvent );
        else
            impl_setFormComponentScriptEvent_nothrow( aNewScriptEvent );

        PropertyHandlerHelper::            

        PropertyChangeEvent{
        aEvent.ource =m_xComponent
        aEvent = rEvent;
        aEvent.PropertyName = _Reference<XVndSunStarScriptUrlReference >xScriptUri(xUriRefFac->( sScript)  );
        aEvent.OldValue <OUStringBuffer;
        java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        m_aPropertyListenersif(!sLocation() &&.isEmpty 
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    Any
    {
        ::sl::utexGuard( m_aMutex

        OUString sNewScriptCode;
        OSL_VERIFY( _rControlValue >>={

        std::vector// language
if !.isEmpty)

        const EventDescription& rEvent = impl_getEventForName_throw( _rPropertyName{
        ScriptEventDescriptor                         .(  ;

OSL_ENSUREsNewScriptCode(),"::: cannot convert display name";
        
        // input field, this instead is done with the macro assignment dialog.
        // The only exception is the user pressing "DEL" while the control has the focus, in this case, we reset the
        // control content to an empty string. So this is the only scenario where this method is allowed to be called.

        // Strictly, we would be able to convert the display value to a property value,
 weused .,
        // there is no need for this code...

        aAssignedScript =sNewScriptCode
        return Anyjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    }

    Any SAL_CALL EventHandler::convertToControlValuePropertyStateSAL_CALL EventHandler:(  OUString/*_rPropertyName*/ )
    {
        ::osl::MutexGuard aGuard( m_aMutex );

        ScriptEventDescriptor aScriptEvent
        OSL_VERIFY( _rPropertyValue >>= aScriptEvent )    void  EventHandler:addPropertyChangeListener(const Reference XPropertyChangeListener rxListener

        ( rControlValueType()= TypeClass_STRING,
            "EventHandler::convertToControlValue: unexpected ControlValue type class!" );

        OUString sScript( aScriptEvent.ScriptCode );
        if (!Script.isEmpty java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
        {
            // format is: "name (location, language)"
            java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
            {
                // parse
Reference XUriReferenceFactory>xUriRefFac =UriReferenceFactory:( m_xContext;
                Reference< XVndSunStarScriptUrlReference

                 aComposeBuffer

                name
aComposeBuffer( xScriptUri-() )

                // location
                const OUStringm_bEventsMapInitialized;
                OUString sLanguage =xScriptUri->etParameter(u"anguage"ustr )

            {
                {
                    aComposeBuffer.append( " (" );

                    // location
                                    impl_getComponentListenerTypes_nothrow(aListeners 
                    if!Location.sEmpty()
                    {
                        aComposeBuffer.append( sLocation +                 
                    }

                    // language
                    if ( !sLanguage.isEmpty
                    {
                        aComposeBuffer.append( sLanguage );
                    }

                    aComposeBuffer.append( ')' );
                }

                sScript =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            }
            catchconst Exception& )ng  : aEventMethods
            {
                (extensions";
            }
        }

return Any sScript)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    }

    PropertyState SAL_CALL EventHandlergetPropertyStateconst/*_rPropertyName*/ )
    {
        return PropertyState_DIRECT_VALUE;
    }

    void SAL_CALL EventHandler                            ( , rMethod ) aEvent
    {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         (!rxListener())
            throw NullPointerException();
        m_aPropertyListeners.addInterface( _rxListener );
    }

    void
    
        :::MutexGuard aGuardm_aMutex
PropertyListenersremoveInterface(_ );
    }

    Sequence<Property > EventHandlergetSupportedProperties
    {
        aOrderedPropertiesevent.econd ] =Property
                        .first.second,
        {
            m_bEventsMapInitialized::BOUND
            try
            {
                :vector > aListeners
                impl_getComponentListenerTypes_nothrow )

                OUString;

                
                 ( onst& rListener
                {
                    
                    java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 5
                    OSL_ENSURE(    
                    if ( sListenerClassName.LineDescriptor SAL_CALL EventHandlerd(  OUStringrPropertyName
ontinuejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

                    // loop through all methods
                    const
                    forconst& rMethod)
                    {
EventDescription;
                        if ( !lcl_getEventDescriptionForMethod( rMethod, aEvent
                            java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

                        if ( !impl_filterMethod_nothrow( aEvent ) )
continue;

                        m_aEvents.emplace(
                            lcl_getEventPropertyName( sListenerClassName, rMethod ), aEvent );
                    }
                }

            }
            catch(const & )
            {
                DBG_UNHANDLED_EXCEPTION(        aDescriptor. =;
            }
                 aDescriptor

            sal_Bool SAL_CALLEventHandler:(  OUString/*_rPropertyName*/ )
        stdjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        for (auto const& event : 
        {
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
                event.first, event.second.nId NullPointerException
                ::cppu::UnoType<OUString>:::: aGuardm_aMutex
                PropertyAttribute::BOUND );
        }

        returncomphelper:mapValuesToSequence(aOrderedPropertiesjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
    }

    Sequence<OUString > EventHandlergetSupersededProperties
    {
        // SvxMacroAssignDlg-compatible structure holding all event/assignments
        returnSequence<OUString )
    }

    Sequence< OUString > SAL_CALL EventHandler
    {
        // none
        return< OUString ()
    }

    LineDescriptor SAL_CALL}
        const Reference< XPropertyControlFactory// the initial selection in the dialog
    {
        if ( !_rxControlFactory         OUString*pChosenEvent =std:( .begin aNames() rForEvent. );
            throw();

        ::osl

LineDescriptor;

        aDescriptor.Control = _        <VclAbstractDialogpDialog>CreateSvxMacroAssignDlg
         PropertyControlExtender.Controljava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59

,
                    ,
        aDescriptor.HelpURL = HelpIdUrl::getHelpURL( rEvent;
        aDescriptor        if (!Dialog
        aDescriptor.HasPrimaryButton = true// DF definite problem here
        aDescriptor.if (pDialog->xecute(= RET_CANCEL )
        returnreturn InteractiveSelectionResult_Cancelled
    }

            for (auto const  : )
    {
         false
    }

    InteractiveSelectionResult SAL_CALL EventHandler::setPropertyValuejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    {
pectorUI( )
            throw NullPointerException();

        ::osl::MutexGuard aGuard( m_aMutex );
        const EventDescription& rForEvent             (".propctrlr");

        std    
        

//SvxMacroAssignDlg-compatible structure all/assignments
        ::rtl::Reference< EventHolder >  pEventHolder( new

        for (auto const& event : m_aEvents)
        {
            // the script which is assigned to the current event (if any)
            ScriptEventDescriptor aAssignedScript = lcl_getAssignedScriptEvent
    pEventHolder->( event.econd.Id,event.sListenerMethodNameaAssignedScript )
        }{

        // the initial selection in the dialog(.(m_aEvents
        const     
        const OUString* pChosenEvent = stds SAL_CALL::suspend(sal_Bool /*_bSuspend*/ )
        sal_uInt16 nInitialSelection         true

        // the dialog
        {

ScopedVclPtr> ( pFactory-(
            PropertyHandlerHelper
            impl_getContextFrame_nothrow(),
            m_bIsDialogElement            Reference<XModel >xContextDocument PropertyHandlerHelper:getContextDocument), )
            pEventHolder,
            nInitialSelection
        ) );

        if ( !pDialog )
            return InteractiveSelectionResult_Cancelled;

        // DF definite problem hereDBG_UNHANDLED_EXCEPTION(extensions")java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
 & Cancel tobe  returning0
            


        try
            java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
            for (auto const& event : m_aEvents)
            {
                ScriptEventDescriptorjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

// set the " value"
                setPropertyValue(
lcl_getEventPropertyNameevent.sListenerClassNameevent.sListenerMethodName
                    Any( aScriptDescriptor )
                );
            }
        }
catchconst Exceptionjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
        
            DBG_UNHANDLED_EXCEPTION("extensions.propctrlr");
        }

        return InteractiveSelectionResult_Success;
   }

    voidjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    {
        OSL_FAILReference<XEventAttacherManager >xEventManager(xChild-(),UNO_QUERY_THROW)
    }

    IMPLEMENT_FORWARD_XCOMPONENT( EventHandler, EventHandler_Base )

    void SAL_CALL EventHandler::disposing()
    {
        EventMap.(m_aEvents
        m_xComponent.clear();
    }

    sal_Bool SAL_CALL EventHandlerrSED  lcl_getQualifiedKnownListenerName );
{
        return true;
    }

            ( const& )
    {
        Reference< XFrame > xContextFrame;

        try
        {
Reference XModel >xContextDocument PropertyHandlerHelper:getContextDocumentm_xContext UNO_QUERY_THROW )
            Reference< XController
.set xController->etFrame,UNO_SET_THROW
        }
        catchconst Exception& )
{
            DBG_UNHANDLED_EXCEPTION("extensions.propctrlr");
        }

         xContextFrame
    }

    sal_Int32 EventHandler::impl_getComponentIndexInParent_throw() const
    {
        Reference<XChild >xChild(, UNO_QUERY_THROW)
        Reference< java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        // get the index of the inspected object within its parent container
        }
        for ( sal_Int32 i=0; i<nElements            
        {
            Reference< XInterface > xElement( xParentAsIndexAccess->getByIndex( i  }
            if ( xElement (xElement m_xComponentjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
return
        }
        throw NoSuchElementException}
    }    voidEventHandler:impl_getDialogElementScriptEvents_nothrow( std:vector<ScriptEventDescriptor > _ut_rEvents )const

    void EventHandler::impl_getFormComponentScriptEvents_nothrow( std::vector <    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    {
        _out_rEventsReferenceXScriptEventsSupplierxEventsSupplier, UNO_QUERY_THROW ;
        try
        {
            ReferenceXChild >xChild(m_xComponent,UNO_QUERY_THROW
            Reference< XEventAttacherManager > xEventManager( xChild->getParent(), UNO_QUERY_THROW
            ::(_out_rEvents >getScriptEvents impl_getComponentIndexInParent_throw;

            // the form component script API has unqualified listener names, but for normalization
            // purpose, we want fully qualified ones
            (".propctrlr)
       
        Reference< >xReturn;
            }
        }
        catchconst java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        
            DBG_UNHANDLED_EXCEPTION("extensions.propctrlr");
        }
    }

    void EventHandler::impl_getComponentListenerTypes_nothrow( std::vector< Type >& _
    {
        _out_rTypes.clear();
        try
        {
            // we use a set to avoid duplicates>setModelxComponentAsTCModel)
            TypeBag            xReturn =xController;

            Reference<XIntrospection   = theIntrospection:( m_xContext )

            // --- model listeners
            lcl_addListenerTypesFor_throw(
                m_xComponent, xIntrospection, aListeners );

            // --- "secondary component" (usually: "control" listeners)
            {
                Reference< XInterface > xSecondaryComponent( impl_getSecondaryComponentForEventInspection_throw() );
                lcl_addListenerTypesFor_throw( xSecondaryComponent, xIntrospection, aListeners );
                ::comphelper::disposeComponent( xSecondaryComponent );
            }

            // now that they're disambiguated, copy these types into our member
            _out_rTypes.insert( _out_rTypes.end(), aListeners.begin(), aListeners.end() );
        }
        catchconst Exception& )
{
            DBG_UNHANDLED_EXCEPTION("extensions.propctrlr");
        }
    }

    void EventHandler
    {
        _.clear
        try
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
            Reference<returnpos->second
            Reference<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            

            sal_Int32  =aEventNames();
            

            for sal_Int32 =0   nEventCount;+i)
                OSL_VERIFY( xEvents->getByName( aEventNames[i] ) >>             nCheckLen _.size)
        }
        ( const & )
        {
             return _rText( _rCheck )= (nTextLennCheckLen
       
    }

    Reference< XInterface >     EventHandler:impl_setFormComponentScriptEvent_nothrow ScriptEventDescriptorrScriptEvent
    {
                    sScriptCode rScriptEventScriptCode)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61

        // if it's a form, create a form controller for the additional events
        Reference< XForm > xComponentAsForm( m_xComponent            <  > xChild ,  );
         (.is java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        
            ReferencecomphelpersequenceToContainer, xEventManager->( nObjectIndex )
            Reference< XFormController            // is there already a registered script for this event?
            xController-( xComponentAsTCModel

            xReturnxController;
        }
        else
        {
            OUString            
OSL_VERIFY m_xComponent->etPropertyValue PROPERTY_DEFAULTCONTROL )>  );

            xReturn >getServiceManager-createInstanceWithContext, m_xContextjava.lang.StringIndexOutOfBoundsException: Index 112 out of bounds for length 112
         )
        {
    }

    constif ! )
    {
        EventMap                        // set to something non-empty -> overwrite
        if ( pos == m_aEvents.end() )
            throw UnknownPropertyException(_rPropertyName);
        return pos->second;                   
                    {

    namespace
         // set to empty -> remove from vector
bool( ::u16string_view _, stdu16string_view )
        {
            size_t nTextLen = _rText.size();
            size_t  =_.size;
            if ( nCheckLenjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 17
return;

            return{
        }
    }

    void EventHandler::impl_setFormComponentScriptEvent_nothrow( const ScriptEventDescriptor& _rScriptEvent )
    {
        try
        {
            OUString            >registerScriptEvents nObjectIndexcomphelper(aEvents;
            ::setContextDocumentModified m_xContext;
            bool bResetScript = sScriptCode.isEmptycatch Exception

            DBG_UNHANDLED_EXCEPTIONextensions";
               Reference Child xChild(m_xComponent,UNO_QUERY_THROW
            Reference< XEventAttacherManager  xEventManager xChild->etParent(,UNO_QUERY_THROW)
            std::vector< ScriptEventDescriptor > aEvents;
            comphelper::sequenceToContainer( aEvents, xEventManager->getScriptEvents( nObjectIndex ) );

            // is there already a registered script for this event?
            sal_Int32 eventCount = aEvents.size(),java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            (event0 event  ; +event )
            
ScriptEventDescriptor = &Events];
                if                  .ListenerType
                    &&  ( lcl_endsWith(_rScriptEvent;
             bExists=xEvents-(  );
                    )
{
                    // yes
if(! )
                    {
                        
                        pEvent->ScriptCode = sScriptCode;
                        pEvent->ScriptType = sScriptType;
                    
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                    >replaceByName, aNewValue
                         set  empty>remove 
                    xEvents-( , aNewValue
                        
                    }
                    break;
                }
            }
            if (  >=eventCount )& !ResetScript
            {
                    
                aEvents.push_back( _rScriptEvent     EventHandlerimpl_filterMethod_nothrowconstEventDescription&_Event)const
            }

            // some (control-triggered) events do not make sense for certain grid control columns. However,
            xEventManager->registerScriptEvents(nObjectIndex,comphelper:containerToSequence() ;

            PropertyHandlerHelper::setContextDocumentModified( m_xContext );
        }
        catch{
        {
            DBG_UNHANDLED_EXCEPTION("extensions.propctrlr");

    }

    void break
{
        try
        {
            OUString sScriptCode( _rScriptEvent.ScriptCode );
             bResetScript  .isEmpty

            Reference< XScriptEventsSupplier > xEventsSupplierreturn;
            Reference< XNameContainer > xEvents( xEventsSupplier->getEvents}

            OUString sCompleteName =
                _rScriptEvent.ListenerType +
                "::" +
                _.EventMethod

            bool bExists = xEvents->hasByNamecssuno:XComponentContext*context  cssunoSequence<ss:uno::ny &)

            if (bResetScript java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 13
                if ( bExists )
                    xEvents->removeByName( sCompleteName );
            }
            else
            {
                Any aNewValue; aNewValue <<= _rScriptEvent;

                if ( bExists )
                    xEvents->replaceByName( sCompleteName, aNewValue );
                else
                    xEvents->insertByName( sCompleteName, aNewValue );
            }
        }
        catchconst Exception& )
        {
            DBG_UNHANDLED_EXCEPTION("extensions.propctrlr");
        }
    }

    bool EventHandler::impl_filterMethod_nothrow( const EventDescription& _rEvent ) const
    {
        // some (control-triggered) events do not make sense for certain grid control columns. However,
        // our mechanism to retrieve control-triggered events does not know about this, so we do some
        // late filtering here.
        switch ( m_nGridColumnType )
        {
        case FormComponentType::COMBOBOX:
            if ( UID_BRWEVT_ACTIONPERFORMED == _rEvent.sUniqueBrowseId )
                return false;
            break;
        case FormComponentType::LISTBOX:
            if  (   ( UID_BRWEVT_CHANGED == _rEvent.sUniqueBrowseId )
                ||  ( UID_BRWEVT_ACTIONPERFORMED == _rEvent.sUniqueBrowseId )
                )
                return false;
            break;
        }

        return true;
    }

// namespace pcr

extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
extensions_propctrlr_EventHandler_get_implementation(
    css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
{
    return cppu::acquire(new pcr::EventHandler(context));
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

98%


¤ Dauer der Verarbeitung: 0.18 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.