diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-07-03 20:29:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-08 10:10:11 +0200 |
commit | 8d8e6c84e512c1a8b33aac75965b84481d1a1d13 (patch) | |
tree | 9ed209d057081d4283eb44b51c0d9af18f976eab /include/editeng | |
parent | 911ac42485b690df5cbbff6e3c04b111c1723aca (diff) |
[API CHANGE] Drop css::accessibility::XAccessibleStateSet
which is internal API, unused (as far as I can tell) by external
users.
This state is purely a bitset
(as implemented by utl::AccessibleStateSetHelper)
so we can just return it as a 64-bit value.
This shaves significant time off the performance profiles
of code that loads very complex shapes, because this state
is frequently used, and we no longer need to allocate a return
value on the heap for every call.
Change-Id: Icf1b3bd367c256646ae9015f9127025f59459c2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136786
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/editeng')
-rw-r--r-- | include/editeng/AccessibleContextBase.hxx | 13 | ||||
-rw-r--r-- | include/editeng/AccessibleEditableTextPara.hxx | 9 | ||||
-rw-r--r-- | include/editeng/AccessibleParaManager.hxx | 15 |
3 files changed, 16 insertions, 21 deletions
diff --git a/include/editeng/AccessibleContextBase.hxx b/include/editeng/AccessibleContextBase.hxx index 69ef3151cef2..3002784b3484 100644 --- a/include/editeng/AccessibleContextBase.hxx +++ b/include/editeng/AccessibleContextBase.hxx @@ -30,10 +30,8 @@ #include <editeng/editengdllapi.h> #include <rtl/ref.hxx> -namespace com::sun::star::accessibility { class XAccessibleStateSet; } namespace com::sun::star::accessibility { class XAccessibleRelationSet; } namespace com::sun::star::accessibility { struct AccessibleEventObject; } -namespace utl { class AccessibleStateSetHelper; } namespace accessibility { @@ -125,7 +123,7 @@ public: If the specified state changed its value due to this call <TRUE/> is returned, otherwise <FALSE/>. */ - virtual bool SetState (sal_Int16 aState); + virtual bool SetState (sal_Int64 aState); /** Reset the specified state (turn it off) and send events to all listeners to inform them of the change. @@ -137,7 +135,7 @@ public: If the specified state changed its value due to this call <TRUE/> is returned, otherwise <FALSE/>. */ - virtual bool ResetState (sal_Int16 aState); + virtual bool ResetState (sal_Int64 aState); /** Return the state of the specified state. @@ -148,7 +146,7 @@ public: A value of <TRUE/> indicates that the state is set. A <FALSE/> value indicates an unset state. */ - bool GetState (sal_Int16 aState); + bool GetState (sal_Int64 aState); /** Replace the current relation set with the specified one. Send events for relations that are not in both sets. @@ -204,8 +202,7 @@ public: getAccessibleRelationSet() override; /// Return the set of current states. - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet> SAL_CALL - getAccessibleStateSet() override; + virtual sal_Int64 SAL_CALL getAccessibleStateSet() override; /** Return the parents locale or throw exception if this object has no parent yet/anymore. @@ -261,7 +258,7 @@ public: protected: /** The state set. */ - rtl::Reference<::utl::AccessibleStateSetHelper> mxStateSet; + sal_Int64 mnStateSet; /** The relation set. Relations can be set or removed by calling the <member>AddRelation</member> and <member>RemoveRelation</member> methods. diff --git a/include/editeng/AccessibleEditableTextPara.hxx b/include/editeng/AccessibleEditableTextPara.hxx index d81cc6cd536b..c4fd0c4c31e3 100644 --- a/include/editeng/AccessibleEditableTextPara.hxx +++ b/include/editeng/AccessibleEditableTextPara.hxx @@ -48,7 +48,6 @@ class MapMode; class SvxAccessibleTextAdapter; class SvxAccessibleTextEditViewAdapter; namespace accessibility { class AccessibleImageBullet; } -namespace utl { class AccessibleStateSetHelper; } namespace accessibility { @@ -102,7 +101,7 @@ namespace accessibility virtual OUString SAL_CALL getAccessibleDescription() override; virtual OUString SAL_CALL getAccessibleName() override; virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override; - virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override; + virtual sal_Int64 SAL_CALL getAccessibleStateSet() override; virtual css::lang::Locale SAL_CALL getLocale() override; // XAccessibleEventBroadcaster @@ -236,9 +235,9 @@ namespace accessibility void FireEvent(const sal_Int16 nEventId, const css::uno::Any& rNewValue = css::uno::Any(), const css::uno::Any& rOldValue = css::uno::Any() ) const; /// Sets the given state on the internal state set and fires STATE_CHANGE event. Don't hold locks when calling this! - void SetState( const sal_Int16 nStateId ); + void SetState( const sal_Int64 nStateId ); /// Unsets the given state on the internal state set and fires STATE_CHANGE event. Don't hold locks when calling this! - void UnSetState( const sal_Int16 nStateId ); + void UnSetState( const sal_Int64 nStateId ); static tools::Rectangle LogicToPixel( const tools::Rectangle& rRect, const MapMode& rMapMode, SvxViewForwarder const & rForwarder ); @@ -365,7 +364,7 @@ namespace accessibility Point maEEOffset; // the current state set (updated from SetState/UnSetState and guarded by solar mutex) - rtl::Reference< ::utl::AccessibleStateSetHelper > mxStateSet; + sal_Int64 mnStateSet; /// The shape we're the accessible for (unguarded) css::uno::Reference< css::accessibility::XAccessible > mxParent; diff --git a/include/editeng/AccessibleParaManager.hxx b/include/editeng/AccessibleParaManager.hxx index 0eceac19ce43..51ae37ed3189 100644 --- a/include/editeng/AccessibleParaManager.hxx +++ b/include/editeng/AccessibleParaManager.hxx @@ -94,18 +94,17 @@ namespace accessibility typedef ::std::pair< css::uno::Reference< css::accessibility::XAccessible > , css::awt::Rectangle > Child; typedef ::std::vector< WeakChild > VectorOfChildren; - typedef ::std::vector< sal_Int16 > VectorOfStates; AccessibleParaManager(); ~AccessibleParaManager(); - /** Sets a vector of additional accessible states. + /** Sets a bitset of additional accessible states. The states are passed to every created child object (text paragraph). The state values are defined in css::accessibility::AccessibleStateType. */ - void SetAdditionalChildStates( VectorOfStates&& rChildStates ); + void SetAdditionalChildStates( sal_Int64 nChildStates ); /** Set the number of paragraphs @@ -144,9 +143,9 @@ namespace accessibility /// Make all children active and editable (or off) void SetActive( bool bActive = true ); /// Set state of all children - void SetState( const sal_Int16 nStateId ); + void SetState( const sal_Int64 nStateId ); /// Unset state of all children - void UnSetState( const sal_Int16 nStateId ); + void UnSetState( const sal_Int64 nStateId ); /// Set offset to edit engine for all children void SetEEOffset ( const Point& rOffset ); /// Dispose all living children @@ -240,9 +239,9 @@ namespace accessibility private: /// Set state on given child - void SetState( sal_Int32 nChild, const sal_Int16 nStateId ); + void SetState( sal_Int32 nChild, const sal_Int64 nStateId ); /// Unset state on given child - void UnSetState( sal_Int32 nChild, const sal_Int16 nStateId ); + void UnSetState( sal_Int32 nChild, const sal_Int64 nStateId ); /// Init child with default state (as stored in previous SetFocus and SetActive calls) void InitChild( AccessibleEditableTextPara& rChild, SvxEditSourceAdapter& rEditSource, @@ -253,7 +252,7 @@ namespace accessibility VectorOfChildren maChildren; /// Additional states that will be set at every created child object. - VectorOfStates maChildStates; + sal_Int64 mnChildStates; // cache EE offset for child creation Point maEEOffset; |