Checked with:
a) Null tabstop array with non-zero number of entries
b) Negative number of entries (MSDN is wrong; it is not an error)
c) Single tabwidth of negative size
d) Single specified tabwidth of zero size
- Fix brainfade in previous delta
- Move ellipsification results to static memory; they are going to
have to be referenced inside NextLineW and the arg list is too big
already.
- Add the missing ellipsification result (len_under) to simplify coding.
- Slight correction to prefix tracking for when there are several
underlined characters on a single line (DT_EXPANDTABS only).
- Allocate and free the temporary copy required for DT_MODIFYSTRING
rather than using a fixed size stack array.
- Introduce lastline into the main loop; it simplifies the code and we
are going to need it.
support multiline ellipsification etc. Rather than measuring the text
each time we add a character and breaking once it is too long and
WORDBREAK is enabled, we copy a whole text segment and then measure
it; GetTextExtentPointEx is designed to tell us how much fitted. This
may result in a little rescanning if wordbreak is enabled but will be
well worth while when multiline path ellipsification is brought down
into the NextLine function. Note also that the wordbreak calculation
is a little more complete (e.g. including break-within-word for
DT_EDITCONTROL).
- Recalculate the prefix location if ellipsification alters it. This
carefully does NOT emulate a Microsoft bug in which reprefixing is
wrong when the first character removed by ellipsification is the one
that would have been underlined (under Win98 at least).
modify the input string if it didn't change.
- Correct array size.
- Logically separate the centring from the ellipsification.
- Comment on prefix error.
- Rearrange code into three distinct areas; DrawText, GrayString,
TabbedText.
- Remove unused macros.
- Modify treatment of Tab arguments to fit with observed behaviour.
e.g. DrawTextEx with DT_TABSTOP but null dtp will not take the
setting from the flags. Also only uses bits 15 to 8, not the
higher bits.