summaryrefslogtreecommitdiff
path: root/sw/qa/extras/indexing
AgeCommit message (Collapse)AuthorFilesLines
2021-10-21introduce SwNodeOffset strong typedefNoel Grandin1-2/+2
for indexing into node children. Replaces various usage of sal_uLong, tools::Long, sal_uInt32 with an underlying type of sal_Int32. Also add a NODE_OFFSET_MAX constant to replace usage of ULONG_MAX Change-Id: I2f466922e1ebc19029bb2883d2b29aa4c0614170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-08indexing: fix correct size and pos. for shapes + more testsTomaž Vajngerl1-8/+8
Determining the position and size of the shapes (SdrObjects) was wrong as the assumption was the values are in Hmm but were in twips. Added some more tests that check rendering of SdrObjects. Change-Id: I6ef9287892d1774a1243118a5c97f58384bcfd68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121801 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-08indexing: rename "parent" attibute and parse the attribute backTomaž Vajngerl2-39/+71
Rename the attribute "parent" to "object_name" and "parent_index" and parse the "object_name" attribute for JSON and XML when used as input to SearchResultLocator. Change-Id: I46ad8d6aa14f15d1b759126af71284f7d73a7a96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121797 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-08indexing: rename "type" for prargraph an object nodesTomaž Vajngerl2-16/+24
They are conflicting, so rename the one for paragraphs to "node_type and the one for objects to "object_type". This needs adusting all the tests. Also change the node_type from numerical value (correcponding to a enum) to string based - "writer" or "commom" values. Change-Id: I0465cd4c2c6989e436d5a675db20c87066d19208 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121743 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-08indexing: support JSON and XML as input for SearchResultLocatorTomaž Vajngerl1-3/+33
JSON is much easier to deal with when using REST and javascript, so support both. Change-Id: I61035452d9a7ba889ac355a42201d79b9fafec6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121742 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-26indexing: move xml parsing into SearchResultLocatorTomaž Vajngerl1-0/+30
Let's keep unneeded complexity out of SwXTextDocument, so move parsing into SearchResultLocator. As a bonus we can now test parsing. Change-Id: I944bfc43e6953523eee19b26b7f483aa401809aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121032 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-23indexing: make indexing XML flat and use simple element namesTomaž Vajngerl1-76/+91
This changes the indexing XML to be flat-er and change the element names to just be either "paragraph" or an "object", where an "object" then has an attribute what type exactly it is. This makes converting the XML to an indexing engine accepted format easier. Change-Id: Ia8941cc9616a862c1bc980efea5ba2548217644e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120836 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-13indexing: allow for multiple entries in search indexing dataTomaž Vajngerl1-9/+6
Change-Id: Idb9bbbaa940b7cd48423c6cc65b9c7d0b94f57dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120396 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-10indexing: add "type" to the xml for paragraph nodesTomaž Vajngerl1-0/+1
The type is either WriterNode (1) or SdrObect (2) as we need to know for which one the index is refering to. Change-Id: I0f4bc95d91e37cf75db5ed49cd14df61133f5f19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120193 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-08-10indexing: add support for SdrObjects in SearchResultLocatorTomaž Vajngerl1-11/+39
Also add (node) "type" parameter because we need to differentiate between Writer nodes and SdrObject nodes. Change-Id: I590695ae71781f64c22bdd7e1df01d69e3376e67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118671 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-07-27loplugin:unreffun (macOS)Stephan Bergmann1-0/+6
...and -Werror,-Wunused-const-variable Change-Id: I0071e08af4ec3a037fb49b9345c1f70ddcfc5ea4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119536 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-07-27sw: disable SearchResultLocatorTest for Windows and MacOSTomaž Vajngerl1-1/+4
Because of inconsistent reuslts for those 2 platforms for unknown issues, turn the tests off for now. Change-Id: I9b1c8a839d6765d695ed5d9b129c001ffd66ed5e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119508 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-07-26indexing: search result locator to return the rect of the resultTomaž Vajngerl1-0/+72
Returns the rectangle(s) where the search result is located in the document. Change-Id: Ib2333584fbc460cc16b1bf205fc3d674a1c06957 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118668 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-26indexing: add test case for fontworks and footer/header paragraphsTomaž Vajngerl3-0/+46
Change-Id: I7b6879d0e038f8c07ae5853d66c43096c25365e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117841 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-19indexing: indexing sections for the IndexingExportTomaž Vajngerl2-0/+31
Adds handling of sections to the IndexingExport. SectionNode also derives from StartNode, so we handle it similar as the tables. Change-Id: I5eb8d599bdf680144b161aa93295ea3d360eb5c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117452 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-19indexing: indexing tables for the IndexingExportTomaž Vajngerl2-0/+64
Adds handling of tables to the IndexingExport and also handling of the end node (as table node is also a start node), so we know which paragraphs belong to a table. Change-Id: I624ce12a3e810797a37ae2efe5baa552828f75dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117450 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-19indexing: indexing shapes/text boxes for the IndexingExportTomaž Vajngerl2-0/+30
Adds handling of shapes and text boxes to the IndexingExport with exporting the the name, alt text, description and paragraphs of the inner shape text to the indexing xml. Change-Id: I3db68078b7e793cab552b4f7f8e8ddf9bfd1a6f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117359 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-19indexing: indexing OLE objects for the IndexingExportTomaž Vajngerl2-0/+20
Adds handling of OLE objects to the IndexingExport with exporting the alt text and the name to the indexing xml. Change-Id: Ie357f55195cda864ee12d6b120babd106eff6179 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117358 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-19indexing: indexing graphics for the IndexingExportTomaž Vajngerl2-3/+25
Adds handling of graphics to the IndexingExport with exporting the alt text and the name to the indexing xml. Change-Id: I20344dd04c5da4668c8eafbf1f863a26357ad616 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117357 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-19indexing: indexing paragraph text with the ModelTraverserTomaž Vajngerl1-0/+29
This adds the basic paragraph text export for indexing, which uses the new ModelTraverser, which is inspired by AccessibilityCheck (and in the future it will be changed to use the ModelTraverser too, when it matures). ModelTraverser implements traversing through the model and executes a handler for a element of a model (which can be various things). IndexingExport class implements indexing export that uses the ModelTraverser to write into the indexing xml document, that uses the tools::XmlWriter. Change-Id: I7a6a5de332534270fe894a881131e5eb5ea9d881 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117356 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-17indexing: remove indexing changes from html exportTomaž Vajngerl2-0/+55
Turns out that reusing HTML export wasn't the best way to generate output XML that can be used for indexing, so reverting those changes. The IndexingExportTest and the test file has been moved out of html to its own folder, so it can be reused. Change-Id: Ie2b34285775133322c16c05eee9c0e9712c86c3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117354 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>