summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-10-23 14:58:43 +0100
committerMichael Stahl <michael.stahl@cib.de>2019-10-24 14:15:53 +0200
commit66397e67829f2f502b9b6799dab16fa9a5390020 (patch)
treec7edcce0d5372a7ebed71c538bfb2d713c7bdabd /svx
parentca477f5e0e3b8cd28f6beaf96a20e70064d73ea3 (diff)
Resolves: tdf#128313 disambiguate flow-to search results
for a11y between find/replace where our result is a single thing, and find-all/replace-all where the result is potentially many things, which allows that searching in a selected calc column will flow-to the current cell, not the entire ~infinite set of cells in the column plus commit... put together the 'magic' flow-to constants as a side note, there's no actual use of FORSPELLCHECKFLOWTO anywhere that I can see Change-Id: Ib3e56fceb90d869f157427f090cdffe986a5a588 Reviewed-on: https://gerrit.libreoffice.org/81397 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/srchdlg.cxx24
1 files changed, 21 insertions, 3 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 48dbc88ad860..8952e347c7cb 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
+#include <comphelper/accflowenum.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/scopeguard.hxx>
#include <svl/itempool.hxx>
@@ -2288,7 +2289,7 @@ void SvxSearchDialog::SaveToModule_Impl()
rBindings.GetDispatcher()->Execute( SID_SEARCH_ITEM, SfxCallMode::SLOT, ppArgs );
}
-void SvxSearchDialog::SetDocWin(vcl::Window* pDocWin)
+void SvxSearchDialog::SetDocWin(vcl::Window* pDocWin, SvxSearchCmd eCommand)
{
m_xDialog->clear_extra_accessible_relations();
@@ -2306,8 +2307,25 @@ void SvxSearchDialog::SetDocWin(vcl::Window* pDocWin)
return;
}
- const sal_Int32 FORFINDREPLACEFLOWTO = 2;
- uno::Sequence<uno::Any> aAnySeq = xGetAccFlowTo->getAccFlowTo(Any(GetSrchFlag()), FORFINDREPLACEFLOWTO);
+ /* 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<uno::Any> aAnySeq = xGetAccFlowTo->getAccFlowTo(Any(GetSrchFlag()), eFlowTo);
sal_Int32 nLen = aAnySeq.getLength();
if (nLen)