diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-27 17:11:34 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-06-23 12:11:48 +0200 |
commit | bfab61b8004cacf0b853b76ebfb3d46638cac0d7 (patch) | |
tree | 53a62e43c836a50c6d1b4edba76b5c82cc88b1c4 /sw | |
parent | 5aea21c0f92be5ac2fc1bd510723c1de3f01f058 (diff) |
Resolves: tdf#133411 drop CONTENT_FLOWS_TO from dialog to search results
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 <caolanm@redhat.com>
(cherry picked from commit 0b94169d820482434dc98a37c3c1633ca46fd0dc)
Change-Id: I2685e480d2d15220be0bddbc83baad3992e7d5d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95014
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96919
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/access/accdoc.cxx | 121 | ||||
-rw-r--r-- | sw/source/core/access/accdoc.hxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewsrch.cxx | 38 |
3 files changed, 1 insertions, 166 deletions
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 <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> -#include <comphelper/accflowenum.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <cppuhelper/typeprovider.hxx> #include <vcl/svapp.hxx> @@ -450,11 +449,6 @@ uno::Any SwAccessibleDocument::queryInterface( uno::Reference<XAccessibleExtendedAttributes> aAttribute = this; aRet <<= aAttribute; } - else if(rType == cppu::UnoType<XAccessibleGetAccFlowTo>::get()) - { - uno::Reference<XAccessibleGetAccFlowTo> 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<XAccessible> 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<uno::Any> 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<SwFrame*> 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 <com/sun/star/accessibility/XAccessibleSelection.hpp> #include <com/sun/star/accessibility/XAccessibleExtendedAttributes.hpp> -#include <com/sun/star/accessibility/XAccessibleGetAccFlowTo.hpp> #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; } |