summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-08-28 18:42:50 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-09-01 13:52:06 +0200
commitbb8641f649cb53a4afe0653d641bd9907e2dfa57 (patch)
tree2fc3eca5a88ab4f98ef72126f254cf61cf018a1a
parent52f0d67e9756d81032c4b73fbb3e0aefe053e41d (diff)
tdf#111818: add SearchItem.AlgorithmType2 option
and use InitPropertySequence Change-Id: I1e7b6498828fc19c46c51501f1908dc830d8d826 Reviewed-on: https://gerrit.libreoffice.org/41654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 97cd8e4d64632bb65445cb2f395b1385a0a2a13b) Reviewed-on: https://gerrit.libreoffice.org/41782 Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx30
1 files changed, 13 insertions, 17 deletions
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 90d104ae5e14..cdf087654b4b 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -28,6 +28,7 @@
#include <svx/dialmgr.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
@@ -113,14 +114,6 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext
}
}
- css::uno::Sequence< css::beans::PropertyValue > lArgs(7);
- lArgs[0].Name = "SearchItem.SearchString";
- lArgs[0].Value <<= sFindText;
- lArgs[1].Name = "SearchItem.Backward";
- lArgs[1].Value <<= aSearchBackwards;
- lArgs[2].Name = "SearchItem.SearchFlags";
- lArgs[2].Value <<= (sal_Int32)0;
- lArgs[3].Name = "SearchItem.TransliterateFlags";
SvtCTLOptions aCTLOptions;
TransliterationFlags nFlags = TransliterationFlags::NONE;
if (!aMatchCase)
@@ -129,21 +122,24 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext
nFlags |= TransliterationFlags::IGNORE_DIACRITICS_CTL;
if (aCTLOptions.IsCTLFontEnabled())
nFlags |= TransliterationFlags::IGNORE_KASHIDA_CTL;
- lArgs[3].Value <<= (sal_Int32)nFlags;
- lArgs[4].Name = "SearchItem.Command";
- lArgs[4].Value <<= (sal_Int16)(aFindAll ?
- SvxSearchCmd::FIND_ALL : SvxSearchCmd::FIND );
- lArgs[5].Name = "SearchItem.AlgorithmType";
- lArgs[5].Value <<= (sal_Int16)0; // 0 == SearchAlgorithms_ABSOLUTE
- lArgs[6].Name = "SearchItem.SearchFormatted";
- lArgs[6].Value <<= bSearchFormatted;
+
+ auto aArgs( comphelper::InitPropertySequence( {
+ { "SearchItem.SearchString", css::uno::makeAny( sFindText ) },
+ { "SearchItem.Backward", css::uno::makeAny( aSearchBackwards ) },
+ { "SearchItem.SearchFlags", css::uno::makeAny( (sal_Int32)0 ) },
+ { "SearchItem.TransliterateFlags", css::uno::makeAny( (sal_Int32)nFlags ) },
+ { "SearchItem.Command", css::uno::makeAny( (sal_Int16)(aFindAll ?SvxSearchCmd::FIND_ALL : SvxSearchCmd::FIND ) ) },
+ { "SearchItem.AlgorithmType", css::uno::makeAny( (sal_Int16)0 ) }, // 0 == SearchAlgorithms_ABSOLUTE
+ { "SearchItem.AlgorithmType2", css::uno::makeAny( (sal_Int16)1 ) }, // 1 == SearchAlgorithms2_ABSOLUTE
+ { "SearchItem.SearchFormatted", css::uno::makeAny( bSearchFormatted ) }
+ } ) );
css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, css::uno::UNO_QUERY);
if ( xDispatchProvider.is() )
{
css::uno::Reference< css::frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch( aURL, OUString(), 0 );
if ( xDispatch.is() && !aURL.Complete.isEmpty() )
- xDispatch->dispatch( aURL, lArgs );
+ xDispatch->dispatch( aURL, aArgs );
}
}