fdo#75977: Clear sheet deleted flags for affected references when undoing.

This will allow formula cells to restore deleted references when they get
recalculated.  With this change, SetDirty() that previosly took no argument
has been renamed to SetAllFormulasDirty(), and it now takes one argument that
stores context information.

(cherry picked from commit 18909ddb30db7ca9416ee2bfb0503753e877f002)

Conflicts:
	sc/inc/document.hxx
	sc/source/ui/docshell/docsh5.cxx
	sc/source/ui/view/spelldialog.cxx

Change-Id: If0de5dc1737a2722b6d61a87644b10a4f921edc5
Reviewed-on: https://gerrit.libreoffice.org/8564
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>