// PrhHistFindChar.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
#include "DynamicDraw.h"
#include "DynamicDrawView.h"	// For g_pView.
#include "HistViewDoc.h"		// For FFHistViewDoc().
#include "HistViewFrame.h"		// For FFHistViewFrame().
#include "ObjLabel.h"			// For FCObjLabel.
#include "RichText.h"			// For FCRichText.
#include "DlgHistFindResults.h"	// For CFCDlgHistFindResults.
#include "HiProject.h"			// For FCHiProject.
#include "PrhHistFindChar.h"	// This header.

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

//----- _xZkqqHx_iDiMiDfHiDfIiDgHiDiKjFnLjBlGjGlM_xHqqkZx_ -----
static const wchar_t* REG_PRH_HIST_FIND_CHAR = L"CFCPrhHistFindChar";

/////////////////////////////////////////////////////////////////////////////
// CFCPrhHistFindChar _xZkqqHx_iDfPiDeDiDeBiDiNiDeP_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrhHistFindChar::CFCPrhHistFindChar
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCPrhHistFindChar::CFCPrhHistFindChar ()
				: BASE_CLASS()
{
	//{{AFX_DATA_INIT(CFCPrhHistFindChar)
	m_bFindCharAttribute = FALSE;
	//}}AFX_DATA_INIT
} // CFCPrhHistFindChar::CFCPrhHistFindChar.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrhHistFindChar::CFCPrhHistFindChar
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCPrhHistFindChar::~CFCPrhHistFindChar ()
{
} // CFCPrhHistFindChar::~CFCPrhHistFindChar.

void CFCPrhHistFindChar::DoDataExchange (CDataExchange* pDX)
{
	BASE_CLASS::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFCPrhHistFindChar)
	DDX_Check(pDX, IDC_HFD_CHR_CHK_FIND_CHAR_ATTRIBUTE, m_bFindCharAttribute);
	//}}AFX_DATA_MAP
} // CFCPrhHistFindChar::DoDataExchange.

BEGIN_MESSAGE_MAP(CFCPrhHistFindChar, BASE_CLASS)
	//{{AFX_MSG_MAP(CFCPrhHistFindChar)
		// _xZkqqHx_iDiBiDiC_xHqqkZx_ - ClassWizard _xZkqqHx_iCmNiClBiCmMiImKjChFiCmJiDhNiDgCiDhDiDjDiDePjHhAiCmMiDhNiDeOiDiNiCpAjCmHiJmBiCnMiClNiCmNiNoNiPjMiClFiCnMiClHiBeC_xHqqkZx_
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFCPrhHistFindChar _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrhHistFindChar::OnSetActive
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhJiBfLiDfHiCkKiDeBiDeOiDgFiDeCiDhFiCmJiCmIiCoJiCmGiCkLiCmJiMmEiCnBiPgPiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPrhHistFindChar::OnSetActive ()
{
	// Superclass_xZkqqHx_iOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnSetActive();
	//----- _xZkqqHx_iDiMiDfHiDfIiDgHiDiKiCkJiCoHiPpDiLlFiCpAiOoGjDlOiClHiCoJ_xHqqkZx_ -----
	g_pReg->LoadRegBinary(	GetRegName(),
							L"m_bFindCharAttribute",
							(BYTE*)&m_bFindCharAttribute,
							sizeof(m_bFindCharAttribute));
} // CFCPrhHistFindChar::OnSetActive.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrhHistFindChar::OnKillActive
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhJiBfLiDfHiCkKiDeBiDeOiDgFiDeCiDhFiCmFiCmIiCkNiCmIiCoJiCmGiCkLiCmJiMmEiCnBiPgPiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPrhHistFindChar::OnKillActive ()
{
	//----- _xZkqqHx_iDiMiDfHiDfIiDgHiDiKiCmJiPpDiLlFiCpAjFnLjBlGiClHiCoJ_xHqqkZx_ -----
	g_pReg->SaveRegBinary(	GetRegName(),
							L"m_bFindCharAttribute",
							(BYTE*)&m_bFindCharAttribute,
							sizeof(m_bFindCharAttribute));
	// Superclass_xZkqqHx_iOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnKillActive();
} // CFCPrhHistFindChar::OnKillActive.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrhHistFindChar::GetRegName
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiMiDfHiDfIiDgHiDiKjDgPjIfOiClHiCoJiClNiCnPiCmMjDgPjIfOjGlMiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiMiDfHiDfIiDgHiDiKjDgPjIfOiClHiCoJiClNiCnPiCmMjDgPjIfOjGlMiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
const wchar_t* CFCPrhHistFindChar::GetRegName () const
{
	return REG_PRH_HIST_FIND_CHAR;
} // CFCPrhHistFindChar::GetRegName.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrhHistFindChar::IsConsistent
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLjAnNjCoIjCgMiCmMjGlFiPiCjAkLiCmMiDgAiDeGiDgCiDeOiCpAiNhDiCkEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jGlDjGlFiPiCiCmMiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBjGlFiPiCiCmMiPoKiNiHiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCPrhHistFindChar::IsConsistent ()
{
	// Superclass_xZkqqHx_iOmAiNhDiBeC_xHqqkZx_
	if (!BASE_CLASS::IsConsistent()) return FALSE;
	// _xZkqqHx_iDgFiDeMiDfIiDgHiCkKiIoKiJnDiPiKiCmFiCoAjBeJjBpAiClDiCoKiCmEiCkCiCoJiCkJiBeI_xHqqkZx_
	BOOL bIsTextSelected = FALSE;
	mdef_const_iterator(ObjDynabaseVector, iObj);
	m1_for (iObj, g_pView->SelectObjVector())
	{
		if ((*iObj)->IsTextSelected())
		{
			bIsTextSelected = TRUE;
			break;
		}
	}
	// _xZkqqHx_iDgFiDeMiDfIiDgHiCkKjBeJjBpAiClDiCoKiCmEiCkCiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ FALSE_xZkqqHx_iBeC_xHqqkZx_
	if (!bIsTextSelected)
	{
		// IDS_ERR_MSG_OBJ_TEXT_NOT_SET = "_xZkqqHx_jFjEjFgJiCmMiDgFiDeMiDfIiDgHiCkKjBeJjBpAiClDiCoKiCmEiCkCiCnMiClJiCpB_xHqqkZx_"
		FFErrorBox(IDS_ERR_MSG_OBJ_TEXT_NOT_SET);
		return FALSE;
	}
	return TRUE;
} // CFCPrhHistFindChar::IsConsistent.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrhHistFindChar::UpdateActivate
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iKgFiDfCiDjDiDgHiDiNiBfLiDiLiCmMjHeMiMpIiBeFjGlDiMpIiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPrhHistFindChar::UpdateActivate ()
{
	// m_bTbcSrhSearchAllDocument_xZkqqHx_iBgJjBfDjFlGiPjBiMjPiNpFiBgKiCmMjCgMiCpAjFnLjBlGiClFiBeB_xHqqkZx_FALSE_xZkqqHx_iCpAiOhHjCoIiClHiCoJiBeC_xHqqkZx_
	// _xZkqqHx_iPoDjFpLiBeBiJlKjFpLiMjPiNpFiCkKjFhDiJmCiCmGiCmIiCoHiCmIiCkCiCoGiCkEiCmJiClHiCoJiClNiCnPiBeC_xHqqkZx_
	const FCAutoBackup<BOOL> backupSearchAllDocument(m_bTbcSrhSearchAllDocument, FALSE);
	// Superclass_xZkqqHx_iOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::UpdateActivate();
	// _xZkqqHx_jBfDjFlGiPjBiCpAiMjPiNpFiCmNjFhDiJmCiBeC_xHqqkZx_
	GetDlgItem(IDC_HFD_TBC_SRH_CHK_SEARCH_ALL_DOCUMENT)->EnableWindow(FALSE);
} // CFCPrhHistFindChar::UpdateActivate.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCPrhHistFindChar::DoFind
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMjPiNpFiCpAiOmAiNhDiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCPrhHistFindChar::DoFind ()
{
	// CFCDlgHistFindResults_xZkqqHx_iCkJiCoH_xHqqkZx_HistoryFind_xZkqqHx_iCpAiOoGjDlOiBeC_xHqqkZx_
	FCHistoryFind& hf = FFHistViewFrame()->GetHtreeFindResults()->GetHistoryFind();
	// _xZkqqHx_iDhGiDiNiDfHiDeGiDeOiDgHiCkKjFmCiClGiCmEiCkCiCoJiPoKiNiHiCmNiDeHiDiJiBfLiBeCiOmAiNnLiCmNiMmEiCmOiCoKiCmIiCkCiCmNiClIiBeC_xHqqkZx_
	if (!g_pProject->IsProjectOpened())
		FFThrowMiscUnknown();
	long lDocumentId = FFHistViewDoc()->GetIsDocumentOpened() ? FFHistViewDoc()->GetDocumentId() : -1;
	flint fliNextSessionIndex = FFHistViewDoc()->GetIsDocumentOpened() ? FFHistViewDoc()->GetNextSessionIndex() : -1;

	//----- ID->_xZkqqHx_jFlGiOjKjBeJjBpAiDgFiBfLiDhFiDiLiCpAiNoMjAkM_xHqqkZx_ -----
	// ID->_xZkqqHx_jFlGiOjKjBeJjBpAiDgFiBfLiDhFiDiLiBeC_xHqqkZx_
	map<DWORD, longRangeVector> mpObjectIdToCharSelect;
	// _xZkqqHx_iDgFiDeMiDfIiDgHjBeJjBpAiCkKiCkAiCoJjFjEjFgJiCpAjBfDiCmEiOoGjDlOiBeC_xHqqkZx_
	DWORDSet stObjId;
	g_pView->GetTextSelectedObjectId(stObjId);
	mdef_const_iterator(DWORDSet, iId);
	m1_for (iId, stObjId)
	{
		// _xZkqqHx_jFjEjFgJiBgJ_xHqqkZx_iId_xZkqqHx_iBgKiCmMiDgFiDeMiDfIiDgHjBeJjBpAjEmNiImNiPfHiNiHiCpAiOoGjDlOiBeC_xHqqkZx_
		longRangeVector& vSelectRange = mpObjectIdToCharSelect[*iId];
		g_pView->GetTextSelection(vSelectRange, *iId);

		// vSelectRange _xZkqqHx_iCmMjBeJjBpAjEmNiImNiCmJiCmNiBeBiJpMiNhDiCpAiKnMiCpBiCmFiCkCiCoJiPoKiNiHiCkKiCkAiCoJiBeC_xHqqkZx_
		// _xZkqqHx_iDgFiDeMiDfIiDgHjFmPiNfIiJnDiPiKiCpAiMjPiNpFiClHiCoJiNnLiBeBjBeJjBpAjEmNiImNiCkKiJpMiNhDiCpAiKnMiCpBiCmFiCkCiCoJiCmG_xHqqkZx_
		// _xZkqqHx_iKnEiIoBiCmBiClNiPoKiPiKiCkKiDhBiDgCiDgHiClHiCoJiPoKiNiHiCkKiCkAiCoJiBeC_xHqqkZx_
		// _xZkqqHx_iClBiCoKiCmNiBeB_xHqqkZx_CFCWndRichEdit_xZkqqHx_iCmJiCkIiCkCiCmEjFlGiPmNiCpAjDpMjHmNiClHiCoJiNnLiBeBiMkJiCkJiCkPiPoD_xHqqkZx_
		// _xZkqqHx_jDpMjHmNiClDiCoKiClNiJpMiNhDiImKjChFiCoGiCoIiCoA_xHqqkZx_FDECMD_INSERT_THIN_LINE_xZkqqHx_iDfCiDhNiDjDiDgIiCkK_xHqqkZx_
		// _xZkqqHx_iIoKiCmCiMoDiCoLiCmJjDpMjHmNiClDiCoKiCoJiClNiCnPiCmFiCkAiCoJiBeC_xHqqkZx_
		// _xZkqqHx_jHoBiCmGiClFiCmEiBeB_xHqqkZx_
		// a->b->c->\n->d->e->f _xZkqqHx_iCmGjDpMjHmNiClHiCoJiPoKiNiHiCpAiNgMiCkGiCmEiCnNiCoJiBeC_xHqqkZx_
		// \n _xZkqqHx_iCmMjDpMjHmNjClMjBePiCmJiBeBiDeHiDgGiDeCiDfOiCmJiCmN_xHqqkZx_"abc"_xZkqqHx_iCkKjDpMjHmNiNmPiCnNiClOiCkKiBeBiClBiCmMiNhDiCmJiCmN_xHqqkZx_
		// _xZkqqHx_iOmAiNnLiCmJiCmN_xHqqkZx_"abc"+"\n"_xZkqqHx_iCkKjAnNjCoIiClDiCoKiCmEiCkCiCoJiBeC_xHqqkZx_
		// _xZkqqHx_iClBiClBiCmF_xHqqkZx_ \n _xZkqqHx_iCpAjDpMjHmNiClHiCoJiCmGiBeBiClBiCmMiJpMiNhDiCmN_xHqqkZx_"abc"_xZkqqHx_iCmMjClMiMoDiCmJjDpMiCoHiClIiCmJiBeB_xHqqkZx_
		// "abc\n"_xZkqqHx_iCmMjClMiMoDiCmJiLpDiCmMiNhDiCkKjBhNjDpMiClDiCoKiCoJiBeCiCmCiCnMiCoIiBeBjBhNjDpMiClFiClNiCmCiCoAiCoIiCmM_xHqqkZx_
		// _xZkqqHx_iImKjChFiCoGiCoIiCoAiIoKiCmCiMoDiCoLiCmJjBhNjDpMiClDiCoKiCoJiCmMiCmFiCkAiCoJiBeC_xHqqkZx_
		// _xZkqqHx_iCoAiClFiCoA_xHqqkZx_ "c\nd" _xZkqqHx_iCpAjBeJjBpAiClFiCmEiJnPiLiOjFpLiMpMiCmJiMjPiNpFiClFiClNiCmGiClHiCoJiCmGiBeB_xHqqkZx_
		// _xZkqqHx_jBeJjBpAiClFiClN_xHqqkZx_ \n _xZkqqHx_iCmN_xHqqkZx_ "c"_xZkqqHx_iCmMiMoDiCmJjDpMjHmNiClDiCoKiClNiCoAiCmMiCmFiCmNiCmIiCkN_xHqqkZx_"a"_xZkqqHx_iCmMjDpMjHmNjBePiCkJiCoH_xHqqkZx_
		// _xZkqqHx_iDeHiDgGiDeCiDfOiCmJiCkAiCmBiClNiCoAiCmMiCmIiCmMiCmFiBeBiNmFiPiJiCnMiCmFjBgLiCmBiCmEiMjPiNpFiClDiCoKiCmEiClFiCnMiCkEiBeC_xHqqkZx_
		// _xZkqqHx_iClBiCoKiCpAjGgIiCkOiClNiCnPiCmJiBeBjBeJjBpAjEmNiImNiCkJiCoHiJpMiNhDiCpAiOoGiCoIiPjMiCkNiBeC_xHqqkZx_

		//----- _xZkqqHx_iJpMiNhDiCmMiImKjChFiCpAiOoGjDlO_xHqqkZx_ -----
		// _xZkqqHx_iJpMiNhDiImKjChFiCmMjEhKjHpBiBeC_xHqqkZx_
		longVector vIndexCR;
		WString wstrText;
		g_pDoc->ObjID2Object(*iId)->GetRichText()->GetText(wstrText);
		for (long lC = 0; lC != wstrText.GetLength(); lC++)
		{
			// _xZkqqHx_iJpMiNhDiCmMiPoKiNiHiCmNjEhKjHpBiCmJjCmHiJmBiBeC_xHqqkZx_
			if (wstrText.GetAt(lC) == L'\n')
				vIndexCR.push_back(lC);
		}
		// _xZkqqHx_iJpMiNhDiImKjChFjEhKjHpBiBeBjBeJjBpAjEmNiImNjEhKjHpBiCmGiCoAjCfAjClCjBjNiJmBiCmFiCkAiCoIiBeBjBeJjBpAjEmNiImNjEhKjHpBiCmN_xHqqkZx_
		// _xZkqqHx_jHnHiCoIiNiHiCkEjDpBiCmCiCmMjEmNiImNiCkKiPgEiCmIiCoJiClBiCmGiCmNjAoCjBmOiCmJjGlDiCkC_xHqqkZx_(View::AppendTextSelection_xZkqqHx_iCmF_xHqqkZx_
		// _xZkqqHx_jClCjAkOiNmPiCnN_xHqqkZx_)_xZkqqHx_iCmMiCmFiBeBjDpBiCmCiCmMjEhKjHpBiCpAjAoGjDkKiCkJiCoHjEoEiKhCiClFiCmEiCkCiCkNiBeC_xHqqkZx_
		longRangeVector::iterator iRange = vSelectRange.begin();
		longVector::iterator iCrIdx = vIndexCR.begin();
		while (iRange != vSelectRange.end() && iCrIdx != vIndexCR.end())
		{
			if (*iCrIdx < iRange->lFrom)
			//----- _xZkqqHx_iJpMiNhDiImKjChFiCkKjBeJjBpAjEmNiImNiCoGiCoIiJlKiCmJiCkAiCoJiPoKiNiH_xHqqkZx_ -----
			{
				// _xZkqqHx_iJpMiNhDiImKjChFiCpAiIoKiCmCiPoDiCmMjEhKjHpBjHhGjBgGiCnGiBeC_xHqqkZx_
				iCrIdx++;
			} else
			if (iRange->lTo <= *iCrIdx)
			//----- _xZkqqHx_iJpMiNhDiImKjChFiCkKjBeJjBpAjEmNiImNiCoGiCoIiPoDiCmJiCkAiCoJiPoKiNiH_xHqqkZx_ -----
			{
				// _xZkqqHx_jBeJjBpAjEmNiImNiCpAiIoKiCmCiPoDiCmMjEhKjHpBjHhGjBgGiCnGiBeC_xHqqkZx_
				iRange++;
			} else
			//----- _xZkqqHx_iJpMiNhDiImKjChFiCkKjBeJjBpAjEmNiImNjDoAiCmJiCkAiCoJiPoKiNiH_xHqqkZx_ -----
			{
				// _xZkqqHx_jBeJjBpAjEmNiImNiCpAiJpMiNhDiImKjChFiCmFjFkKjCgGiClFiCmEiBeBjDpBiCmCiCmMjBeJjBpAjEmNiImNiCpAiNoMjAkMiClHiCoJiBeC_xHqqkZx_
				FClongRange range0(iRange->lFrom, *iCrIdx);
				FClongRange range1(*iCrIdx + 1, iRange->lTo);
				// _xZkqqHx_iNkBiCkAiCoJjBeJjBpAjEmNiImNiCmMjHhGjBgGiCpAiOoGiCoIiPjMiCkNiBeC_xHqqkZx_
				iRange = vSelectRange.erase(iRange);
				if (range0.lFrom < range0.lTo)
				//----- _xZkqqHx_jFkKjCgGiCmMjBePjFjEiCkKjHeMiMpIiCmIiPoKiNiH_xHqqkZx_ -----
				{
					// _xZkqqHx_jBePjFjEjBeJjBpAjEmNiImNiCpAiOoGiCoIiPjMiCkCiClNiImKjChFiCmJjBhNjDpMiClHiCoJiBeC_xHqqkZx_
					iRange = vSelectRange.insert(iRange, range0);
					// _xZkqqHx_jBeJjBpAjEmNiImNiImKjChFiCpAiIoKiCmCiMoDiCoLiCnGiBeC_xHqqkZx_
					iRange++;
				}
				if (range1.lFrom < range1.lTo)
				//----- _xZkqqHx_jFkKjCgGiCmMiMoDjFjEiCkKjHeMiMpIiCmIiPoKiNiH_xHqqkZx_ -----
				{
					// _xZkqqHx_iMoDjFjEjBeJjBpAjEmNiImNiCpAjBePjFjEiCmMiMoDiCmJjBhNjDpMiClHiCoJiBeC_xHqqkZx_
					iRange = vSelectRange.insert(iRange, range1);
					// _xZkqqHx_jBeJjBpAjEmNiImNiImKjChFiCmNiMoDiCoLiCmJiInKjDkOiClFiCmIiCkCiBeC_xHqqkZx_
					// _xZkqqHx_jFkKjCgGiMoDjFjEiCmNiBeBiNfIiCmJjFkKjCgGiClDiCoKiCoJiPoKiNiHiCkKiCkAiCoJiClNiCnPiBeB_xHqqkZx_
					// _xZkqqHx_iOjPiCmMiDiLiBfLiDhGiCmFiJpMiNhDiImKjChFiCmGjEoEiKhCiClHiCoJjFeLjHhGiCkKiCkAiCoJiBeC_xHqqkZx_
				}
			}
		}
	}

	//----- _xZkqqHx_jBeJjBpAjCiGiCmMjFjEjFgJiCkJiCoHiBeBjFjEjFgJ_xHqqkZx_ID_xZkqqHx_iPfHiNiHiCpAiNoMjAkM_xHqqkZx_ -----
	if (m_bTbcLblNarrowByLabel)
	//----- _xZkqqHx_iDiJiDhIiDiLiNgJiCoIiNjOiCnNiMjPiNpFiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iMlLiNnNiCmMjFlGiPjBiCmMjFjEjFgJ_xHqqkZx_ID->_xZkqqHx_iDiJiDhIiDiLiDgFiBfLiDhFiDiLiCpAiNoMjAkMiBeC_xHqqkZx_
		ObjIdToWStringMap mpLabelIdToString;
		GetLabelIdToStringMap(mpLabelIdToString);

		// _xZkqqHx_iDfCiDjDiDhLiDhLiDgCiDeOiDfIjCiGiCmMiDiKiDfIiDgHiPiIjHjNiBeC_xHqqkZx_
		UpdateComboStr();

		// _xZkqqHx_iMjPiNpFiPiIjHjNiBeC_xHqqkZx_
		hf.FindChar(g_pProject->GetFilePathH(),
					mpObjectIdToCharSelect,
					mpLabelIdToString,
					m_wstrTbcLblFindString,
					m_bTbcLblMultiWord,
					m_bTbcLblRegexp,
					m_bTbcLblAsUppercase,
					GetNarrowTimeFrom(),
					GetNarrowTimeUntil(),
					GetNarrowUserId(),
					m_bTbcSrhSearchBefore,
					m_bTbcSrhSearchHigher,
					m_bTbcSrhSearchBeforeBranch,
					m_bTbcSrhSearchAfter,
					m_bTbcSrhSearchAfterBranch,
					lDocumentId,
					fliNextSessionIndex,
					TRUE);
	} else
	//----- _xZkqqHx_iDiJiDhIiDiLiNgJiCoIiNjOiCnNiMjPiNpFiCkKjGlDiCkCiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iMjPiNpFiPiIjHjNiBeC_xHqqkZx_
		hf.FindChar(g_pProject->GetFilePathH(),
					mpObjectIdToCharSelect,
					ObjIdToWStringMap(),
					NULL,
					FALSE,
					FALSE,
					FALSE,
					GetNarrowTimeFrom(),
					GetNarrowTimeUntil(),
					GetNarrowUserId(),
					m_bTbcSrhSearchBefore,
					m_bTbcSrhSearchHigher,
					m_bTbcSrhSearchBeforeBranch,
					m_bTbcSrhSearchAfter,
					m_bTbcSrhSearchAfterBranch,
					lDocumentId,
					fliNextSessionIndex,
					!m_bFindCharAttribute);
	}
} // CFCPrhHistFindChar::DoFind.

/////////////////////////////////////////////////////////////////////////////
// CFCPrhHistFindChar _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiJ_xHqqkZx_
