Commit 5d2063dd authored by Mounir Lamouri's avatar Mounir Lamouri
Browse files

Bug 760845 - Remove NS_IMPL_POSITIVE_INT_ATTR{,_DEFAULT_VALUE} macros. r=Ms2ger

They are no longer used and doesn't match anything in the specifications now.
parent 7d616322
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -1161,31 +1161,6 @@ PR_STATIC_ASSERT(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + 1 < 32);
    return SetAttrHelper(nsGkAtoms::_atom, aValue);                       \
  }

/**
 * A macro to implement the getter and setter for a given content
 * property that needs to set a positive integer. The method uses
 * the generic GetAttr and SetAttr methods. This macro is much like
 * the NS_IMPL_NON_NEGATIVE_INT_ATTR macro except the exception is
 * thrown also when the value is equal to 0.
 */
#define NS_IMPL_POSITIVE_INT_ATTR(_class, _method, _atom)                 \
  NS_IMPL_POSITIVE_INT_ATTR_DEFAULT_VALUE(_class, _method, _atom, 1)

#define NS_IMPL_POSITIVE_INT_ATTR_DEFAULT_VALUE(_class, _method, _atom, _default)  \
  NS_IMETHODIMP                                                           \
  _class::Get##_method(PRInt32* aValue)                                   \
  {                                                                       \
    return GetIntAttr(nsGkAtoms::_atom, _default, aValue);                \
  }                                                                       \
  NS_IMETHODIMP                                                           \
  _class::Set##_method(PRInt32 aValue)                                    \
  {                                                                       \
    if (aValue <= 0) {                                                    \
      return NS_ERROR_DOM_INDEX_SIZE_ERR;                                 \
    }                                                                     \
    return SetIntAttr(nsGkAtoms::_atom, aValue);                          \
  }

/**
 * QueryInterface() implementation helper macros
 */