Bug 1343516 - make all methods 'const' and 'final' for nsFontMetrics's StubPropertyProvider. draft
authorJeremy Chen <jeremychen@mozilla.com>
Wed, 15 Mar 2017 16:25:26 +0800
changeset 498982 ac9eabbc83d6020d0caaa37763029563c8e29ed1
parent 498981 bfcd0eae2fa4bfe35848868fec8b407dc8ed3803
child 498983 cf340bc1fb5e326350c8621704bd61250f83ca42
push id49300
push userjichen@mozilla.com
push dateWed, 15 Mar 2017 08:26:24 +0000
bugs1343516
milestone55.0a1
Bug 1343516 - make all methods 'const' and 'final' for nsFontMetrics's StubPropertyProvider. MozReview-Commit-ID: 1CzTDXgGUY6
gfx/src/nsFontMetrics.cpp
--- a/gfx/src/nsFontMetrics.cpp
+++ b/gfx/src/nsFontMetrics.cpp
@@ -78,37 +78,37 @@ private:
         return flags;
     }
 
     RefPtr<gfxTextRun> mTextRun;
 };
 
 class StubPropertyProvider : public gfxTextRun::PropertyProvider {
 public:
-    virtual void GetHyphenationBreaks(gfxTextRun::Range aRange,
-                                      gfxTextRun::HyphenType* aBreakBefore) {
+    void GetHyphenationBreaks(gfxTextRun::Range aRange,
+                              gfxTextRun::HyphenType* aBreakBefore) const final {
         NS_ERROR("This shouldn't be called because we never call BreakAndMeasureText");
     }
-    virtual mozilla::StyleHyphens GetHyphensOption() {
+    mozilla::StyleHyphens GetHyphensOption() const final {
         NS_ERROR("This shouldn't be called because we never call BreakAndMeasureText");
         return mozilla::StyleHyphens::None;
     }
-    virtual gfxFloat GetHyphenWidth() {
+    gfxFloat GetHyphenWidth() const final {
         NS_ERROR("This shouldn't be called because we never enable hyphens");
         return 0;
     }
-    virtual already_AddRefed<mozilla::gfx::DrawTarget> GetDrawTarget() {
+    already_AddRefed<mozilla::gfx::DrawTarget> GetDrawTarget() const final {
         NS_ERROR("This shouldn't be called because we never enable hyphens");
         return nullptr;
     }
-    virtual uint32_t GetAppUnitsPerDevUnit() {
+    uint32_t GetAppUnitsPerDevUnit() const final {
         NS_ERROR("This shouldn't be called because we never enable hyphens");
         return 60;
     }
-    virtual void GetSpacing(gfxTextRun::Range aRange, Spacing* aSpacing) {
+    void GetSpacing(gfxTextRun::Range aRange, Spacing* aSpacing) const final {
         NS_ERROR("This shouldn't be called because we never enable spacing");
     }
 };
 
 } // namespace
 
 nsFontMetrics::nsFontMetrics(const nsFont& aFont, const Params& aParams,
                              nsDeviceContext *aContext)