<commit_before>// 4 december 2014

// TODO find a better place for these
static LONG textHeight(struct table *t, HDC dc, BOOL select)
{
	BOOL release;
	HFONT prevfont, newfont;
	TEXTMETRICW tm;

	release = FALSE;
	if (dc == NULL) {
		dc = GetDC(t->hwnd);
		if (dc == NULL)
			panic("error getting Table DC for rowHeight()");
		release = TRUE;
	}
	if (select)
		prevfont = selectFont(t, dc, &newfont);
	if (GetTextMetricsW(dc, &tm) == 0)
		panic("error getting text metrics for rowHeight()");
	if (select)
		deselectFont(dc, prevfont, newfont);
	if (release)
		if (ReleaseDC(t->hwnd, dc) == 0)
			panic("error releasing Table DC for rowHeight()");
	return tm.tmHeight;
}

#define tableImageWidth() GetSystemMetrics(SM_CXSMICON)
#define tableImageHeight() GetSystemMetrics(SM_CYSMICON)

static LONG rowHeight(struct table *t, HDC dc, BOOL select)
{
	LONG height;
	LONG tmHeight;

	height = tableImageHeight();		// start with this to avoid two function calls
	tmHeight = textHeight(t, dc, select);
	if (height < tmHeight)
		height = tmHeight;
	if (height < t->checkboxHeight)
		height = t->checkboxHeight;
	return height;
}
<commit_msg>More TODOs.<commit_after>// 4 december 2014

// TODO find a better place for these (metrics.h?)
static LONG textHeight(struct table *t, HDC dc, BOOL select)
{
	BOOL release;
	HFONT prevfont, newfont;
	TEXTMETRICW tm;

	release = FALSE;
	if (dc == NULL) {
		dc = GetDC(t->hwnd);
		if (dc == NULL)
			panic("error getting Table DC for rowHeight()");
		release = TRUE;
	}
	if (select)
		prevfont = selectFont(t, dc, &newfont);
	if (GetTextMetricsW(dc, &tm) == 0)
		panic("error getting text metrics for rowHeight()");
	if (select)
		deselectFont(dc, prevfont, newfont);
	if (release)
		if (ReleaseDC(t->hwnd, dc) == 0)
			panic("error releasing Table DC for rowHeight()");
	return tm.tmHeight;
}

#define tableImageWidth() GetSystemMetrics(SM_CXSMICON)
#define tableImageHeight() GetSystemMetrics(SM_CYSMICON)

// TODO omit column types that are not present?
static LONG rowHeight(struct table *t, HDC dc, BOOL select)
{
	LONG height;
	LONG tmHeight;

	height = tableImageHeight();		// start with this to avoid two function calls
	tmHeight = textHeight(t, dc, select);
	if (height < tmHeight)
		height = tmHeight;
	if (height < t->checkboxHeight)
		height = t->checkboxHeight;
	return height;
}

{'fraction_non_alphanumeric': 0.12559139784946236, 'fraction_numerical': 0.006021505376344086, 'mean_word_length': 4.434579439252336, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1163223', 'n_tokens_mistral': 850, 'n_tokens_neox': 808, 'n_words': 260}