- if (!ctables_find_category_for_postcompute (cats, e))
- {
- if (e->op == CTPO_CAT_SUBTOTAL && e->subtotal_index == 0)
- {
- size_t n_subtotals = 0;
- for (size_t i = 0; i < cats->n_cats; i++)
- n_subtotals += (cats->cats[i].type == CCT_SUBTOTAL
- || cats->cats[i].type == CCT_HSUBTOTAL);
- if (n_subtotals > 1)
- {
- msg_at (SE, cats_location,
- ngettext ("These categories include %zu instance of "
- "SUBTOTAL or HSUBTOTAL, so references from "
- "computed categories must refer to "
- "subtotals by position.",
- "These categories include %zu instances of "
- "SUBTOTAL or HSUBTOTAL, so references from "
- "computed categories must refer to "
- "subtotals by position.",
- n_subtotals),
- n_subtotals);
- msg_at (SN, e->location,
- _("This is the reference that lacks a position."));
- return NULL;
- }
- }
+ {
+ struct ctables_category *cat = ctables_find_category_for_postcompute (
+ cats, e);
+ if (!cat)
+ {
+ if (e->op == CTPO_CAT_SUBTOTAL && e->subtotal_index == 0)
+ {
+ size_t n_subtotals = 0;
+ for (size_t i = 0; i < cats->n_cats; i++)
+ n_subtotals += cats->cats[i].type == CCT_SUBTOTAL;
+ if (n_subtotals > 1)
+ {
+ msg_at (SE, cats_location,
+ ngettext ("These categories include %zu instance "
+ "of SUBTOTAL or HSUBTOTAL, so references "
+ "from computed categories must refer to "
+ "subtotals by position.",
+ "These categories include %zu instances "
+ "of SUBTOTAL or HSUBTOTAL, so references "
+ "from computed categories must refer to "
+ "subtotals by position.",
+ n_subtotals),
+ n_subtotals);
+ msg_at (SN, e->location,
+ _("This is the reference that lacks a position."));
+ return NULL;
+ }
+ }