Week #2 - GSoC 2023 Weekly Report - Search Field in Options
Project Report for Week #2
In week #1, search functionality was implemented only for headers of the options TreeView. (“Tools > Options” - left pane tree).
We should expand the search functionality to include the sub-headers(sub-elements) of the nodes. For example; if you type “libre”, search function will look if there is any match only in headers. But we should also check their child nodes(sub-headers) to be ensure if there will be any match with the search term.
Sub-tree elements(child nodes) are now included in searching.
If user types "japanese", search function will find the match in "Searching in Japanese" and will show its parent node - which is "Language Settings", as shown below. However, if we only search in headers, this would not be possible and the left pane would be empty - nothing would be shown.
As you can see at the bottom line of the terminal; if there is a match, debug prints "found: <full string of where search item found> : <its parent ID>".
Some technical details
All TreeView nodes and their child nodes are stored in a std::vector as a std::pair.
Search function searchs through all first elements of std::pair<OUString, sal_uInt16>. If there is a match, the second element - which is the ID of the parent node - will be added to left pane as a node.
Summary
Sub-tree elements(child nodes) are now included in searching.