Commit Graph
302 Commits
Author SHA1 Message Date
Mike Kaganski a144acfdf6 Fix some DPI-dependent tests
Change-Id: I3c669802ac558379498c877c8ac4796bbff80f82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131096
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2022-03-07 12:53:27 +01:00
Noel Grandin ffd0453810 use more DECL_DLLPRIVATE_STATIC_LINK
to avoid unnecessarily exporting symbols

Change-Id: I224848cea217977088fe0643511660a7c99b7277
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124733
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-05 13:59:10 +01:00
Luboš Luňák 273a25c796 change some LOK internal updates to be pull model instead of push
Some LOK messages may get called very often, such as updates about
cursor position. And since only the last one matters, they get
generated every time, which costs some time, and then later except
for one they get all discard again from CallbackFlushHandler queue,
which again costs time.

Change the model to instead only set an 'updated' flag, and
CallbackFlushHandler will request the actual message payload only
before flushing.

This commit changes LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR and
LOK_CALLBACK_INVALIDATE_VIEW_CURSOR to work this way.

Change-Id: I376be63176c0b4b5cb492fbf529c21ed01b35481
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124083
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-24 01:40:45 +02:00
Luboš Luňák 62f47c26ad properly flush LOK invalidations in tests
This should be done always before doing something with a flag
related to the invalidations. Use an idle timer for simplicity,
tests already usually process to idle.

Change-Id: I979900da28061cc690ecbcce023dbb769239f205
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124003
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-22 15:54:02 +02:00
Luboš Luňák 31b1e23e2d better name for a function overload
It's better to add to the name what the overload does rather than
just have a "mysterious" extra int.

Change-Id: Iff89679c4a978a4596ac662ef74e934cdefefc9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124001
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-22 15:53:34 +02:00
Luboš Luňák a21c6a3dd3 revert unittests to use plain text-based LibreOfficeKitCallback
At least for now it seems that the more complex
SfxLokCallbackInterface is just an unnecessary complication for unit
tests. The performance doesn't matter, and handling all the
specialized callbacks makes things more complicated. In the future
it'd be also useful to make the tests (optionally?) use also
CallbackFlushHandler as the provider of the messages, in order
to test CallbackFlushHandler more thoroughly, so perhaps in the end
it makes more sense to keep unit tests using the plain text interface.

This reverts unittest-related parts of 3b729db055
and adds a smaller wrapper callback class that converts messages
from SfxLokCallbackInterface to LibreOfficeKitCallback format.

Change-Id: I6c14f0be4ed7b777444b131140be54188d309cca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124000
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-22 15:53:21 +02:00
Miklos Vajna 1ba1bb1cac test: introduce XmlTestTools::registerOOXMLNamespaces() to reduce copy&paste
sc/ could potentially benefit from this as well, that's not yet done
here.

Change-Id: I03d0b4afa21a02c74d34aab6e03ab53991df29dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116679
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-06-04 09:05:12 +02:00
Mike Kaganski 6dfc7354d7 Exclude tests based on device color depth, not RDP
After 5c9ba1f47d, the failures on Jenkins
(see 21191d0d89) made it apparent that
(at least some of) Jenkins builds also run in RDP sessions. Since the
tests excluded in commit 9c6142ec26 never
failed in Jenkins builds before, it is wrong to exclude all those tests
in all RDP sessions: our CI would not test those on Windows.

In the meanwhile, I discovered that the system that failed the tests
actually had 16-bit color depth, despite RDP being configured to use
32-bit colors; that was the reason why the colors were modified on
roundtrip. So it is better to test the actual problem to exclude tests.

This reimplements the check that was introduced in commit
9c6142ec26 to test default virtual device
color depth.

Change-Id: I329a3e2d8eca21732c77dcacf15394d1246b2e18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113460
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-04-01 17:39:54 +02:00
Miklos Vajna 1fcc08d5dc Extract copy&pasted namespace list to XmlTestTools::registerODFNamespaces()
Both sw/ and xmloff/ can depend on test/, so no need to duplicate this.

Change-Id: I93bfdb4422bdef9f8d28bc37548130fae49829e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113107
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-26 09:07:59 +01:00
Stephan Bergmann 042033f1e6 loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-29 16:42:33 +01:00
Stephan Bergmann 35e471bb4d Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY.  These had been missed by
1b43cceaea "Make many OUString functions take
std::u16string_view parameters" because they did not match the multi-overload
pattern that was addressed there, but they nevertheless benefit from being
changed just as well (witness e.g. the various resulting changes from copy() to
subView()).

This showed a conversion from OStringChar to std::string_view to be missing
(while the corresponding conversion form OUStringChar to std::u16string_view was
already present).

The improvement to loplugin:stringadd became necessary to fix

> [CPT] compilerplugins/clang/test/stringadd.cxx
> error: 'error' diagnostics expected but not seen:
>   File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd]
>   File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd]
> 2 errors generated.

Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-11 21:25:10 +01:00
Mike Kaganski 269e36ece4 Introduce BootstrapFixture::IsDefaultDPI convenience function
It should be used to conditionally disable tests that are unreliable
in non-default-DPI environments. The workaround implemented by use
of the function should be temporary, until a proper fix is found.

Change-Id: Ie236226fcfd0ffb054149efc2b7a1727506c4ad0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106661
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-11-26 10:59:15 +01:00
Noel bb06f51308 loplugin:stringviewparam extend to comparison operators
which means that some call sites have to change to use
unicode string literals i.e. u"foo" instead of "foo"

Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24 09:45:04 +01:00
Philipp Hofer 01baeab998 tdf#123936 Formatting files in module include with clang-format
Change-Id: I0507dd797cd5a35e0ae14f4b69ee4e172d08a71a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105681
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2020-11-21 13:19:17 +01:00
Noel 8ef6067596 loplugin:stringviewparam check methods too
not just functions

Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-17 09:57:35 +01:00
Noel 4fbd638605 switching long to a 64-bit type on 64-bit windows
(*) create a rewriting plugin to do most of the work, heavily
    based on the fakebool plugin
(*) but there are still a number of "long"s in the codebase
    that will need to be done by hand
(*) the plugin needs lots of handholding, due to needing to
    add #include and update macros

Change-Id: I8184d7000ca482c0469514bb73178c3a1123b1e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104203
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-26 07:35:36 +01:00
Andrea Gelmini 6505f43b09 tdf#124176 Use #pragma once in some include/
switch to #pragma

It passed "make check" on Linux

Change-Id: Idb01cc7d4ccf404df82016b1b3356400320eb317
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103305
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2020-09-25 08:27:22 +02:00
Xisco Fauli 7ccd8928ac tdf#136949: Revert "tdf#115753 fix table border missing when there are merged cells"
This reverts commit 2b19cd84f1.

Change-Id: I5f3f51e0e816416c364155ab67bc37bb8c6fe545
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103187
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-09-23 13:16:56 +02:00
Michael Stahl 92f308fdc4 test: fix misleading documentation of assertXPathNoAttribute()
Change-Id: I5bb603fe1d615f7df790bcd352beb09d65dcb3a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101536
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Tested-by: Michael Stahl <michael.stahl@cib.de>
2020-08-28 12:33:57 +02:00
Gabor Kelemen 32090b018d tdf#42949 Fix IWYU warnings in include/[t-x]*/*hxx
Recheck after 7-0 branchoff

Also drop the now unused file include/vcl/field.hxx

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I9e54c82f50d1e02a0f99858939cac999fc66f7de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99261
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-08-03 10:23:10 +02:00
nd101 2b19cd84f1 tdf#115753 fix table border missing when there are merged cells
Remove code that ignores merged cells.

Change-Id: I907220e9ffc9d18561171efd7d6b39d14a8341fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93836
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-29 12:03:34 +02:00
Noel Grandin 639511d719 use for-range on Sequence in i18npool..sd
Change-Id: I19eba57bc6058c317473d0746f06699a09ba2830
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94608
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-21 12:29:46 +02:00
Noel Grandin ec6eaa58ad fix memory leak of xmlDoc objects
in unit tests

Change-Id: Id16731bbbe2f1b0e3642722d77aba04fc98db4cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93508
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-07 09:52:27 +02:00
Andrea Gelmini 2c7bed21f4 Fix typo in code
Change-Id: I4709f3fd11c8d5800efab65b6f9533cbad3ffe78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92927
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-04-26 15:38:46 +02:00
Noel Grandin 17e712ccc8 Revert "loplugin:constfields in sw"
This reverts commit 4969f4c0d3.

Change-Id: I527e9366b05e8a20633720e334395b285991c524
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90473
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-13 15:41:42 +01:00
Jens Carl 70d40d57f4 Rename method setReplacementElement()
... to setElement() to have a uniform interface with
similar classes like XNameContainer.

Change-Id: I2058e3ea9f14a5792a07f23f4bd13c4708dccdfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89784
Tested-by: Jens Carl <j.carl43@gmx.de>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2020-03-05 06:28:53 +01:00
Noel Grandin b0a07d9409 remove some dead code
GpgComponentFactory is unused since:
    commit 06d7dbb356
    Date:   Sun May 21 14:28:57 2017 +0200
    gpg4libre: share static xmlsec lib between nss and gpg

tableautoformatfield.cxx should have been removed in:
    commit 5990beed9a
    Date:   Fri Aug 29 16:37:43 2014 +0200
    Dead code

xmlRow is unused since initial import

Change-Id: Ief186e9ef46238cc8cdb49f4adde52a45a98cbc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89830
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-03 08:26:40 +01:00
Miklos Vajna 75a7932bb4 test: move component context from subclasses to BootstrapFixture
To avoid duplication.

Change-Id: I0ee7c26d5d55bd868ead04c77e7f4ef2582f90e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88138
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-07 09:13:50 +01:00
Caolán McNamara 3d826d780a make some headers private
as shown with ./bin/find-headers-to-move-inside-modules.py

Change-Id: I7662417e76fe00c0fc352957560e104b6c2a3d61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87850
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-02-03 20:24:00 +01:00
Pelin Kuran f61ed40fff tdf#124176: Use pragma once instead of header guard
Change-Id: Id28874549342349fb2727c3cb8e92da1dcdb727c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87513
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Tested-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-27 21:44:04 +01:00
Samuel Mehrbrodt 0322a41224 XStyleLoader::loadStylesFromURL Allow loading from stream
Change-Id: Iab0c301096118203466dd91c724c25f1283a0488
Reviewed-on: https://gerrit.libreoffice.org/85392
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-12-23 08:21:14 +01:00
Eike Rathke ec1478f7da Test results across all imported and inserted sheets.
Change-Id: I573467a962a2835765cc5672b81cce4c7772ddff
Reviewed-on: https://gerrit.libreoffice.org/84669
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2019-12-06 23:19:14 +01:00
Caolán McNamara bb6bcabda5 support screenshotting .ui files with GtkBuilder
so...

SAL_USE_VCLPLUGIN=gtk3 make screenshot

for the "unknown dialog" cases of make screenshot, which loads .ui files and
tries to render them, will render them with the native gtk infrastructure

Change-Id: Ifc8fe264155887c4d01b7ce0e2aa53e12acbfcb0
Reviewed-on: https://gerrit.libreoffice.org/80545
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-10 20:25:07 +02:00
Noel Grandin 57c9a995ba loplugin:returnconstval in test..writerfilter
Change-Id: Iea7d15f0a54921514cc4b71c5dc8caaa2ee573c8
Reviewed-on: https://gerrit.libreoffice.org/78063
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-24 22:12:28 +02:00
Noel Grandin e724f245e9 loplugin:constmethod in test
Change-Id: I15aa90d962b9d428a911f4b47a06d55318b42ba4
Reviewed-on: https://gerrit.libreoffice.org/77953
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-22 15:46:24 +02:00
Julien Nabet 7d3041beb9 tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor
in hwpfilter, include/test, io, linguistic, oox, pyuno, reportdesign

Change-Id: I5c265c4fde85dd6d7faab8ae82809c4a0e6dd69b
Reviewed-on: https://gerrit.libreoffice.org/77646
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-17 20:10:43 +02:00
Stephan Bergmann 0f11e746c8 Improved loplugin:stringconstant (now that GCC 7 supports it): test
Change-Id: I9cef15ecfcf15d6b5db5ccf6eed8d1a4ca962e67
Reviewed-on: https://gerrit.libreoffice.org/76638
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-31 12:53:55 +02:00
Gabor Kelemen bfe225b700 tdf#42949 Fix IWYU warnings in include/test
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

New IWYU and recent developments in f-u-i helped to identify
some non self contained files, those were fixed too.

Change-Id: I527f7c2cf2660a758b13eabb4c444ff79ae35f8c
Reviewed-on: https://gerrit.libreoffice.org/75186
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-07-23 14:16:09 +02:00
Jens Carl 958e304490 Use in-class member initializers
Don't use a default ctor that only initializes data members, but rather
in-class member initializers. Follow CppCoreGuidelines rule C.45
(see https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-default).

Change-Id: I52d26fa0393f7e383beb95456dd016aa0e84b777
Reviewed-on: https://gerrit.libreoffice.org/74589
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-06-23 17:59:21 +02:00
Jens Carl 0e73f9eb41 tdf#45904 Move XShape Java tests to C++
Move XShape Java tests to C++ for ScShapeObj.

Change-Id: I349c4abb09c3e9e43285b63ee5f19f55d967b38f
Reviewed-on: https://gerrit.libreoffice.org/74331
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-06-19 08:10:10 +02:00
Jens Carl 8a453f96f0 tdf#45904 Move XGluePointsSupplier Java test to C++
Move XGluePointsSupplier Java test to C++ for ScShapeObj.

Change-Id: I75babf46b664cccbb4d1df2af1764c3fa296903a
Reviewed-on: https://gerrit.libreoffice.org/74140
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-06-18 06:52:14 +02:00
Jens Carl c77a1e1c03 tdf#45904 Move XShapeDescriptor Java test to C++
Move XShapeDescriptor Java test to C++ for ScShapeObj.

Change-Id: I2d530ea73c6f25e36665db0bd65f734e509d97a6
Reviewed-on: https://gerrit.libreoffice.org/74139
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-06-17 08:03:15 +02:00
Michael Meeks 03d33ba941 lok: re-factor getTextSelection.
Change-Id: I2c27c213ee980e19d6020e9599b2b72115e7f28e
Reviewed-on: https://gerrit.libreoffice.org/73626
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-06-07 15:42:05 +02:00
Jens Carl 35608a192d tdf#45904 Move XComponent Java tests to C++
Move XComponent Java tests to C++ for ScShapeObj.

Change-Id: Ib692827729dbe38eaceb76aa042d76e14d9614f8
Reviewed-on: https://gerrit.libreoffice.org/71787
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-05-04 17:37:47 +02:00
Jens Carl de529f3212 Enable testing of multiple service names
Enable testing of multiple service names of the object supports this, by
storing all possible names in a vector.

Change-Id: Iff2c974cc30a0729cb26b07002582e0786a4de44
Reviewed-on: https://gerrit.libreoffice.org/71713
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-05-03 03:32:45 +02:00
Jens Carl f07e91ac73 tdf#45904 Move XReplaceDescriptor Java tests to C++
Move XReplaceDescriptor Java tests to C++ for ScCellSearchObj.

Change-Id: Ica5042ce8b5eac3663a0fb5f66ae0a2830c89d93
Reviewed-on: https://gerrit.libreoffice.org/71645
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-05-02 02:53:26 +02:00
Jens Carl 6f763a3fcd tdf#45904 Move SearchDescriptor Java tests to C++
Move SearchDescriptor Java tests to C++ for ScCellSearchObj.

Change-Id: I3c9ffbfc80c7fdc39d0e67fe8aae12605a8d04f5
Reviewed-on: https://gerrit.libreoffice.org/71644
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-05-02 02:52:28 +02:00
Jens Carl 976bb31199 tdf#45904 Move XSearchDescriptor Java tests to C++
Move XSearchDescriptor Java tests to C++ for ScCellSearchObj.

Change-Id: I1ae50bb586fd742b7cc19f71bcae018ca42139e6
Reviewed-on: https://gerrit.libreoffice.org/71643
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-05-02 01:19:34 +02:00
Mike Kaganski d822953cbc Make getXPathPosition assert on requested child found
Previously, for an XML like this:

    <sharedItems>
        <d v="2017-07-10T09:11:02"/>
        <d v="2017-07-10T09:11:03"/>
        <m/>
    </sharedItems>

the call like

    int pos = getXPathPosition(pDoc, "/x:sharedItems", "absent");

gave 3. That could result in mistakes, when a test would assert
on position "3" for a child element which name is mistyped.

I made such a mistake when creating a unit test trying to assert on
a position of the last element, and writing its name as "x:m", like
in rXPath itself; the return was 3, and I initially wrongly assumed
that the return is 1-based (like in xpath bracketed expressions).

rChildName made const OString&, for consistency with rXPath, or with
rAttribute in getXPath: child name is just a part of a longer xpath.

Change-Id: I7ba9c4466c75b1b10fce1ccf26ef3b56b4e11e87
Reviewed-on: https://gerrit.libreoffice.org/71614
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-05-01 12:30:22 +02:00
Mike Kaganski 3fef9fa3f5 assertXPath: disallow passing rAttribute without rExpectedValue
Change-Id: I7fb59039429361dad04fb68507f40545f9c4dd6d
Reviewed-on: https://gerrit.libreoffice.org/71290
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-25 14:42:13 +02:00