2019-10-20

84: Calc '.uno:ExecuteSearch'

<The previous article in this series | The table of contents of this series | The next article in this series>

The URL, the description, the arguments, the result information, and the related information (which can be gotten from the command execution) of the UNO dispatch command, '.uno:ExecuteSearch', are described.

Topics


About: UNO (Universal Network Objects)
About: LibreOffice
About: Apache OpenOffice

The table of contents of this article


Starting Context


  • The reader has knowledge of what 'UNO dispatch command' is and how to call one (if the URL and the arguments of the command are clear).

Target Context


  • The reader will know the specifications of the UNO dispatch command.

Orientation


There are some articles that explain how to execute any UNO dispatch commands and get the whole available information from the execution, in Java, in C++, in C#, in Python, and in LibreOffice or Apache OpenOffice Basic.

There are the list for the application foundations, the list for Writer, and the list for Calc of the UNO dispatch commands listed so far in this series.


Main Body


1: The Specifications


URL: .uno:ExecuteSearch

Description: This command searches the current spread sheet or the spread sheets document for the specified string or with the specified regular expression or the specified glob expression or for the specified cell style. The search can be done for the next occurrence or for all the occurrences. Some criteria like case sensitivity, similarity degree, etc. can be specified. The found strings can be optionally replaced with the specified replacing string; the style of the found cells by cell style search can be optionally replaced with the specified replacing style.

Arguments (the types are UNO datum types):

NameTypeValue
SearchItem.StyleFamilyshortSeems not be used
SearchItem.CellTypeshortThe contents against which the search is performed: 0 -> formulas and non-formula cell values, 1 -> cell values, 2 -> comments
SearchItem.RowDirectionbooleanThe search direction: true -> row-wise, false -> column-wise; not valid when the search is a cell style search
SearchItem.AllTablesbooleanWhether all the spread sheets are searched or not: true -> all the spread sheets are searched, false -> only the current spread sheet is searched
SearchItem.SearchFilteredbooleanWhether also the filtered-out cells are searched or not: true -> searched, false -> not searched
SearchItem.BackwardbooleanWhether the search is performed backward: true -> performed backward, false -> performed forward
SearchItem.PatternbooleanWhether the search is a cell style search or not: true -> a cell style search, false -> a strings search
SearchItem.ContentbooleanSeems not be used
SearchItem.AsianOptionsbooleanWhether the search is performed for 'sounds-like' strings in Japanese or not: true -> performed for 'sounds-like' strings, false -> not performed for 'sounds-like' strings
SearchItem.AlgorithmTypeshortDeprecated; use SearchItem.AlgorithmType2 instead
SearchItem.SearchFlagslongThe sum of these flags: 16 -> search for only cells whose entire contents match the search expression, 2048 -> search only the selected cells, 4096 -> seems not be used, 65536 -> for similarity search (Weighted Levenshtein Distance search), relax the similarity criteria ("the search is also successful if the combined pool for insertions and deletions is below a doubled calculated limit and replacements are treated differently; additionally, swapped characters are counted as one replacement" according to the reference document, whatever that means), 1048576 -> for glob search, search for only cells whose entire contents match the search expression; refer to this for more information, especially about '65536'.
SearchItem.SearchStringstringThe search expression (plain string, regular expression, glob expression, or cell style name)
SearchItem.ReplaceStringstringThe replace expression (replacing string or replacing cell style name)
SearchItem.Localecom.sun.star.lang.LocaleThe locale used in case insensitive search (refer to this)
SearchItem.ChangedCharslongThe allowed number of changed characters for being judged to be similar
SearchItem.DeletedCharslongThe allowed number of deleted characters for being judged to be similar
SearchItem.InsertedCharslongThe allowed number of inserted characters for being judged to be similar
SearchItem.TransliterateFlagslongThe sum of language-specific flags: 256 -> ignore the cases, 1024 -> ignore the character widths, 1073741824 -> ignore diacritics, etc. (too many to be cited here: refer to this and this for more).
SearchItem.CommandshortThe execution type: 0 -> find the next occurrence, 1 -> find all the occurrences, 2 -> replace the next occurrence, 3 -> replace all the occurrences
SearchItem.SearchStartPointXlongThe find-next-occurence search starting position X coordinate in twips (the value '0' together with 'SearchItem.SearchStartPointY' '0' means that no starting position is specified, meaning that the search is performed from the current cell)
SearchItem.SearchStartPointYlongThe find-next-occurence search starting position Y coordinate in twips (the value '0' together with 'SearchItem.SearchStartPointX' '0' means that no starting position is specified, meaning that the search is performed from the current cell)
SearchItem.SearchFormattedbooleanWhether the after-formatted strings (for example, a thousands delimited number string) are searched or not: true -> the after-formatted strings are searched, false -> the raw cell values are searched
SearchItem.AlgorithmType2shortThe strings search algorithm: 1 -> plain text search, 2 -> regular expression search, 3 -> similarity search, 4 -> glob expression search
QuietbooleanSeems not be used

The related information (the value of com.sun.star.frame.FeatureStateEvent.State) (the types are UNO datum types):

Nothing.

The result information (the value of com.sun.star.frame.DispatchResultEvent.Result) (the type is a UNO datum type):

IfTypeValue
something is foundbooleantrue
otherwiseN/Anull

<The previous article in this series | The table of contents of this series | The next article in this series>