<commit_before>// InfoEditCtrl.cpp : implementation file
//

#include "stdafx.h"
#include "MGen.h"
#include "InfoEditCtrl.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CInfoEditCtrl

IMPLEMENT_DYNAMIC(CInfoEditCtrl, CRichEditCtrl)

CInfoEditCtrl::CInfoEditCtrl()
{

}

CInfoEditCtrl::~CInfoEditCtrl()
{
}


BEGIN_MESSAGE_MAP(CInfoEditCtrl, CRichEditCtrl)
	ON_WM_GETDLGCODE()
END_MESSAGE_MAP()



// CInfoEditCtrl message handlers




UINT CInfoEditCtrl::OnGetDlgCode()
{
	return CRichEditCtrl::OnGetDlgCode() & (~DLGC_HASSETSEL); // clear the bit 
	//return CRichEditCtrl::OnGetDlgCode();
}

void CInfoEditCtrl::AddText(CString str, COLORREF color, DWORD dwEffects)
{
	// CFE_BOLD | CFE_ITALIC | CFE_STRIKEOUT | CFE_UNDERLINE 
	// CFE_DISABLED CFE_AUTOCOLOR
	//int nOldLines = 0;
	long nInsertionPoint;
	CHARFORMAT cf;

	// Save number of lines before insertion of new text
	//nOldLines = GetLineCount();

	// Initialize character format structure
	cf.cbSize = sizeof(CHARFORMAT);
	cf.dwMask = CFM_COLOR | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT;
	cf.dwEffects = dwEffects;	// To disable CFE_AUTOCOLOR
	cf.crTextColor = color;

	// Set insertion point to end of text
	nInsertionPoint = GetWindowTextLength();
	/*if (nInsertionPoint > 800)
	{
	// Delete first half of text to avoid running into the 64k limit
	SetSel(0, nInsertionPoint / 2);
	ReplaceSel("");
	UpdateData(FALSE);
	}*/
	nInsertionPoint = -1;
	SetSel(nInsertionPoint, -1);

	//  Set the character format
	SetSelectionCharFormat(cf);<commit_msg>Code quality: Codacy optimized 4<commit_after>// InfoEditCtrl.cpp : implementation file
//

#include "stdafx.h"
#include "MGen.h"
#include "InfoEditCtrl.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CInfoEditCtrl

IMPLEMENT_DYNAMIC(CInfoEditCtrl, CRichEditCtrl)

CInfoEditCtrl::CInfoEditCtrl()
{

}

CInfoEditCtrl::~CInfoEditCtrl()
{
}


BEGIN_MESSAGE_MAP(CInfoEditCtrl, CRichEditCtrl)
	ON_WM_GETDLGCODE()
END_MESSAGE_MAP()



// CInfoEditCtrl message handlers




UINT CInfoEditCtrl::OnGetDlgCode()
{
	return CRichEditCtrl::OnGetDlgCode() & (~DLGC_HASSETSEL); // clear the bit 
	//return CRichEditCtrl::OnGetDlgCode();
}

void CInfoEditCtrl::AddText(CString str, COLORREF color, DWORD dwEffects)
{
	// CFE_BOLD | CFE_ITALIC | CFE_STRIKEOUT | CFE_UNDERLINE 
	// CFE_DISABLED CFE_AUTOCOLOR
	//int nOldLines = 0;
	long nInsertionPoint;
	CHARFORMAT cf;

	// Save number of lines before insertion of new text
	//nOldLines = GetLineCount();

	// Initialize character format structure
	cf.cbSize = sizeof(CHARFORMAT);
	cf.dwMask = CFM_COLOR | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT;
	cf.dwEffects = dwEffects;	// To disable CFE_AUTOCOLOR
	cf.crTextColor = color;

	// Set insertion point to end of text
	//nInsertionPoint = GetWindowTextLength();
	/*if (nInsertionPoint > 800)
	{
	// Delete first half of text to avoid running into the 64k limit
	SetSel(0, nInsertionPoint / 2);
	ReplaceSel("");
	UpdateData(FALSE);
	}*/
	nInsertionPoint = -1;
	SetSel(nInsertionPoint, -1);

	//  Set the character format
	SetSelectionCharFormat(cf);
{'fraction_non_alphanumeric': 0.11031565245688253, 'fraction_numerical': 0.00683371298405467, 'mean_word_length': 4.789077212806026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1738258', 'n_tokens_mistral': 1175, 'n_tokens_neox': 1131, 'n_words': 255}