/// <summary>
        /// Determines whether a fixup segment should start based on the provided source and destination text-formatting.
        /// </summary>
        /// <param name="sourceStyle">The current text-formatting at the source.</param>
        /// <param name="destinationStyle">The current text-formatting at the destination.</param>
        /// <param name="fixupSegment">The fixup segment that is currently open for this TextStyle.</param>
        /// <returns>true if the provided fixup segment should be ended and a new fixup segment started, and false
        /// otherwise.</returns>
        private bool ShouldStartFixupSegment(TextStyle sourceStyle, TextStyle destinationStyle, FixupSegment fixupSegment)
        {
            // If we've moved into a range where the source and copy styles don't match (and there's not already an
            // open fixup segment that will make them match) then we should start a fixup segment.
            if (sourceStyle != destinationStyle && (fixupSegment == null || fixupSegment.SourceTextStyle != sourceStyle))
            {
                return true;
            }

            return false;
        }
        /// <summary>
        /// Determines whether a fixup segment should end based on the provided source and destination text-formatting.
        /// </summary>
        /// <param name="sourceStyle">The current text-formatting at the source.</param>
        /// <param name="destinationStyle">The current text-formatting at the destination.</param>
        /// <param name="fixupSegment">The fixup segment that is currently open for this TextStyle.</param>
        /// <returns>true if the provided fixup segment should be ended and false otherwise.</returns>
        private bool ShouldEndFixupSegment(TextStyle sourceStyle, TextStyle destinationStyle, FixupSegment fixupSegment)
        {
            // Can't end a non-existent fixup segment.
            if (fixupSegment == null)
            {
                return false;
            }

            // If we've moved into a range where the source and copy styles match then we should end the fixup segment.
            if (destinationStyle == sourceStyle)
            {
                return true;
            }

            // If we've moved into a range where the open fixup segment doesn't apply anymore then we should end the
            // fixup segment.
            if (fixupSegment.SourceTextStyle != sourceStyle)
            {
                return true;
            }

            return false;
        }