sw: style cleanup in GetFieldIdsFromDoc

Change-Id: Ib7141b47d5c2a27b75e47756adb4c644aace721a
fix bad cast in SvxStyleBox_Impl::StateChanged()

This causes various JunitTest crashes on Windows, regression from
887bc4dd3e62fe6dd19dc9d1c3ba273a5b21b5ec.

Change-Id: Iab24e0d39375ac1e5ac63d32470dca1e54d518c5