LayoutMasterSet lms = getFoLayoutMasterSet(context);
// Set suitable extents, for which we need area tree
FOSettings foSettings = (FOSettings)context.getConversionSettings();
if ( !foSettings.lsLayoutMasterSetCalculationInProgress()) // Avoid infinite loop
// Can't just do it where foSettings.getApacheFopMime() is not MimeConstants.MIME_FOP_AREA_TREE,
// since TOC functionality uses that.
{
fixExtents( lms, context, false);
}