tweak the templating to make it easier to declare a WeakReference that
points to a subclass for a weak-capable class.
Which lets us declare some fields with more specific types, and dump a
lot of unnecessary casting.
And make WeakBase be inherited from virtually, so we don't end
up with weird states where two weak refernces could point to two
different parts of the same object.
Reviewed-on: https://gerrit.libreoffice.org/48650Tested-by: Jenkins <email@example.com>
Reviewed-by: Noel Grandin <firstname.lastname@example.org>