fdo#77647: Write test for this.

Change-Id: I25b04c4790fcdae1e85b5d7b9cb85792226af757
Make these non inline.

Change-Id: Icfed6fa13a04eb9b2006296421d52c566635ac33
fdo#77647: Expand reference only when the top of the selected range is...

below the top of the reference range.

Change-Id: Ibb3dadb50dd076ae05033b046c9506c60605f713