Bug 1157569 part 10 - Add operator+= for LogicalMargin. r=jfkthame
authorXidorn Quan <quanxunzhen@gmail.com>
Mon, 04 May 2015 19:09:25 +1200
changeset 273604 aba4c5eb06de498f63d20d7399b2742891d0aa50
parent 273603 78893c39c41135f4d5e1b5a8a4bf0f5816d40109
child 273605 42765978536eff5837d67012ef5fc4716c9043ec
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1157569
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1157569 part 10 - Add operator+= for LogicalMargin. r=jfkthame
layout/generic/WritingModes.h
--- a/layout/generic/WritingModes.h
+++ b/layout/generic/WritingModes.h
@@ -1273,16 +1273,23 @@ public:
     CHECK_WRITING_MODE(aMargin.GetWritingMode());
     return LogicalMargin(GetWritingMode(),
                          BStart() + aMargin.BStart(),
                          IEnd() + aMargin.IEnd(),
                          BEnd() + aMargin.BEnd(),
                          IStart() + aMargin.IStart());
   }
 
+  LogicalMargin operator+=(const LogicalMargin& aMargin)
+  {
+    CHECK_WRITING_MODE(aMargin.GetWritingMode());
+    mMargin += aMargin.mMargin;
+    return *this;
+  }
+
   LogicalMargin operator-(const LogicalMargin& aMargin) const {
     CHECK_WRITING_MODE(aMargin.GetWritingMode());
     return LogicalMargin(GetWritingMode(),
                          BStart() - aMargin.BStart(),
                          IEnd() - aMargin.IEnd(),
                          BEnd() - aMargin.BEnd(),
                          IStart() - aMargin.IStart());
   }