bug 59983: add failing unit test demonstrating formula shifting is apply twice to shared formulas; patch from Luca Martini