From 6107e102216cce2bdbe1c36017b05913bbb3dffb Mon Sep 17 00:00:00 2001 From: Ting-Yu Lin Date: Tue, 3 May 2016 17:26:30 +0800 Subject: [PATCH] Bug 1267524 Part 15 - Use member initializer list for nsStyleUserInterface. r=heycam MozReview-Commit-ID: KqSikZnyKd0 --HG-- extra : rebase_source : 1ce862d039331b90da0150ba025e50a6b74809ef --- layout/style/nsStyleStruct.cpp | 36 ++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index f1df94c459b9..2da35fad4892 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -3803,32 +3803,30 @@ nsCursorImage::operator=(const nsCursorImage& aOther) } nsStyleUserInterface::nsStyleUserInterface(StyleStructContext aContext) -{ + : mUserInput(NS_STYLE_USER_INPUT_AUTO) + , mUserModify(NS_STYLE_USER_MODIFY_READ_ONLY) + , mUserFocus(NS_STYLE_USER_FOCUS_NONE) + , mPointerEvents(NS_STYLE_POINTER_EVENTS_AUTO) + , mCursor(NS_STYLE_CURSOR_AUTO) + , mCursorArrayLength(0) + , mCursorArray(nullptr) +{ MOZ_COUNT_CTOR(nsStyleUserInterface); - mUserInput = NS_STYLE_USER_INPUT_AUTO; - mUserModify = NS_STYLE_USER_MODIFY_READ_ONLY; - mUserFocus = NS_STYLE_USER_FOCUS_NONE; - mPointerEvents = NS_STYLE_POINTER_EVENTS_AUTO; - - mCursor = NS_STYLE_CURSOR_AUTO; // fix for bugzilla bug 51113 - - mCursorArrayLength = 0; - mCursorArray = nullptr; } -nsStyleUserInterface::nsStyleUserInterface(const nsStyleUserInterface& aSource) : - mUserInput(aSource.mUserInput), - mUserModify(aSource.mUserModify), - mUserFocus(aSource.mUserFocus), - mPointerEvents(aSource.mPointerEvents), - mCursor(aSource.mCursor) -{ +nsStyleUserInterface::nsStyleUserInterface(const nsStyleUserInterface& aSource) + : mUserInput(aSource.mUserInput) + , mUserModify(aSource.mUserModify) + , mUserFocus(aSource.mUserFocus) + , mPointerEvents(aSource.mPointerEvents) + , mCursor(aSource.mCursor) +{ MOZ_COUNT_CTOR(nsStyleUserInterface); CopyCursorArrayFrom(aSource); } -nsStyleUserInterface::~nsStyleUserInterface(void) -{ +nsStyleUserInterface::~nsStyleUserInterface(void) +{ MOZ_COUNT_DTOR(nsStyleUserInterface); delete [] mCursorArray; }