Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 2b84010

Browse files
author
Ehsan Akhgari
committed
Bug 1048246 - Fix more bad implicit constructors in layout; r=roc
--HG-- extra : rebase_source : ed828993139bc70232508364a9f046e38b7d3e06
1 parent 23c01b7 commit 2b84010

33 files changed

Lines changed: 79 additions & 71 deletions

accessible/generic/HyperTextAccessible.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,9 @@ HyperTextAccessible::ScrollSubstringToPoint(int32_t aStartOffset,
15461546
int16_t hPercent = offsetPointX * 100 / size.width;
15471547
int16_t vPercent = offsetPointY * 100 / size.height;
15481548

1549-
nsresult rv = nsCoreUtils::ScrollSubstringTo(frame, range, vPercent, hPercent);
1549+
nsresult rv = nsCoreUtils::ScrollSubstringTo(frame, range,
1550+
nsIPresShell::ScrollAxis(vPercent),
1551+
nsIPresShell::ScrollAxis(hPercent));
15501552
if (NS_FAILED(rv))
15511553
return;
15521554

layout/base/DisplayListClipState.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class DisplayListClipState {
131131
*/
132132
class DisplayListClipState::AutoSaveRestore {
133133
public:
134-
AutoSaveRestore(nsDisplayListBuilder* aBuilder);
134+
explicit AutoSaveRestore(nsDisplayListBuilder* aBuilder);
135135
void Restore()
136136
{
137137
mState = mSavedState;
@@ -227,7 +227,7 @@ class DisplayListClipState::AutoClipContainingBlockDescendantsToContentBox : pub
227227
*/
228228
class DisplayListClipState::AutoClipMultiple : public AutoSaveRestore {
229229
public:
230-
AutoClipMultiple(nsDisplayListBuilder* aBuilder)
230+
explicit AutoClipMultiple(nsDisplayListBuilder* aBuilder)
231231
: AutoSaveRestore(aBuilder)
232232
, mExtraClipUsed(false)
233233
{}

layout/base/FrameLayerBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ class FrameLayerBuilder : public layers::LayerUserData {
595595
public:
596596
class ThebesLayerItemsEntry : public nsPtrHashKey<ThebesLayer> {
597597
public:
598-
ThebesLayerItemsEntry(const ThebesLayer *key)
598+
explicit ThebesLayerItemsEntry(const ThebesLayer *key)
599599
: nsPtrHashKey<ThebesLayer>(key)
600600
, mContainerLayerFrame(nullptr)
601601
, mLastCommonClipCount(0)

layout/base/FramePropertyTable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class FramePropertyTable {
192192
class Entry : public nsPtrHashKey<nsIFrame>
193193
{
194194
public:
195-
Entry(KeyTypePointer aKey) : nsPtrHashKey<nsIFrame>(aKey) {}
195+
explicit Entry(KeyTypePointer aKey) : nsPtrHashKey<nsIFrame>(aKey) {}
196196
Entry(const Entry &toCopy) :
197197
nsPtrHashKey<nsIFrame>(toCopy), mProp(toCopy.mProp) {}
198198

layout/base/nsDisplayList.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ class nsDisplayListBuilder {
624624
: mContainingBlockClip(aContainingBlockClip)
625625
, mDirtyRect(aDirtyRect)
626626
{}
627-
OutOfFlowDisplayData(const nsRect &aDirtyRect)
627+
explicit OutOfFlowDisplayData(const nsRect &aDirtyRect)
628628
: mDirtyRect(aDirtyRect)
629629
{}
630630
DisplayItemClip mContainingBlockClip;
@@ -808,7 +808,7 @@ class nsDisplayItem : public nsDisplayItemLink {
808808
* This constructor is only used in rare cases when we need to construct
809809
* temporary items.
810810
*/
811-
nsDisplayItem(nsIFrame* aFrame)
811+
explicit nsDisplayItem(nsIFrame* aFrame)
812812
: mFrame(aFrame)
813813
, mClip(nullptr)
814814
, mReferenceFrame(nullptr)
@@ -830,7 +830,7 @@ class nsDisplayItem : public nsDisplayItemLink {
830830
struct HitTestState {
831831
typedef nsTArray<ViewID> ShadowArray;
832832

833-
HitTestState(ShadowArray* aShadows = nullptr)
833+
explicit HitTestState(ShadowArray* aShadows = nullptr)
834834
: mShadows(aShadows) {
835835
}
836836

@@ -1744,7 +1744,7 @@ struct nsDisplayListCollection : public nsDisplayListSet {
17441744
nsDisplayListCollection() :
17451745
nsDisplayListSet(&mLists[0], &mLists[1], &mLists[2], &mLists[3], &mLists[4],
17461746
&mLists[5]) {}
1747-
nsDisplayListCollection(nsDisplayList* aBorderBackground) :
1747+
explicit nsDisplayListCollection(nsDisplayList* aBorderBackground) :
17481748
nsDisplayListSet(aBorderBackground, &mLists[1], &mLists[2], &mLists[3], &mLists[4],
17491749
&mLists[5]) {}
17501750

@@ -3412,7 +3412,7 @@ class nsCharClipDisplayItem : public nsDisplayItem {
34123412
nsCharClipDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
34133413
: nsDisplayItem(aBuilder, aFrame), mLeftEdge(0), mRightEdge(0) {}
34143414

3415-
nsCharClipDisplayItem(nsIFrame* aFrame)
3415+
explicit nsCharClipDisplayItem(nsIFrame* aFrame)
34163416
: nsDisplayItem(aFrame) {}
34173417

34183418
struct ClipEdges {

layout/base/nsDocumentViewer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class nsDocumentViewer : public nsIContentViewer,
427427
class nsPrintEventDispatcher
428428
{
429429
public:
430-
nsPrintEventDispatcher(nsIDocument* aTop) : mTop(aTop)
430+
explicit nsPrintEventDispatcher(nsIDocument* aTop) : mTop(aTop)
431431
{
432432
nsDocumentViewer::DispatchBeforePrint(mTop);
433433
}
@@ -442,7 +442,7 @@ class nsPrintEventDispatcher
442442
class nsDocumentShownDispatcher : public nsRunnable
443443
{
444444
public:
445-
nsDocumentShownDispatcher(nsCOMPtr<nsIDocument> aDocument)
445+
explicit nsDocumentShownDispatcher(nsCOMPtr<nsIDocument> aDocument)
446446
: mDocument(aDocument) {}
447447

448448
NS_IMETHOD Run() MOZ_OVERRIDE;

layout/base/nsIPresShell.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,9 @@ class nsIPresShell : public nsISupports
654654
* no scrollbar showing and less than one device pixel of
655655
* scrollable distance), don't scroll. Defaults to false.
656656
*/
657-
ScrollAxis(int16_t aWhere = SCROLL_MINIMUM,
658-
WhenToScroll aWhen = SCROLL_IF_NOT_FULLY_VISIBLE,
659-
bool aOnlyIfPerceivedScrollableDirection = false) :
657+
explicit ScrollAxis(int16_t aWhere = SCROLL_MINIMUM,
658+
WhenToScroll aWhen = SCROLL_IF_NOT_FULLY_VISIBLE,
659+
bool aOnlyIfPerceivedScrollableDirection = false) :
660660
mWhereToScroll(aWhere), mWhenToScroll(aWhen),
661661
mOnlyIfPerceivedScrollableDirection(aOnlyIfPerceivedScrollableDirection)
662662
{}

layout/base/nsLayoutUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ class nsLayoutUtils
10001000
struct RectListBuilder : public RectCallback {
10011001
DOMRectList* mRectList;
10021002

1003-
RectListBuilder(DOMRectList* aList);
1003+
explicit RectListBuilder(DOMRectList* aList);
10041004
virtual void AddRect(const nsRect& aRect);
10051005
};
10061006

@@ -2346,7 +2346,7 @@ namespace mozilla {
23462346
*/
23472347
class AutoMaybeDisableFontInflation {
23482348
public:
2349-
AutoMaybeDisableFontInflation(nsIFrame *aFrame);
2349+
explicit AutoMaybeDisableFontInflation(nsIFrame *aFrame);
23502350

23512351
~AutoMaybeDisableFontInflation();
23522352
private:

layout/base/nsPresArena.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class nsPresArena {
118118
typedef const void* KeyTypePointer;
119119
KeyTypePointer mKey;
120120

121-
FreeList(KeyTypePointer aKey)
121+
explicit FreeList(KeyTypePointer aKey)
122122
: mEntrySize(0), mEntriesEverAllocated(0), mKey(aKey) {}
123123
// Default copy constructor and destructor are ok.
124124

layout/base/nsPresContext.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ class nsPresContext : public nsIObserver {
937937
friend class InterruptPreventer;
938938
class MOZ_STACK_CLASS InterruptPreventer {
939939
public:
940-
InterruptPreventer(nsPresContext* aCtx) :
940+
explicit InterruptPreventer(nsPresContext* aCtx) :
941941
mCtx(aCtx),
942942
mInterruptsEnabled(aCtx->mInterruptsEnabled),
943943
mHasPendingInterrupt(aCtx->mHasPendingInterrupt)
@@ -1492,7 +1492,7 @@ class nsRootPresContext MOZ_FINAL : public nsPresContext {
14921492

14931493
class RunWillPaintObservers : public nsRunnable {
14941494
public:
1495-
RunWillPaintObservers(nsRootPresContext* aPresContext) : mPresContext(aPresContext) {}
1495+
explicit RunWillPaintObservers(nsRootPresContext* aPresContext) : mPresContext(aPresContext) {}
14961496
void Revoke() { mPresContext = nullptr; }
14971497
NS_IMETHOD Run() MOZ_OVERRIDE
14981498
{

0 commit comments

Comments
 (0)