• Mike Kaganski's avatar
    Make getXPathPosition assert on requested child found · d822953c
    Mike Kaganski yazdı
    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: 's avatarMike Kaganski <mike.kaganski@collabora.com>
    d822953c
Adı
Son kayıt (commit)
Son güncelleme
..
beans Loading commit data...
chart Loading commit data...
container Loading commit data...
document Loading commit data...
drawing Loading commit data...
helper Loading commit data...
lang Loading commit data...
sheet Loading commit data...
style Loading commit data...
table Loading commit data...
text Loading commit data...
util Loading commit data...
view Loading commit data...
bootstrapfixture.hxx Loading commit data...
calc_unoapi_test.hxx Loading commit data...
callgrind.hxx Loading commit data...
cppunitasserthelper.hxx Loading commit data...
htmltesttools.hxx Loading commit data...
screenshot_test.hxx Loading commit data...
setupvcl.hxx Loading commit data...
testdllapi.hxx Loading commit data...
testinteractionhandler.hxx Loading commit data...
unoapi_property_testers.hxx Loading commit data...
unoapi_test.hxx Loading commit data...
xmldiff.hxx Loading commit data...
xmltesttools.hxx Loading commit data...