LHR longhaul catering is prepared by Gate Gourmet. They have a rather sophisticated software system that is fed directly from BA's reservations systems. The prep for the next days flights is done hours in advance and the carts are stored in huge coolers awaiting delivery.
At dispatch time (usually 60-90 mins prior to departure), the dispatch supervisor will do the final check and update the figures inc. last minute special meal requests where possible. If the cancellation was fed into the system before the dispatch, it is extremely likely the cancelled SPML was reallocated to another flight leaving at a similar time which had a corresponding last minute SPML request.
Gate Gourmet, LSG and Alpha have all invested quite heavily in software to make catering planning a lot more streamlined and to eliminate waste.