fdo#79578: Properly update formulas upon change in db collection.

Update it to handle formula groups correctly.

(cherry picked from commit 300845922eec7a28bc1da337acd21f138685d759)

Conflicts:
	sc/source/ui/docshell/dbdocfun.cxx
	sc/source/ui/docshell/docfunc.cxx
	sc/source/ui/undo/undocell.cxx
	sc/source/ui/undo/undodat.cxx
	sc/source/ui/unoobj/nameuno.cxx
	sc/source/ui/view/viewfunc.cxx

Change-Id: I009a7fcf3d3fb17ef6951c50534ca6bc1fffc259
Reviewed-on: https://gerrit.libreoffice.org/10604
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>