TextDocument: only call substitution method if it is used

One typical usage of substitution is Event_setTextContentFromNotificationMessage
which uses notification message to set the subject and the body of mail
message, which calls the substitution method twice, even if in most of
the cases the subject does not embed any substitution.
Status Job ID Name Coverage
  External
failed ERP5.PerformanceTest-Master

00:37:50