void InsetMathCancelto::metrics(MetricsInfo & mi, Dimension & dim) const
{
Changer dummy = mi.base.changeEnsureMath();
- InsetMathNest::metrics(mi);
+ cellsMetrics(mi);
Dimension const & dim0 = cell(0).dimension(*mi.base.bv);
Dimension const & dim1 = cell(1).dimension(*mi.base.bv);
dim.asc = max(dim0.ascent() + 2, dim0.ascent() + dim1.ascent()) + 2 + 8;
}
-void InsetMathNest::metrics(MetricsInfo const & mi) const
+void InsetMathNest::cellsMetrics(MetricsInfo const & mi) const
{
MetricsInfo m = mi;
- for (idx_type i = 0, n = nargs(); i != n; ++i) {
+ for (auto const & cell : cells_) {
Dimension dim;
- cell(i).metrics(m, dim);
+ cell.metrics(m, dim);
}
}
///
void setBuffer(Buffer &);
- // The method below hides inset::metrics() intentionally!
- // We have to tell clang not to be fussy about that.
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Woverloaded-virtual"
-#endif
- /// the size is usually some sort of convex hull of the cells
- void metrics(MetricsInfo const & mi) const;
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
+ /// Update the cells metrics
+ void cellsMetrics(MetricsInfo const & mi) const;
/// draw background if locked
void draw(PainterInfo & pi, int x, int y) const;
/// draw selection background
void InsetMathRoot::metrics(MetricsInfo & mi, Dimension & dim) const
{
Changer dummy = mi.base.changeEnsureMath();
- InsetMathNest::metrics(mi);
+ cellsMetrics(mi);
Dimension const & dim0 = cell(0).dimension(*mi.base.bv);
Dimension const & dim1 = cell(1).dimension(*mi.base.bv);
dim.asc = max(dim0.ascent() + 5, dim1.ascent()) + 2;