Bug 1048240 - Fix more bad implicit constructors in accessible; r=tbsaunde
--- a/accessible/base/AccEvent.h
+++ b/accessible/base/AccEvent.h
@@ -286,17 +286,17 @@ public:
/**
* Class for reorder accessible event. Takes care about
*/
class AccReorderEvent : public AccEvent
{
public:
- AccReorderEvent(Accessible* aTarget) :
+ explicit AccReorderEvent(Accessible* aTarget) :
AccEvent(::nsIAccessibleEvent::EVENT_REORDER, aTarget,
eAutoDetect, eCoalesceReorder) { }
virtual ~AccReorderEvent() { }
// Event
static const EventGroup kEventGroup = eReorderEvent;
virtual unsigned int GetEventGroups() const
{
@@ -494,17 +494,17 @@ private:
};
/**
* Downcast the generic accessible event object to derived type.
*/
class downcast_accEvent
{
public:
- downcast_accEvent(AccEvent* e) : mRawPtr(e) { }
+ explicit downcast_accEvent(AccEvent* e) : mRawPtr(e) { }
template<class Destination>
operator Destination*() {
if (!mRawPtr)
return nullptr;
return mRawPtr->GetEventGroups() & (1U << Destination::kEventGroup) ?
static_cast<Destination*>(mRawPtr) : nullptr;
--- a/accessible/generic/Accessible.h
+++ b/accessible/generic/Accessible.h
@@ -91,17 +91,17 @@ struct GroupPos
};
/**
* An index type. Assert if out of range value was attempted to be used.
*/
class index_t
{
public:
- index_t(int32_t aVal) : mVal(aVal) {}
+ MOZ_IMPLICIT index_t(int32_t aVal) : mVal(aVal) {}
operator uint32_t() const
{
MOZ_ASSERT(mVal >= 0, "Attempt to use wrong index!");
return mVal;
}
bool IsValid() const { return mVal >= 0; }