From 0e37f38af0fb5a6005a394009183fe4d5ec7ef39 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 27 May 2020 17:11:34 +0100 Subject: Resolves: tdf#133411 drop CONTENT_FLOWS_TO from dialog to search results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in the document, looks like only the calc one actually works, and when it works on large quantities of results calc grinds to a complete halt This was introduced with: commit b41332475783c31136673fb44cf4c411bb0148f8 Date: Mon Dec 2 15:54:29 2013 +0000 Integrate branch of IAccessible2 and has been a problem on and off with calc's potentially ~infinite grid There is the on-by-default search results dialog in calc (which has a limit on how many it shows) which provides an alternative route to iterate through the results Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95006 Tested-by: Jenkins Reviewed-by: Caolán McNamara (cherry picked from commit 0b94169d820482434dc98a37c3c1633ca46fd0dc) Change-Id: I2685e480d2d15220be0bddbc83baad3992e7d5d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95014 Tested-by: Jenkins Reviewed-by: Xisco Fauli (cherry picked from commit f753baddc057a3bf4881ac78a15cd11fa847ee28) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102554 Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen --- include/comphelper/accflowenum.hxx | 34 ----- include/svx/srchdlg.hxx | 5 - include/vcl/weld.hxx | 5 - include/vcl/window.hxx | 4 - sc/source/ui/Accessibility/AccessibleDocument.cxx | 155 --------------------- sc/source/ui/inc/AccessibleDocument.hxx | 7 +- sc/source/ui/view/tabvwshe.cxx | 40 +----- sd/IwyuFilter_sd.yaml | 1 - .../accessibility/AccessibleDocumentViewBase.cxx | 9 -- .../accessibility/AccessibleDrawDocumentView.cxx | 151 -------------------- sd/source/ui/inc/AccessibleDocumentViewBase.hxx | 7 +- sd/source/ui/inc/AccessibleDrawDocumentView.hxx | 6 - sd/source/ui/view/Outliner.cxx | 11 -- svx/source/dialog/srchdlg.cxx | 57 -------- sw/source/core/access/accdoc.cxx | 121 ---------------- sw/source/core/access/accdoc.hxx | 8 +- sw/source/uibase/uiview/viewsrch.cxx | 38 ----- toolkit/source/awt/vclxaccessiblecomponent.cxx | 3 - vcl/inc/window.h | 1 - vcl/source/app/salvtables.cxx | 10 -- vcl/source/window/window2.cxx | 15 -- vcl/unx/gtk3/gtk3gtkinst.cxx | 29 +--- 22 files changed, 5 insertions(+), 712 deletions(-) delete mode 100644 include/comphelper/accflowenum.hxx diff --git a/include/comphelper/accflowenum.hxx b/include/comphelper/accflowenum.hxx deleted file mode 100644 index fc6b7ea2d8ec..000000000000 --- a/include/comphelper/accflowenum.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- 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 . - */ - -#ifndef INCLUDED_COMPHELPER_ACCFLOWENUM_HXX -#define INCLUDED_COMPHELPER_ACCFLOWENUM_HXX - -#include - -enum AccessibilityFlowTo : sal_Int32 -{ - FORSPELLCHECKFLOWTO = 1, - FORFINDREPLACEFLOWTO_ITEM = 2, - FORFINDREPLACEFLOWTO_RANGE = 3 -}; - -#endif // INCLUDED_COMPHELPER_ACCFLOWENUM_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx index 9a0bf9ea381d..34419ef28a5a 100644 --- a/include/svx/srchdlg.hxx +++ b/include/svx/srchdlg.hxx @@ -126,16 +126,11 @@ public: TransliterationFlags GetTransliterationFlags() const; - void SetDocWin(vcl::Window* pDocWin, SvxSearchCmd eCommand); - void SetSrchFlag( bool bSuccess ) { mbSuccess = bSuccess; } - bool GetSrchFlag() const { return mbSuccess; } void SetSaveToModule(bool b); void SetSearchLabel(const OUString& rStr); private: - bool mbSuccess; - SfxBindings& rBindings; bool bWriter; bool bSearch; diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 940b2b0fb7c5..5a9ee5a92f39 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -156,11 +156,6 @@ public: virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) = 0; virtual void set_accessible_relation_label_for(weld::Widget* pLabeled) = 0; - virtual void - add_extra_accessible_relation(const css::accessibility::AccessibleRelation& rRelation) - = 0; - virtual void clear_extra_accessible_relations() = 0; - virtual void set_tooltip_text(const OUString& rTip) = 0; virtual OUString get_tooltip_text() const = 0; diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index c0381b8c75c9..d23b34e397dd 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1250,10 +1250,6 @@ public: void SetAccessibleRelationMemberOf( vcl::Window* pMemberOf ); vcl::Window* GetAccessibleRelationMemberOf() const; - void AddExtraAccessibleRelation(const css::accessibility::AccessibleRelation &rRelation); - const std::vector& GetExtraAccessibleRelations() const; - void ClearExtraAccessibleRelations(); - // to avoid sending accessibility events in cases like closing dialogs // by default checks complete parent path bool IsAccessibilityEventsSuppressed( bool bTraverseParentPath = true ); diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index e10636b5e678..7ff928fded57 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -1609,13 +1608,6 @@ void SAL_CALL ScAccessibleDocument::selectionChanged( const lang::EventObject& / uno::Any SAL_CALL ScAccessibleDocument::queryInterface( uno::Type const & rType ) { - uno::Any aAnyTmp; - if(rType == cppu::UnoType::get()) - { - css::uno::Reference AccFromXShape = this; - aAnyTmp <<= AccFromXShape; - return aAnyTmp; - } uno::Any aAny (ScAccessibleDocumentImpl::queryInterface(rType)); return aAny.hasValue() ? aAny : ScAccessibleContextBase::queryInterface(rType); } @@ -2227,153 +2219,6 @@ uno::Any SAL_CALL ScAccessibleDocument::getExtendedAttributes() return anyAtrribute; } -css::uno::Sequence< css::uno::Any > ScAccessibleDocument::GetScAccFlowToSequence() -{ - if ( getAccessibleChildCount() ) - { - uno::Reference < XAccessible > xSCTableAcc = getAccessibleChild( 0 ); // table - if ( xSCTableAcc.is() ) - { - uno::Reference < XAccessibleSelection > xAccSelection( xSCTableAcc, uno::UNO_QUERY ); - sal_Int32 nSelCount = xAccSelection->getSelectedAccessibleChildCount(); - if( nSelCount ) - { - uno::Reference < XAccessible > xSel = xAccSelection->getSelectedAccessibleChild( 0 ); // selected cell - if ( xSel.is() ) - { - uno::Reference < XAccessibleContext > xSelContext( xSel->getAccessibleContext() ); - if ( xSelContext.is() ) - { - if ( xSelContext->getAccessibleRole() == AccessibleRole::TABLE_CELL ) - { - sal_Int32 nParaCount = 0; - uno::Sequence aSequence(nSelCount); - for ( sal_Int32 i = 0; i < nSelCount; i++ ) - { - xSel = xAccSelection->getSelectedAccessibleChild( i ) ; - if ( xSel.is() ) - { - xSelContext = xSel->getAccessibleContext(); - if ( xSelContext.is() ) - { - if ( xSelContext->getAccessibleRole() == AccessibleRole::TABLE_CELL ) - { - aSequence[nParaCount] <<= xSel; - nParaCount++; - } - } - } - } - aSequence.realloc(nParaCount); - return aSequence; - } - } - } - } - } - } - uno::Sequence aEmpty; - return aEmpty; -} - -css::uno::Sequence< css::uno::Any > - SAL_CALL ScAccessibleDocument::getAccFlowTo(const css::uno::Any& rAny, sal_Int32 nType) -{ - SolarMutexGuard g; - - if (nType == AccessibilityFlowTo::FORSPELLCHECKFLOWTO) - { - uno::Reference< css::drawing::XShape > xShape; - rAny >>= xShape; - if ( xShape.is() ) - { - uno::Reference < XAccessible > xAcc = mpChildrenShapes->GetAccessibleCaption(xShape); - uno::Reference < XAccessibleSelection > xAccSelection( xAcc, uno::UNO_QUERY ); - if ( xAccSelection.is() ) - { - if ( xAccSelection->getSelectedAccessibleChildCount() ) - { - uno::Reference < XAccessible > xSel = xAccSelection->getSelectedAccessibleChild( 0 ); - if ( xSel.is() ) - { - uno::Reference < XAccessibleContext > xSelContext( xSel->getAccessibleContext() ); - if ( xSelContext.is() ) - { - //if in sw we find the selected paragraph here - if ( xSelContext->getAccessibleRole() == AccessibleRole::PARAGRAPH ) - { - uno::Sequence aRet( 1 ); - aRet[0] <<= xSel; - return aRet; - } - } - } - } - } - } - else - { - if ( getSelectedAccessibleChildCount() ) - { - uno::Reference < XAccessible > xSel = getSelectedAccessibleChild( 0 ); - if ( xSel.is() ) - { - uno::Reference < XAccessibleContext > xSelContext( xSel->getAccessibleContext() ); - if ( xSelContext.is() ) - { - uno::Reference < XAccessibleSelection > xAccChildSelection( xSel, uno::UNO_QUERY ); - if ( xAccChildSelection.is() ) - { - if ( xAccChildSelection->getSelectedAccessibleChildCount() ) - { - uno::Reference < XAccessible > xChildSel = xAccChildSelection->getSelectedAccessibleChild( 0 ); - if ( xChildSel.is() ) - { - uno::Reference < css::accessibility::XAccessibleContext > xChildSelContext( xChildSel->getAccessibleContext() ); - if ( xChildSelContext.is() && - xChildSelContext->getAccessibleRole() == css::accessibility::AccessibleRole::PARAGRAPH ) - { - uno::Sequence aRet( 1 ); - aRet[0] <<= xChildSel; - return aRet; - } - } - } - } - } - } - } - } - } - else if (nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO_ITEM || nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO_RANGE) - { - bool bSuccess(false); - rAny >>= bSuccess; - if ( bSuccess ) - { - if (nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO_RANGE) - { - uno::Sequence< uno::Any> aSeq = GetScAccFlowToSequence(); - if ( aSeq.hasElements() ) - { - return aSeq; - } - } - - if( mpAccessibleSpreadsheet.is() ) - { - uno::Reference < XAccessible > xFindCellAcc = mpAccessibleSpreadsheet->GetActiveCell(); - // add xFindCellAcc to the return the Sequence - uno::Sequence< uno::Any> aSeq2(1); - aSeq2[0] <<= xFindCellAcc; - return aSeq2; - } - } - } - uno::Sequence< uno::Any> aEmpty; - return aEmpty; -} - sal_Int32 SAL_CALL ScAccessibleDocument::getForeground( ) { return sal_Int32(COL_BLACK); diff --git a/sc/source/ui/inc/AccessibleDocument.hxx b/sc/source/ui/inc/AccessibleDocument.hxx index 2cf9db6a5c89..be3875c195d1 100644 --- a/sc/source/ui/inc/AccessibleDocument.hxx +++ b/sc/source/ui/inc/AccessibleDocument.hxx @@ -26,7 +26,6 @@ #include #include #include -#include #include class ScTabViewShell; @@ -52,7 +51,6 @@ typedef cppu::ImplHelper3< css::accessibility::XAccessibleSelection, class ScAccessibleDocument : public ScAccessibleDocumentBase, public ScAccessibleDocumentImpl, - public css::accessibility::XAccessibleGetAccFlowTo, public accessibility::IAccessibleViewForwarder { public: @@ -257,11 +255,8 @@ private: public: ScDocument *GetDocument() const ; ScAddress GetCurCellAddress() const; - //===== XAccessibleGetAccFromXShape ============================================ - css::uno::Sequence< css::uno::Any > - SAL_CALL getAccFlowTo(const css::uno::Any& rAny, sal_Int32 nType) override; - virtual sal_Int32 SAL_CALL getForeground( ) override; + virtual sal_Int32 SAL_CALL getForeground( ) override; virtual sal_Int32 SAL_CALL getBackground( ) override; }; diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index fece06e7d8ec..fac15994f2ba 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -230,26 +230,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq ) const SvxSearchItem* pSearchItem = static_cast(pItem); ScGlobal::SetSearchItem( *pSearchItem ); - bool bSuccess = SearchAndReplace( pSearchItem, true, rReq.IsAPI() ); - SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow( - SvxSearchDialogWrapper::GetChildWindowId()); - if (pChildWindow) - { - SvxSearchDialog* pSearchDlg = static_cast(pChildWindow->GetController().get()); - if( pSearchDlg ) - { - ScTabView* pTabView = GetViewData().GetView(); - if( pTabView ) - { - vcl::Window* pWin = pTabView->GetActiveWin(); - if( pWin ) - { - pSearchDlg->SetDocWin( pWin, pSearchItem->GetCommand() ); - pSearchDlg->SetSrchFlag( bSuccess ); - } - } - } - } + SearchAndReplace( pSearchItem, true, rReq.IsAPI() ); rReq.Done(); } } @@ -301,25 +282,6 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq ) rReq.IsAPI() ? SfxCallMode::API|SfxCallMode::SYNCHRON : SfxCallMode::RECORD, { &aSearchItem }); - SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow( - SvxSearchDialogWrapper::GetChildWindowId()); - if (pChildWindow) - { - SvxSearchDialog* pSearchDlg = static_cast(pChildWindow->GetController().get()); - if( pSearchDlg ) - { - ScTabView* pTabView = GetViewData().GetView(); - if( pTabView ) - { - vcl::Window* pWin = pTabView->GetActiveWin(); - if( pWin ) - { - pSearchDlg->SetDocWin( pWin, aSearchItem.GetCommand() ); - pSearchDlg->SetSrchFlag(false); - } - } - } - } } else { diff --git a/sd/IwyuFilter_sd.yaml b/sd/IwyuFilter_sd.yaml index d69c951a8bbd..4681b29a8259 100644 --- a/sd/IwyuFilter_sd.yaml +++ b/sd/IwyuFilter_sd.yaml @@ -146,7 +146,6 @@ blacklist: sd/source/ui/inc/AccessibleDocumentViewBase.hxx: # base class has to be a complete type - com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp - - com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp - com/sun/star/awt/XFocusListener.hpp - com/sun/star/awt/XWindowListener.hpp - com/sun/star/beans/XPropertyChangeListener.hpp diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx index d0fc351dee60..77d88ffb1831 100644 --- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx +++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx @@ -381,7 +381,6 @@ uno::Any SAL_CALL static_cast(this), static_cast(this) ,static_cast(this) - ,static_cast(this) ); return aReturn; } @@ -764,14 +763,6 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes() return anyAtrribute; } -css::uno::Sequence< css::uno::Any > - SAL_CALL AccessibleDocumentViewBase::getAccFlowTo(const css::uno::Any&, sal_Int32 ) -{ - css::uno::Sequence< uno::Any> aRet; - - return aRet; -} - sal_Int32 SAL_CALL AccessibleDocumentViewBase::getForeground( ) { return sal_Int32(COL_BLACK); diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx index 2e295a0eaf56..258aa4cc0bfa 100644 --- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx +++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -737,156 +736,6 @@ void SAL_CALL AccessibleDrawDocumentView::disposing() AccessibleDocumentViewBase::disposing (); } -css::uno::Sequence< css::uno::Any > - SAL_CALL AccessibleDrawDocumentView::getAccFlowTo(const css::uno::Any& rAny, sal_Int32 nType) -{ - SolarMutexGuard g; - - if (nType == AccessibilityFlowTo::FORSPELLCHECKFLOWTO) - { - uno::Reference< css::drawing::XShape > xShape; - rAny >>= xShape; - if ( mpChildrenManager && xShape.is() ) - { - uno::Reference < XAccessible > xAcc = mpChildrenManager->GetChild(xShape); - uno::Reference < XAccessibleSelection > xAccSelection( xAcc, uno::UNO_QUERY ); - if ( xAccSelection.is() ) - { - if ( xAccSelection->getSelectedAccessibleChildCount() ) - { - uno::Reference < XAccessible > xSel = xAccSelection->getSelectedAccessibleChild( 0 ); - if ( xSel.is() ) - { - uno::Reference < XAccessibleContext > xSelContext( xSel->getAccessibleContext() ); - if ( xSelContext.is() ) - { - //if in sw we find the selected paragraph here - if ( xSelContext->getAccessibleRole() == AccessibleRole::PARAGRAPH ) - { - uno::Sequence aRet( 1 ); - aRet[0] <<= xSel; - return aRet; - } - } - } - } - } - uno::Reference xPara = GetSelAccContextInTable(); - if ( xPara.is() ) - { - uno::Sequence aRet( 1 ); - aRet[0] <<= xPara; - return aRet; - } - } - else - { - goto Rt; - } - } - else if (nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO_ITEM || nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO_RANGE) - { - sal_Int32 nChildCount = getSelectedAccessibleChildCount(); - if ( nChildCount ) - { - uno::Reference < XAccessible > xSel = getSelectedAccessibleChild( 0 ); - if ( xSel.is() ) - { - uno::Reference < XAccessibleSelection > xAccChildSelection( xSel, uno::UNO_QUERY ); - if ( xAccChildSelection.is() ) - { - if ( xAccChildSelection->getSelectedAccessibleChildCount() ) - { - uno::Reference < XAccessible > xChildSel = xAccChildSelection->getSelectedAccessibleChild( 0 ); - if ( xChildSel.is() ) - { - uno::Reference < XAccessibleContext > xChildSelContext( xChildSel->getAccessibleContext() ); - if ( xChildSelContext.is() && - xChildSelContext->getAccessibleRole() == AccessibleRole::PARAGRAPH ) - { - uno::Sequence aRet( 1 ); - aRet[0] <<= xChildSel; - return aRet; - } - } - } - } - } - } - else - { - uno::Reference xPara = GetSelAccContextInTable(); - if ( xPara.is() ) - { - uno::Sequence aRet( 1 ); - aRet[0] <<= xPara; - return aRet; - } - } - } - -Rt: - css::uno::Sequence< uno::Any> aRet; - return aRet; -} -uno::Reference AccessibleDrawDocumentView::GetSelAccContextInTable() -{ - uno::Reference xRet; - sal_Int32 nCount = mpChildrenManager ? mpChildrenManager->GetChildCount() : 0; - if ( nCount ) - { - for ( sal_Int32 i = 0; i < nCount; i++ ) - { - try - { - uno::Reference xObj = mpChildrenManager->GetChild(i); - if ( xObj.is() ) - { - uno::Reference xObjContext( xObj, uno::UNO_QUERY ); - if ( xObjContext.is() && xObjContext->getAccessibleRole() == AccessibleRole::TABLE ) - { - uno::Reference xObjSelection( xObj, uno::UNO_QUERY ); - if ( xObjSelection.is() && xObjSelection->getSelectedAccessibleChildCount() ) - { - uno::Reference xCell = xObjSelection->getSelectedAccessibleChild(0); - if ( xCell.is() ) - { - uno::Reference xCellSel( xCell, uno::UNO_QUERY ); - if ( xCellSel.is() && xCellSel->getSelectedAccessibleChildCount() ) - { - uno::Reference xPara = xCellSel->getSelectedAccessibleChild( 0 ); - if ( xPara.is() ) - { - uno::Reference xParaContext( xPara, uno::UNO_QUERY ); - if ( xParaContext.is() && - xParaContext->getAccessibleRole() == AccessibleRole::PARAGRAPH ) - { - xRet = xPara; - return xRet; - } - } - } - } - } - } - } - } - catch (const lang::IndexOutOfBoundsException&) - { - uno::Reference xEmpty; - return xEmpty; - } - catch (const uno::RuntimeException&) - { - uno::Reference xEmpty; - return xEmpty; - } - } - } - - return xRet; -} - void AccessibleDrawDocumentView::UpdateAccessibleName() { OUString sNewName (CreateAccessibleName() + ": "); diff --git a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx index ee2acf119ce4..b29cc9533757 100644 --- a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx +++ b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx @@ -33,7 +33,6 @@ #include #include -#include #include "Window.hxx" @@ -87,8 +86,7 @@ class AccessibleDocumentViewBase public css::beans::XPropertyChangeListener, public css::awt::XWindowListener, public css::awt::XFocusListener, - public css::accessibility::XAccessibleExtendedAttributes, - public css::accessibility::XAccessibleGetAccFlowTo + public css::accessibility::XAccessibleExtendedAttributes { public: //===== internal ======================================================== @@ -313,9 +311,6 @@ protected: */ void SetAccessibleOLEObject ( const css::uno::Reference& xOLEObject); - //===== XAccessibleGetAccFromXShape ============================================ - css::uno::Sequence< css::uno::Any > - SAL_CALL getAccFlowTo(const css::uno::Any& rAny, sal_Int32 nType) override; public: void SwitchViewActivated() { Activated(); } diff --git a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx index fd8b42f7161f..15097459bf76 100644 --- a/sd/source/ui/inc/AccessibleDrawDocumentView.hxx +++ b/sd/source/ui/inc/AccessibleDrawDocumentView.hxx @@ -158,12 +158,6 @@ private: virtual void impl_dispose() override; - //===== XAccessibleGetAccFromXShape ============================================ - css::uno::Sequence< css::uno::Any > - SAL_CALL getAccFlowTo(const css::uno::Any& rAny, sal_Int32 nType) override; - css::uno::Reference< css::accessibility::XAccessible > - GetSelAccContextInTable(); - void UpdateAccessibleName(); }; diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index d3bd66724c7b..2652c14879c1 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -483,17 +483,6 @@ bool SdOutliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) } mnStartPageIndex = sal_uInt16(-1); } - - SfxChildWindow *pChildWin = - SfxViewFrame::Current()->GetChildWindow( - SvxSearchDialogWrapper::GetChildWindowId()); - if (pChildWin) - { - SvxSearchDialog* pSearchDlg = - static_cast(pChildWin->GetController().get()); - pSearchDlg->SetDocWin( pViewShell->GetActiveWindow(), nCommand ); - pSearchDlg->SetSrchFlag(false); - } } mpDrawDocument->GetDocSh()->SetWaitCursor( false ); diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 5f2b426e759d..6d98fd4ad8df 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -35,9 +35,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -47,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -260,7 +256,6 @@ void SearchAttrItemList::Remove(size_t nPos) SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind) : SfxModelessDialogController(&rBind, pChildWin, pParent, "svx/ui/findreplacedialog.ui", "FindReplaceDialog") - , mbSuccess(false) , rBindings(rBind) , bWriter(false) , bSearch(true) @@ -2289,58 +2284,6 @@ void SvxSearchDialog::SaveToModule_Impl() rBindings.GetDispatcher()->Execute( SID_SEARCH_ITEM, SfxCallMode::SLOT, ppArgs ); } -void SvxSearchDialog::SetDocWin(vcl::Window* pDocWin, SvxSearchCmd eCommand) -{ - m_xDialog->clear_extra_accessible_relations(); - - if (!pDocWin) - return; - - Reference xDocAcc = pDocWin->GetAccessible(); - if (!xDocAcc.is()) - { - return; - } - Reference xGetAccFlowTo(xDocAcc, UNO_QUERY); - if (!xGetAccFlowTo.is()) - { - return; - } - - /* tdf#128313 FlowTo tries to set an a11y relation between the search dialog - and its results. But for "find/replace" within a calc column we don't - want to return the entire column as the result, we want the current cell. - - But with search/all we do want the new multi-cellselection as the result. - */ - AccessibilityFlowTo eFlowTo(AccessibilityFlowTo::FORFINDREPLACEFLOWTO_ITEM); - switch (eCommand) - { - case SvxSearchCmd::FIND: - case SvxSearchCmd::REPLACE: - eFlowTo = AccessibilityFlowTo::FORFINDREPLACEFLOWTO_ITEM; - break; - case SvxSearchCmd::FIND_ALL: - case SvxSearchCmd::REPLACE_ALL: - eFlowTo = AccessibilityFlowTo::FORFINDREPLACEFLOWTO_RANGE; - break; - } - uno::Sequence aAnySeq = xGetAccFlowTo->getAccFlowTo(Any(GetSrchFlag()), eFlowTo); - - sal_Int32 nLen = aAnySeq.getLength(); - if (nLen) - { - uno::Sequence> aSequence(nLen); - std::transform(aAnySeq.begin(), aAnySeq.end(), aSequence.begin(), - [](const uno::Any& rAny) -> uno::Reference < css::accessibility::XAccessible > { - uno::Reference < css::accessibility::XAccessible > xAcc; - rAny >>= xAcc; - return xAcc; - }); - m_xDialog->add_extra_accessible_relation(css::accessibility::AccessibleRelation(css::accessibility::AccessibleRelationType::CONTENT_FLOWS_TO, aSequence)); - } -} - short SvxSearchDialog::executeSubDialog(VclAbstractDialog * dialog) { assert(!m_executingSubDialog); comphelper::ScopeGuard g([this] { m_executingSubDialog = false; }); diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index d62e1878582b..94989d2fae0a 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -450,11 +449,6 @@ uno::Any SwAccessibleDocument::queryInterface( uno::Reference aAttribute = this; aRet <<= aAttribute; } - else if(rType == cppu::UnoType::get()) - { - uno::Reference AccFlowTo = this; - aRet <<= AccFlowTo; - } else aRet = SwAccessibleContext::queryInterface( rType ); return aRet; @@ -722,119 +716,4 @@ sal_Int32 SAL_CALL SwAccessibleDocument::getBackground() return sal_Int32(SW_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor); } -css::uno::Sequence< css::uno::Any > - SAL_CALL SwAccessibleDocument::getAccFlowTo(const css::uno::Any& rAny, sal_Int32 nType) -{ - SolarMutexGuard g; - - SwAccessibleMap* pAccMap = GetMap(); - if ( !pAccMap ) - { - return uno::Sequence< uno::Any >(); - } - - if (nType == AccessibilityFlowTo::FORSPELLCHECKFLOWTO) - { - uno::Reference< css::drawing::XShape > xShape; - rAny >>= xShape; - if( xShape.is() ) - { - SdrObject* pObj = GetSdrObjectFromXShape(xShape); - if( pObj ) - { - uno::Reference xAcc = pAccMap->GetContext(pObj, this, false); - uno::Reference < XAccessibleSelection > xAccSelection( xAcc, uno::UNO_QUERY ); - if ( xAccSelection.is() ) - { - try - { - if ( xAccSelection->getSelectedAccessibleChildCount() ) - { - uno::Reference < XAccessible > xSel = xAccSelection->getSelectedAccessibleChild( 0 ); - if ( xSel.is() ) - { - uno::Reference < XAccessibleContext > xSelContext( xSel->getAccessibleContext() ); - if ( xSelContext.is() ) - { - //if in sw we find the selected paragraph here - if ( xSelContext->getAccessibleRole() == AccessibleRole::PARAGRAPH ) - { - uno::Sequence aRet( 1 ); - aRet[0] <<= xSel; - return aRet; - } - } - } - } - } - catch ( const css::lang::IndexOutOfBoundsException& ) - { - return uno::Sequence< uno::Any >(); - } - //end of try...catch - } - } - } - else - { - uno::Reference< XAccessible > xAcc = pAccMap->GetCursorContext(); - SwAccessibleContext *pAccImpl = static_cast< SwAccessibleContext *>( xAcc.get() ); - if ( pAccImpl && pAccImpl->getAccessibleRole() == AccessibleRole::PARAGRAPH ) - { - uno::Sequence< uno::Any > aRet(1); - aRet[0] <<= xAcc; - return aRet; - } - } - } - else if (nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO_ITEM || nType == AccessibilityFlowTo::FORFINDREPLACEFLOWTO_RANGE) - { - SwCursorShell* pCursorShell = GetCursorShell(); - if ( pCursorShell ) - { - SwPaM *_pStartCursor = pCursorShell->GetCursor(), *_pStartCursor2 = _pStartCursor; - std::set vFrameList; - do - { - if ( _pStartCursor && _pStartCursor->HasMark() ) - { - SwContentNode* pContentNode = _pStartCursor->GetContentNode(); - SwFrame *const pFrame = pContentNode - ? pContentNode->getLayoutFrame(pCursorShell->GetLayout(), _pStartCursor->GetPoint()) - : nullptr; - if ( pFrame ) - { - vFrameList.insert( pFrame ); - } - } - } - - while( _pStartCursor && ( (_pStartCursor = _pStartCursor->GetNext()) != _pStartCursor2) ); - - if ( !vFrameList.empty() ) - { - uno::Sequence< uno::Any > aRet(vFrameList.size()); - sal_Int32 nIndex = 0; - for ( const auto& rpFrame : vFrameList ) - { - uno::Reference< XAccessible > xAcc = pAccMap->GetContext(rpFrame, false); - if ( xAcc.is() ) - { - SwAccessibleContext *pAccImpl = static_cast< SwAccessibleContext *>( xAcc.get() ); - if ( pAccImpl && pAccImpl->getAccessibleRole() == AccessibleRole::PARAGRAPH ) - { - aRet[nIndex] <<= xAcc; - } - } - nIndex++; - } - aRet.realloc(nIndex); - return aRet; - } - } - } - - return uno::Sequence< uno::Any >(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/access/accdoc.hxx b/sw/source/core/access/accdoc.hxx index 6f117c825b7e..e3c903e9da93 100644 --- a/sw/source/core/access/accdoc.hxx +++ b/sw/source/core/access/accdoc.hxx @@ -23,7 +23,6 @@ #include "acccontext.hxx" #include #include -#include #include "accselectionhelper.hxx" // base class for SwAccessibleDocument (in this same header file) and @@ -92,8 +91,7 @@ public: */ class SwAccessibleDocument : public SwAccessibleDocumentBase, public css::accessibility::XAccessibleSelection, - public css::accessibility::XAccessibleExtendedAttributes, - public css::accessibility::XAccessibleGetAccFlowTo + public css::accessibility::XAccessibleExtendedAttributes { // Implementation for XAccessibleSelection interface SwAccessibleSelectionHelper maSelectionHelper; @@ -170,10 +168,6 @@ public: // XAccessibleComponent sal_Int32 SAL_CALL getBackground() override; - - // XAccessibleGetAccFlowTo - css::uno::Sequence< css::uno::Any > - SAL_CALL getAccFlowTo(const css::uno::Any& rAny, sal_Int32 nType) override; }; #endif diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index 615c1288052b..029ed7774a90 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -247,16 +247,6 @@ void SwView::ExecSearch(SfxRequest& rReq) lcl_emitSearchResultCallbacks(s_pSrchItem, m_pWrtShell.get(), /* bHighlightAll = */ false); } rReq.SetReturnValue(SfxBoolItem(nSlot, bRet)); -#if HAVE_FEATURE_DESKTOP - { - pSrchDlg = GetSearchDialog(); - if (pSrchDlg) - { - pSrchDlg->SetDocWin(m_pEditWin, eCommand); - pSrchDlg->SetSrchFlag(false); - } - } -#endif } break; case SvxSearchCmd::FIND_ALL: @@ -280,16 +270,6 @@ void SwView::ExecSearch(SfxRequest& rReq) else if (comphelper::LibreOfficeKit::isActive()) lcl_emitSearchResultCallbacks(s_pSrchItem, m_pWrtShell.get(), /* bHighlightAll = */ true); rReq.SetReturnValue(SfxBoolItem(nSlot, bRet)); -#if HAVE_FEATURE_DESKTOP - { - pSrchDlg = GetSearchDialog(); - if (pSrchDlg) - { - pSrchDlg->SetDocWin(m_pEditWin, eCommand); - pSrchDlg->SetSrchFlag(false); - } - } -#endif } break; case SvxSearchCmd::REPLACE: @@ -338,16 +318,6 @@ void SwView::ExecSearch(SfxRequest& rReq) s_pSrchItem->SetCommand( nOldCmd ); rReq.SetReturnValue(SfxBoolItem(nSlot, bRet)); } -#if HAVE_FEATURE_DESKTOP - { - pSrchDlg = GetSearchDialog(); - if (pSrchDlg) - { - pSrchDlg->SetDocWin(m_pEditWin, eCommand); - pSrchDlg->SetSrchFlag(false); - } - } -#endif break; case SvxSearchCmd::REPLACE_ALL: @@ -407,14 +377,6 @@ void SwView::ExecSearch(SfxRequest& rReq) SvxSearchDialogWrapper::SetSearchLabel(sText); } } -#if HAVE_FEATURE_DESKTOP - pSrchDlg = GetSearchDialog(); - if (pSrchDlg) - { - pSrchDlg->SetDocWin(m_pEditWin, eCommand); - pSrchDlg->SetSrchFlag(false); - } -#endif break; } diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index eeb01bf62dac..675aa9c3ba31 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -374,9 +374,6 @@ void VCLXAccessibleComponent::FillAccessibleRelationSet( utl::AccessibleRelation uno::Sequence< uno::Reference< uno::XInterface > > aSequence { pMemberOf->GetAccessible() }; rRelationSet.AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) ); } - - for (const auto& rExtraRelation : pWindow->GetExtraAccessibleRelations()) - rRelationSet.AddRelation(rExtraRelation); } } diff --git a/vcl/inc/window.h b/vcl/inc/window.h index a328abf75c0e..89c0ff8cf3b9 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -280,7 +280,6 @@ public: css::uno::Reference< css::accessibility::XAccessible > mxAccessible; std::shared_ptr< VclSizeGroup > m_xSizeGroup; std::vector> m_aMnemonicLabels; - std::vector m_aExtraAccessibleRelations; std::unique_ptr mpAccessibleInfos; VCLXWindow* mpVCLXWindow; vcl::Region maWinRegion; //< region to 'shape' the VCL window (frame coordinates) diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 9bfeb9997041..d1e97e39ab7f 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -546,16 +546,6 @@ public: m_xWidget->SetAccessibleRelationLabelFor(pAtkLabeled); } - virtual void add_extra_accessible_relation(const css::accessibility::AccessibleRelation &rRelation) override - { - m_xWidget->AddExtraAccessibleRelation(rRelation); - } - - virtual void clear_extra_accessible_relations() override - { - m_xWidget->ClearExtraAccessibleRelations(); - } - virtual void set_tooltip_text(const OUString& rTip) override { m_xWidget->SetQuickHelpText(rTip); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 9183ded20184..aa791975e765 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1959,21 +1959,6 @@ const std::vector >& Window::list_mnemonic_labels() const return mpWindowImpl->m_aMnemonicLabels; } -void Window::AddExtraAccessibleRelation(const css::accessibility::AccessibleRelation &rRelation) -{ - mpWindowImpl->m_aExtraAccessibleRelations.push_back(rRelation); -} - -const std::vector& Window::GetExtraAccessibleRelations() const -{ - return mpWindowImpl->m_aExtraAccessibleRelations; -} - -void Window::ClearExtraAccessibleRelations() -{ - mpWindowImpl->m_aExtraAccessibleRelations.clear(); -} - } /* namespace vcl */ void DrawFocusRect(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 820828c3e796..5537ce9c5887 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -1918,7 +1918,7 @@ private: gulong m_nDragLeaveSignalId; rtl::Reference m_xDropTarget; - std::vector m_aExtraAtkRelations; + rtl::Reference m_xDragSource; static void signalSizeAllocate(GtkWidget*, GdkRectangle* allocation, gpointer widget) { @@ -2508,33 +2508,6 @@ public: g_object_unref(pRelationSet); } - virtual void add_extra_accessible_relation(const css::accessibility::AccessibleRelation &rRelation) override - { - AtkObject* pAtkObject = gtk_widget_get_accessible(m_pWidget); - if (!pAtkObject) - return; - - AtkRelationSet *pRelationSet = atk_object_ref_relation_set(pAtkObject); - AtkRelation *pRel = atk_object_wrapper_relation_new(rRelation); - m_aExtraAtkRelations.push_back(pRel); - atk_relation_set_add(pRelationSet, pRel); - g_object_unref(pRel); - g_object_unref(pRelationSet); - } - - virtual void clear_extra_accessible_relations() override - { - AtkObject* pAtkObject = gtk_widget_get_accessible(m_pWidget); - if (!pAtkObject) - return; - - AtkRelationSet *pRelationSet = atk_object_ref_relation_set(pAtkObject); - for (AtkRelation* pRel : m_aExtraAtkRelations) - atk_relation_set_remove(pRelationSet, pRel); - m_aExtraAtkRelations.clear(); - g_object_unref(pRelationSet); - } - virtual bool get_extents_relative_to(weld::Widget& rRelative, int& x, int &y, int& width, int &height) override { //for toplevel windows this is sadly futile under wayland, so we can't tell where a dialog is in order to allow -- cgit v1.2.3