[Libreoffice-commits] core.git: svx/source

Julien Nabet serval2412 at yahoo.fr
Mon Aug 28 20:26:20 UTC 2017


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

New commits:
commit 97cd8e4d64632bb65445cb2f395b1385a0a2a13b
Author: Julien Nabet <serval2412 at 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 <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

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 );
     }
 }
 


More information about the Libreoffice-commits mailing list