qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java | 16 - sw/inc/accmap.hxx | 2 sw/inc/viewsh.hxx | 3 sw/source/core/access/acccontext.cxx | 99 ---------- sw/source/core/access/acccontext.hxx | 38 --- sw/source/core/access/accdoc.cxx | 4 sw/source/core/access/accdoc.hxx | 5 sw/source/core/access/accmap.cxx | 2 sw/source/core/view/viewsh.cxx | 8 9 files changed, 31 insertions(+), 146 deletions(-)
New commits: commit a1827e6e7c0aace60bf167d7ff9e221f04137417 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jun 25 13:05:26 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jun 27 09:08:02 2025 +0200 sw a11y: Return OAccessible in SwViewShell::CreateAccessible Change-Id: I4b482b6f29c892a8ec595ea9a17d9f4384dbfca7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186989 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx index 940c38ffc500..4ec88ee075e8 100644 --- a/sw/inc/accmap.hxx +++ b/sw/inc/accmap.hxx @@ -146,7 +146,7 @@ public: SwAccessibleMap(SwViewShell& rViewShell); virtual ~SwAccessibleMap() override; - css::uno::Reference<css::accessibility::XAccessible> GetDocumentView(); + rtl::Reference<comphelper::OAccessible> GetDocumentView(); css::uno::Reference<css::accessibility::XAccessible> GetDocumentPreview( const std::vector<std::unique_ptr<PreviewPage>>& _rPreviewPages, diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index dc2b09f4440a..446684971880 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -31,6 +31,7 @@ #include <vcl/window.hxx> namespace com::sun::star::accessibility { class XAccessible; } +namespace comphelper { class OAccessible; } class SwDoc; class IDocumentSettingAccess; class IDocumentDeviceAccess; @@ -555,7 +556,7 @@ public: sal_Int32 GetBrowseWidth() const; void SetBrowseBorder( const Size& rNew ); - css::uno::Reference< css::accessibility::XAccessible > CreateAccessible(); + rtl::Reference<comphelper::OAccessible> CreateAccessible(); css::uno::Reference< css::accessibility::XAccessible > CreateAccessiblePreview(); diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index da652679aac8..fedc79616a6c 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1641,7 +1641,7 @@ rtl::Reference<SwAccessibleContext> SwAccessibleMap::GetDocumentView_( return xAcc; } -uno::Reference< XAccessible > SwAccessibleMap::GetDocumentView( ) +rtl::Reference<comphelper::OAccessible> SwAccessibleMap::GetDocumentView() { return GetDocumentView_( false ); } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 107ca66f6c02..1926f0f437dd 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2702,18 +2702,18 @@ bool SwViewShell::IsNewLayout() const } #if !ENABLE_WASM_STRIP_ACCESSIBILITY -uno::Reference< css::accessibility::XAccessible > SwViewShell::CreateAccessible() +rtl::Reference<comphelper::OAccessible> SwViewShell::CreateAccessible() { - uno::Reference< css::accessibility::XAccessible > xAcc; + rtl::Reference<comphelper::OAccessible> pAcc; // We require a layout and an XModel to be accessible. OSL_ENSURE( mpLayout, "no layout, no access" ); OSL_ENSURE( GetWin(), "no window, no access" ); if( mxDoc->getIDocumentLayoutAccess().GetCurrentViewShell() && GetWin() ) - xAcc = Imp()->GetAccessibleMap().GetDocumentView(); + pAcc = Imp()->GetAccessibleMap().GetDocumentView(); - return xAcc; + return pAcc; } uno::Reference< css::accessibility::XAccessible > SwViewShell::CreateAccessiblePreview() commit 01332e05d91006ab073cd9603a7e784aabc0258f Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jun 25 12:51:52 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jun 27 09:07:55 2025 +0200 sw a11y: Let SwAccessibleContext subclass OAccessible Make SwAccessibleContext an OAccessible subclass. This allows to reuse logic implemented there for the XAccessible, XAccessibleContext, XAccessibleComponent and XAccessibleEventBroadcaster interfaces. SwAccessibleContext::getBoundsImpl implements what is needed to implement OAccessibleComponentHelper::implGetBounds, so simply call that method from there. Drop the SolarMutexGuard at the start of SwAccessibleContext::getBoundsImpl because the base class takes care of that when calling OAccessibleComponentHelper::implGetBounds. Explicitly lock the SolarMutex in SwAccessibleContext::getLocationOnScreen instead, which also calls SwAccessibleContext::getBoundsImpl that doesn't lock the mutex anymore now. No change in behavior expected or seen in a quick test with Writer and the gtk3 and qt6 VCL plugins on Linux together with Accerciser and the Orca screen reader. Change-Id: I2b75ccd3eed57f276feab303d63038299ceb90d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186988 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx index 515ad49c14dc..d983277fd219 100644 --- a/sw/source/core/access/acccontext.cxx +++ b/sw/source/core/access/acccontext.cxx @@ -410,11 +410,7 @@ void SwAccessibleContext::FireAccessibleEvent(const sal_Int16 nEventId, return; } - uno::Reference<XAccessibleContext> xThis(this); - AccessibleEventObject aEvent(xThis, nEventId, rNewValue, rOldValue, nIndexHint); - - if (m_nClientId) - comphelper::AccessibleEventNotifier::addEvent(m_nClientId, aEvent); + NotifyAccessibleEvent(nEventId, rOldValue, rNewValue, nIndexHint); } void SwAccessibleContext::FireVisibleDataEvent() @@ -498,7 +494,6 @@ SwAccessibleContext::SwAccessibleContext(std::shared_ptr<SwAccessibleMap> const& pMap->GetShell().IsPreview() ) , m_pMap(pMap.get()) , m_wMap(pMap) - , m_nClientId(0) , m_nRole(nRole) , m_isDisposing( false ) , m_isRegisteredAtAccessibleMap( true ) @@ -526,13 +521,6 @@ SwAccessibleContext::~SwAccessibleContext() } } -uno::Reference< XAccessibleContext > SAL_CALL - SwAccessibleContext::getAccessibleContext() -{ - uno::Reference < XAccessibleContext > xRet( this ); - return xRet; -} - sal_Int64 SAL_CALL SwAccessibleContext::getAccessibleChildCount() { SolarMutexGuard aGuard; @@ -725,58 +713,7 @@ lang::Locale SAL_CALL SwAccessibleContext::getLocale() return aLoc; } -void SAL_CALL SwAccessibleContext::addAccessibleEventListener( - const uno::Reference< XAccessibleEventListener >& xListener ) -{ - if (xListener.is()) - { - SolarMutexGuard aGuard; - if (!m_nClientId) - m_nClientId = comphelper::AccessibleEventNotifier::registerClient( ); - comphelper::AccessibleEventNotifier::addEventListener( m_nClientId, xListener ); - } -} - -void SAL_CALL SwAccessibleContext::removeAccessibleEventListener( - const uno::Reference< XAccessibleEventListener >& xListener ) -{ - if (!(xListener.is() && m_nClientId)) - return; - - SolarMutexGuard aGuard; - sal_Int32 nListenerCount = comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, xListener ); - if ( !nListenerCount ) - { - // no listeners anymore - // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), - // and at least to us not firing any events anymore, in case somebody calls - // NotifyAccessibleEvent, again - comphelper::AccessibleEventNotifier::revokeClient( m_nClientId ); - m_nClientId = 0; - } -} - -static bool lcl_PointInRectangle(const awt::Point & aPoint, - const awt::Rectangle & aRect) -{ - tools::Long nDiffX = aPoint.X - aRect.X; - tools::Long nDiffY = aPoint.Y - aRect.Y; - - return - nDiffX >= 0 && nDiffX < aRect.Width && nDiffY >= 0 && - nDiffY < aRect.Height; - -} - -sal_Bool SAL_CALL SwAccessibleContext::containsPoint( - const awt::Point& aPoint ) -{ - awt::Rectangle aPixBounds = getBounds(); - aPixBounds.X = 0; - aPixBounds.Y = 0; - - return lcl_PointInRectangle(aPoint, aPixBounds); -} +css::awt::Rectangle SwAccessibleContext::implGetBounds() { return getBoundsImpl(true); } uno::Reference< XAccessible > SAL_CALL SwAccessibleContext::getAccessibleAtPoint( const awt::Point& aPoint ) @@ -839,8 +776,6 @@ uno::Reference< XAccessible > SAL_CALL SwAccessibleContext::getAccessibleAtPoint */ awt::Rectangle SwAccessibleContext::getBoundsImpl(bool bRelative) { - SolarMutexGuard aGuard; - ThrowIfDisposed(); const SwFrame *pParent = GetParent(); @@ -884,21 +819,10 @@ awt::Rectangle SwAccessibleContext::getBoundsImpl(bool bRelative) return vcl::unohelper::ConvertToAWTRect(aPixBounds); } -awt::Rectangle SAL_CALL SwAccessibleContext::getBounds() -{ - return getBoundsImpl(true); -} - -awt::Point SAL_CALL SwAccessibleContext::getLocation() -{ - awt::Rectangle aRect = getBounds(); - awt::Point aPoint(aRect.X, aRect.Y); - - return aPoint; -} - awt::Point SAL_CALL SwAccessibleContext::getLocationOnScreen() { + SolarMutexGuard aGuard; + awt::Rectangle aRect = getBoundsImpl(false); Point aPixPos(aRect.X, aRect.Y); @@ -915,14 +839,6 @@ awt::Point SAL_CALL SwAccessibleContext::getLocationOnScreen() return aPoint; } -awt::Size SAL_CALL SwAccessibleContext::getSize() -{ - awt::Rectangle aRect = getBounds(); - awt::Size aSize( aRect.Width, aRect.Height ); - - return aSize; -} - void SAL_CALL SwAccessibleContext::grabFocus() { SolarMutexGuard aGuard; @@ -1037,12 +953,7 @@ void SwAccessibleContext::Dispose(bool bRecursive, bool bCanSkipInvisible) m_isDefuncState = true; } - // broadcast dispose event - if (m_nClientId) - { - comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( m_nClientId, *this ); - m_nClientId = 0; - } + OAccessible::dispose(); RemoveFrameFromAccessibleMap(); ClearFrame(); diff --git a/sw/source/core/access/acccontext.hxx b/sw/source/core/access/acccontext.hxx index 911598414425..ece8983dd0b3 100644 --- a/sw/source/core/access/acccontext.hxx +++ b/sw/source/core/access/acccontext.hxx @@ -38,14 +38,10 @@ namespace accessibility { class AccessibleShape; } -class SwAccessibleContext : - public ::cppu::WeakImplHelper< - css::accessibility::XAccessible, - css::accessibility::XAccessibleContext, - css::accessibility::XAccessibleContext3, - css::accessibility::XAccessibleComponent, - css::accessibility::XAccessibleEventBroadcaster>, - public SwAccessibleFrame +class SwAccessibleContext + : public cppu::ImplInheritanceHelper<comphelper::OAccessible, + css::accessibility::XAccessibleContext3>, + public SwAccessibleFrame { // The implements for the XAccessibleSelection interface has been // 'externalized' and wants access to the protected members like @@ -70,7 +66,6 @@ private: /// alive, after locking SolarMutex (alternatively, Dispose clears m_pMap) std::weak_ptr<SwAccessibleMap> m_wMap; - sal_uInt32 m_nClientId; // client id in the AccessibleEventNotifier queue sal_Int16 m_nRole; // immutable outside constructor // The current states (protected by mutex) @@ -161,6 +156,9 @@ public: const css::uno::Any& rNewValue, sal_Int32 nIndexHint = -1); protected: + // OAccessible + virtual css::awt::Rectangle implGetBounds() override; + // broadcast visual data event void FireVisibleDataEvent(); @@ -196,12 +194,6 @@ public: SwAccessibleContext( std::shared_ptr<SwAccessibleMap> const& pMap, sal_Int16 nRole, const SwFrame *pFrame ); - // XAccessible - - // Return the XAccessibleContext. - virtual css::uno::Reference< css::accessibility::XAccessibleContext> SAL_CALL - getAccessibleContext() override; - // XAccessibleContext // Return the number of currently visible children. @@ -245,28 +237,12 @@ public: virtual css::lang::Locale SAL_CALL getLocale() override; - // XAccessibleEventBroadcaster - - virtual void SAL_CALL addAccessibleEventListener( - const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; - virtual void SAL_CALL removeAccessibleEventListener( - const css::uno::Reference< css::accessibility::XAccessibleEventListener >& xListener ) override; - // XAccessibleComponent - virtual sal_Bool SAL_CALL containsPoint( - const css::awt::Point& aPoint ) override; - virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; - virtual css::awt::Rectangle SAL_CALL getBounds() override; - - virtual css::awt::Point SAL_CALL getLocation() override; - virtual css::awt::Point SAL_CALL getLocationOnScreen() override; - virtual css::awt::Size SAL_CALL getSize() override; - virtual void SAL_CALL grabFocus() override; virtual sal_Int32 SAL_CALL getForeground() override; diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index 867b653728c7..c8cd3107d722 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -211,12 +211,10 @@ OUString SAL_CALL SwAccessibleDocumentBase::getAccessibleName() return sAccName; } -awt::Rectangle SAL_CALL SwAccessibleDocumentBase::getBounds() +awt::Rectangle SwAccessibleDocumentBase::implGetBounds() { try { - SolarMutexGuard aGuard; - vcl::Window *pWin = GetWindow(); if (!pWin) { diff --git a/sw/source/core/access/accdoc.hxx b/sw/source/core/access/accdoc.hxx index 88b647d0b5f5..1d72cfa1ef4c 100644 --- a/sw/source/core/access/accdoc.hxx +++ b/sw/source/core/access/accdoc.hxx @@ -65,13 +65,14 @@ public: virtual OUString SAL_CALL getAccessibleName() override; + // OAccessible + virtual css::awt::Rectangle implGetBounds() override; + // XAccessibleComponent virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override; - virtual css::awt::Rectangle SAL_CALL getBounds() override; - virtual css::awt::Point SAL_CALL getLocationOnScreen() override; }; commit 868a618878f8ab13967e100c76dc04ca100e7882 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Jun 26 12:07:02 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jun 27 09:07:48 2025 +0200 sw java a11y test: Avoid disposing object still being tested With upcoming Change-Id: I2b75ccd3eed57f276feab303d63038299ceb90d7 Author: Michael Weghorn <[email protected]> Date: Wed Jun 25 12:51:52 2025 +0200 sw a11y: Let SwAccessibleContext subclass OAccessible , the SwAccessibleTextGraphicObject java a11y test was seen failing when running the JunitTest_sw_unoapi_1 test suite as can be seen in the CI log [1] (relevant part below). This is because with the above-mentioned commit in place, the XAccessible::getAccessibleContext implementation for SwAccessibleContext and subclasses throws a DisposedException if the object has already been disposed, while that was not the case previously. That seems fair, however. The problem in the SwAccessibleTextGraphicObject test is that the XAccessibleEventListener tests resulted in the object getting disposed, and the already disposed object would then be used in the following test of the XAccessible interface. Stop changing view zoom settings to trigger accessible events, which was the trigger for disposing the object, as Writer only exposes objects visible on screen as part of its a11y hierarchy. Backtrace of how the object was previously disposed: 1 comphelper::OAccessible::disposing OAccessible.cxx 55 0x7ff4676d54d1 2 cppu::WeakComponentImplHelperBase::dispose implbase.cxx 104 0x7ff46713dbf0 3 cppu::PartialWeakComponentImplHelper<com::sun::star::accessibility::XAccessible, com::sun::star::accessibility::XAccessibleContext2, com::sun::star::accessibility::XAccessibleEventBroadcaster, com::sun::star::accessibility::XAccessibleExtendedComponent>::dispose compbase.hxx 90 0x7ff43608ccd5 4 SwAccessibleContext::Dispose acccontext.cxx 956 0x7ff43609a284 5 SwAccessibleFrameBase::Dispose accframebase.cxx 230 0x7ff4360b40a3 6 SwAccessibleNoTextFrame::Dispose accnotextframe.cxx 128 0x7ff436111b23 7 SwAccessibleContext::ScrolledOut acccontext.cxx 311 0x7ff436095972 8 SwAccessibleContext::ChildrenScrolled acccontext.cxx 169 0x7ff43609508b 9 SwAccessibleContext::ChildrenScrolled acccontext.cxx 228 0x7ff43609540d 10 SwAccessibleContext::Scrolled acccontext.cxx 237 0x7ff4360954fb 11 SwAccessibleDocumentBase::SetVisArea accdoc.cxx 88 0x7ff4360a326a 12 SwAccessibleMap::GetDocumentView_ accmap.cxx 1638 0x7ff4360c9762 13 SwAccessibleMap::GetDocumentView accmap.cxx 1646 0x7ff4360ca24b 14 SwViewShellImp::UpdateAccessible viewimp.cxx 369 0x7ff437315e08 15 SwViewShell::VisPortChgd viewsh.cxx 1466 0x7ff4373224fd 16 SwCursorShell::VisPortChgd crsrsh.cxx 1850 0x7ff43626b931 17 SwView::SetVisArea viewport.cxx 249 0x7ff437a8f5ab 18 SwView::CalcVisArea viewport.cxx 818 0x7ff437a92efa 19 SwView::SetZoom_ viewmdi.cxx 205 0x7ff437a8bcaa 20 SwView::SetZoom viewmdi.cxx 74 0x7ff437a8ac70 21 SwXViewSettings::_postSetValues unomod.cxx 765 0x7ff437afe542 22 comphelper::ChainablePropertySet::setPropertyValue ChainablePropertySet.cxx 66 0x7ff46780a6fe 23 gcc3::callVirtualMethod callvirtualmethod.cxx 87 0x7ff4578ee2cd 24 cpp_call uno2cpp.cxx 229 0x7ff4578ed03b 25 unoInterfaceProxyDispatch uno2cpp.cxx 409 0x7ff4578ec806 26 binaryurp::IncomingRequest::execute_throw incomingrequest.cxx 236 0x7ff456cd0a9c 27 binaryurp::IncomingRequest::execute incomingrequest.cxx 79 0x7ff456ccf060 28 request reader.cxx 86 0x7ff456cf9ae3 29 cppu_threadpool::JobQueue::enter jobqueue.cxx 100 0x7ff46897e96e 30 cppu_threadpool::ORequestThread::run thread.cxx 165 0x7ff46898585c 31 threadFunc thread.hxx 189 0x7ff468989d3e 32 osl_thread_start_Impl thread.cxx 237 0x7ff4694774ab 33 start_thread pthread_create.c 448 0x7ff468e9cb7b 34 clone clone.S 100 0x7ff468f1a5f0 Instead, change the graphic object's title/name to trigger an AccessibleEventId::NameChanged event instead, see the SfxHintId::SwTitleChanged case in AccessibleNoTextFrame::Notify. Relevant part of output for failed test without this change in place: *************************************************** Creating: sw.SwAccessibleTextGraphicObject LOG> Log started 26.05.2025 - 01:14:13 LOG> creating a text document LOG> inserting graphic LOG> ImplementationName Unknown, does not implement XServiceInfo Environment created LOG> Log started 26.05.2025 - 01:14:14 checking: [sw.SwAccessibleTextGraphicObject::com::sun::star::accessibility::XAccessibleEventBroadcaster] is iface: [com.sun.star.accessibility.XAccessibleEventBroadcaster] testcode: [ifc.accessibility._XAccessibleEventBroadcaster] LOG> Execute: addEventListener() LOG> adding listener LOG> fire event LOG> Listener, Event : 10 EventID: 10 LOG> Listener, Event : 10 EventID: 10 LOG> Listener, Event : 10 EventID: 10 LOG> Listener, Event : 4 EventID: 4 Method addEventListener() finished with state OK LOG> addEventListener(): COMPLETED.OK LOG> Execute: removeEventListener() LOG> starting required method: addEventListener() LOG> remove listener LOG> fire event LOG> listener wasn't called -- OK Method removeEventListener() finished with state OK LOG> removeEventListener(): COMPLETED.OK ***** State for sw.SwAccessibleTextGraphicObject::com::sun::star::accessibility::XAccessibleEventBroadcaster ****** Whole interface: COMPLETED.OK ******************************************************************************************************************* LOG> Log started 26.05.2025 - 01:14:14 checking: [sw.SwAccessibleTextGraphicObject::com::sun::star::accessibility::XAccessible] is iface: [com.sun.star.accessibility.XAccessible] testcode: [ifc.accessibility._XAccessible] LOG> Execute: getAccessibleContext() com.sun.star.lang.DisposedException: at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/comphelper/source/misc/OAccessible.cxx:140 at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:158) at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:122) at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:312) at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:281) at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:81) at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:619) at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:145) at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:129) at jdk.proxy2/jdk.proxy2.$Proxy39.getAccessibleContext(Unknown Source) at ifc.accessibility._XAccessible._getAccessibleContext(_XAccessible.java:44) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at lib.MultiMethodTest.invokeTestMethod(MultiMethodTest.java:386) at lib.MultiMethodTest.callMethod(MultiMethodTest.java:364) at lib.MultiMethodTest.executeMethod(MultiMethodTest.java:352) at lib.MultiMethodTest.run(MultiMethodTest.java:216) at base.java_fat.executeInterfaceTest(java_fat.java:445) at base.java_fat.executeTest(java_fat.java:185) at org.openoffice.Runner.run(Runner.java:175) at org.openoffice.test.UnoApiTest.test(UnoApiTest.java:41) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:52) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:77) at org.junit.runner.JUnitCore.main(JUnitCore.java:36) LOG> getAccessibleContext(): at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/comphelper/source/misc/OAccessible.cxx:140.FAILED ***** State for sw.SwAccessibleTextGraphicObject::com::sun::star::accessibility::XAccessible ****** [sw.SwAccessibleTextGraphicObject::com::sun::star::accessibility::XAccessible::getAccessibleContext()] is testcode: [getAccessibleContext()] - at /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/comphelper/source/misc/OAccessible.cxx:140.FAILED Whole interface: COMPLETED.FAILED [1] https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/185066/console Change-Id: I6ed2f1c32517b60aa981de60aa4df4abc41cc0b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187036 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java index 0467a44554cc..ff4a87b13da4 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleTextGraphicObject.java @@ -38,6 +38,7 @@ import com.sun.star.text.XText; import com.sun.star.text.XTextContent; import com.sun.star.text.XTextCursor; import com.sun.star.text.XTextDocument; +import com.sun.star.uno.AnyConverter; import com.sun.star.uno.UnoRuntime; import com.sun.star.view.XViewSettingsSupplier; @@ -92,20 +93,17 @@ public class SwAccessibleTextGraphicObject extends TestCase { TestEnvironment tEnv = new TestEnvironment(xGraphicAcc); - XController xController = xTextDoc.getCurrentController(); - XViewSettingsSupplier xViewSetSup = UnoRuntime.queryInterface(XViewSettingsSupplier.class, - xController); - - final XPropertySet PropSet = xViewSetSup.getViewSettings(); + final XPropertySet propSet = UnoRuntime.queryInterface(XPropertySet.class, oGraphObj); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { public void fireEvent() { try { - //change zoom value to 20% - PropSet.setPropertyValue("ZoomValue", Short.valueOf("20")); - //and back to 100% - PropSet.setPropertyValue("ZoomValue", Short.valueOf("100")); + // temporarily set a different object name/title + String title = AnyConverter.toString(propSet.getPropertyValue("Title")); + propSet.setPropertyValue("Title", "New Title"); + // set back original value + propSet.setPropertyValue("Title", title); } catch ( com.sun.star.lang.WrappedTargetException e ) { } catch ( com.sun.star.lang.IllegalArgumentException e ) {
