summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-08-28 18:42:50 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-08-28 22:22:09 +0200
commit97cd8e4d64632bb65445cb2f395b1385a0a2a13b (patch)
tree800d7272127ca7e377c7f611c21a8c9f2ed9b179 /svx/source/tbxctrls
parentbcbada5d9f2411739c83610f2e9fd2acb112c3e9 (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>
Diffstat (limited to 'svx/source/tbxctrls')
-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 98f27571585e..f39b57373ce9 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>
@@ -111,14 +112,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)
@@ -127,21 +120,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 );
}
}