starmath: Check for text length.

Fixes fdo32667-1.doc.

Change-Id: Ibe7a9ca83b65e7b13c6b315f1b771f50f0b6fc7a