xNumFmtAgg may be null if you directly call global ServiceManager's createInstanceWithContext("com.sun.star.text.TextDocument") Change-Id: Id619a3f5c9e3f8281f9ef72db132c64287e027c4