svx/source/tbxctrls/tbunosearchcontrollers.cxx |   30 ++++++++++---------------
 1 file changed, 13 insertions(+), 17 deletions(-)

New commits:
commit bb8641f649cb53a4afe0653d641bd9907e2dfa57
Author: Julien Nabet <serval2...@yahoo.fr>
Date:   Mon Aug 28 18:42:50 2017 +0200

    tdf#111818: add SearchItem.AlgorithmType2 option
    
    and use InitPropertySequence
    
    Change-Id: I1e7b6498828fc19c46c51501f1908dc830d8d826
    Reviewed-on: https://gerrit.libreoffice.org/41654
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    (cherry picked from commit 97cd8e4d64632bb65445cb2f395b1385a0a2a13b)
    Reviewed-on: https://gerrit.libreoffice.org/41782
    Reviewed-by: Eike Rathke <er...@redhat.com>

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 );
     }
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to