Alfredo Braunstein wrote:

        if (maxsize > font.size()) {
+               // use standard paragraph font with the maximal size
                font.setSize(maxsize);
-               maxasc  = max(maxasc,  fontmetrics.maxAscent());
-               maxdesc = max(maxdesc, fontmetrics.maxDescent());
+               FontMetrics const & maxfontmetrics = theFontMetrics(font);
+               maxasc  = max(maxasc,  maxfontmetrics.maxAscent());
+       }


I would add a comment saying that the fontmetrics variable is outdated once
you change 'font'. Otherwise there's the risk we hit this bug again and
again...

A/


Reply via email to