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/docshell/docsh5.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
	sc/source/ui/view/dbfunc.cxx

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