dom/xslt/xpath/txNodeSetContext.cpp

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "txNodeSetContext.h"
     7 #include "txNodeSet.h"
     9 const txXPathNode& txNodeSetContext::getContextNode()
    10 {
    11     return mContextSet->get(mPosition - 1);
    12 }
    14 uint32_t txNodeSetContext::size()
    15 {
    16     return (uint32_t)mContextSet->size();
    17 }
    19 uint32_t txNodeSetContext::position()
    20 {
    21     NS_ASSERTION(mPosition, "Should have called next() at least once");
    22     return mPosition;
    23 }
    25 nsresult txNodeSetContext::getVariable(int32_t aNamespace, nsIAtom* aLName,
    26                                        txAExprResult*& aResult)
    27 {
    28     NS_ASSERTION(mInner, "mInner is null!!!");
    29     return mInner->getVariable(aNamespace, aLName, aResult);
    30 }
    32 bool txNodeSetContext::isStripSpaceAllowed(const txXPathNode& aNode)
    33 {
    34     NS_ASSERTION(mInner, "mInner is null!!!");
    35     return mInner->isStripSpaceAllowed(aNode);
    36 }
    38 void* txNodeSetContext::getPrivateContext()
    39 {
    40     NS_ASSERTION(mInner, "mInner is null!!!");
    41     return mInner->getPrivateContext();
    42 }
    44 txResultRecycler* txNodeSetContext::recycler()
    45 {
    46     NS_ASSERTION(mInner, "mInner is null!!!");
    47     return mInner->recycler();
    48 }
    50 void txNodeSetContext::receiveError(const nsAString& aMsg, nsresult aRes)
    51 {
    52     NS_ASSERTION(mInner, "mInner is null!!!");
    53 #ifdef DEBUG
    54     nsAutoString error(NS_LITERAL_STRING("forwarded error: "));
    55     error.Append(aMsg);
    56     mInner->receiveError(error, aRes);
    57 #else
    58     mInner->receiveError(aMsg, aRes);
    59 #endif
    60 }

mercurial