#include "stdafx.h"
#include "3Document.h"
#include "3ObjOle.h"			// This header.

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

#ifdef SUPER_CLASS
#undef SUPER_CLASS
#endif

#define SUPER_CLASS MC3ObjBase

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjOle::MC3ObjOle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_FDFoundDoc_xZkqqHx_iCmM_xHqqkZx_InStream_xZkqqHx_iCmFjFeLjHhGiBeC_xHqqkZx_
 *************************************************************************/
MC3ObjOle::MC3ObjOle ()
{
	// m_mmptLeftTop_xZkqqHx_iCmN_xHqqkZx_double_xZkqqHx_iMfOiCpAiOgHiCkEiCmMiCmFiBeB_xHqqkZx_8_xZkqqHx_iCmMjEhLjAjEiCmFiDeBiDiJiDeDiDjDiDiBiDjDiDgHiCkKjDpMiCoJiBeC_xHqqkZx_
	// sizeof(SUPER_CLASS)_xZkqqHx_iCmNiBeB_xHqqkZx_4_xZkqqHx_iCmMjEhLjAjEiClOiCmBiClNiCmMiCmFiBeBjFoCjAlDiCmJ_xHqqkZx_4_xZkqqHx_iCpAjBkLiClHiBeC_xHqqkZx_
	ASSERT(sizeof(SUPER_CLASS) == offsetof(MC3ObjOle, m_mmptLeftTop));
	// memcmp_xZkqqHx_iCmFiDeJiDhFiDfHiDeGiDeOiDgHjEoEiKhCiCpAiClHiCoJiClNiCnPiBeBiNfMjBkCjBmMiDeNiDiDiDgCiDhGiCoAjBfDiCmEiCePiCmFjGiEiCnPiCoJiBeC_xHqqkZx_
	memset(&m_mmptLeftTop, 0, sizeof(MC3ObjOle) - offsetof(MC3ObjOle, m_mmptLeftTop));

	m_pOleItem = NULL;

	m_mmptLeftTop.SetPoint(0, 0);
	m_dRatioX = 1.0;		// OLE_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmGiDhEiDiMiBfLiDiAiCmMiKgHiPgLjEoEiBeC_xHqqkZx_
	m_dRatioY = 1.0;		// OLE_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmGiDhEiDiMiBfLiDiAiCmMiKgHiPgLjEoEiBeC_xHqqkZx_
} // MC3ObjOle::MC3ObjOle.

//----- 05.06.17 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjOle::IsKindOf
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCkKiClBiCmMiMfOiBeBiIlNiCkCiCmNiClBiCmMiMfOiCmMiDfEiDhFiDeOiDiJiDfIiCmMiMfOiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	nType	: _xZkqqHx_jClCiCnHiCoJiMfOiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	TRUE	: nType_xZkqqHx_iMfOiBeBiIlNiCkCiCmNiClLiCmMiDfEiDhFiDeOiDiJiDfIiCmMiPoKiNiH_xHqqkZx_
// *			FALSE	: _xZkqqHx_iClLiCkEiCmFiCmIiCkCiPoKiNiH_xHqqkZx_
// *************************************************************************/
//BOOL MC3ObjOle::IsKindOf (FTObjectType nType) const
//{
//	if (nType == FDOJ_OLE) return TRUE;
//	return SUPER_CLASS::IsKindOf(nType);
//} // MC3ObjOle::IsKindOf.
//----- 05.06.17 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjOle::Type
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDeOiDiJiDfIiCmMiMfOiCpAjFnEiClH_xHqqkZx_.
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDeOiDiJiDfIiCmMiMfO_xHqqkZx_
 *************************************************************************/
FTObjectType MC3ObjOle::Type () const
{
	return FDOJ_OLE;
} // MC3ObjOle::Type.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjOle::OutStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCmJiPjBiCkLiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_iPjBiCkLiPgPiClFjHhAiCmM_xHqqkZx_CArchive
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	m_pOleItem_xZkqqHx_iCmNiDfGiDiKiDeBiDiJiDeDiDfJiCmMjFeLjHhGiCmNiCmIiCkCiBeCjDmHiCnNiNjOiCnNiOjOiCmJiCmNiBeB_xHqqkZx_
 *			Document_xZkqqHx_iCmMiDfGiDiKiDeBiDiJiDeDiDfJiCmFjAnNjCoIiClFiCmEiCkNiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. CArchive_xZkqqHx_iCpA_xHqqkZx_CArchive_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC3ObjOle::OutStream (CArchive& ar)
{
	// Superclass_xZkqqHx_iKnGjAjEiCpAiOmAiNhDiBeC_xHqqkZx_
	SUPER_CLASS::OutStream(ar);

	ar << m_mmptLeftTop;	// _xZkqqHx_iDhEiDiMiBfLiDiAiCmMiNlGiPoDiNmAjFfHiBeC_xHqqkZx_
	ar << m_dRatioX;		// OLE_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmGiDhEiDiMiBfLiDiAiCmMiKgHiPgLjEoEiBeC_xHqqkZx_
	ar << m_dRatioY;		// OLE_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmGiDhEiDiMiBfLiDiAiCmMiKgHiPgLjEoEiBeC_xHqqkZx_
	if (m_pOleItem != NULL)
	{
		ar << WORD(TRUE);
		// OLE_xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCpAiLeMjIfOiBeC_xHqqkZx_
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//		ar.WriteObject(m_pOleItem);
		ar << m_pOleItem;
	} else
	{
		ar << WORD(FALSE);
	}

} // MC3ObjOle::OutStream.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjOle::InStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCkJiCoHjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_jDmHiCnNiNjOiCnNjHhAiCmM_xHqqkZx_CArchive
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	m_pOleItem_xZkqqHx_iCmNiDfGiDiKiDeBiDiJiDeDiDfJiCmMjFeLjHhGiCmNiCmIiCkCiBeCjDmHiCnNiNjOiCnNiOjOiCmJiCmNiBeB_xHqqkZx_
 *			Document_xZkqqHx_iCmMiDfGiDiKiDeBiDiJiDeDiDfJiCmFjAnNjCoIiClFiCmEiCkNiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. CArchive_xZkqqHx_iCpA_xHqqkZx_CArchive_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC3ObjOle::InStream (CArchive& ar)
{
	SUPER_CLASS::InStream(ar);

	//----- _xZkqqHx_iDhEiDeAiDeDiDiLiDgPiBfLiDfHiDiHiDjDiCkK_xHqqkZx_3.0_xZkqqHx_iImIiNhOiCmMiPoKiNiH_xHqqkZx_ -----
	ar >> m_mmptLeftTop;	// _xZkqqHx_iDhEiDiMiBfLiDiAiCmMiNlGiPoDiNmAjFfHiBeC_xHqqkZx_
	ar >> m_dRatioX;		// OLE_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmGiDhEiDiMiBfLiDiAiCmMiKgHiPgLjEoEiBeC_xHqqkZx_
	ar >> m_dRatioY;		// OLE_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmGiDhEiDiMiBfLiDiAiCmMiKgHiPgLjEoEiBeC_xHqqkZx_
	WORD wIsOle;
	ar >> wIsOle;
	if (wIsOle)
	{
		// OLE_xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCpAjAlGjAkMiBeBiDgIiDeMiDiFiDiBiDjDiDgHiCmJjCmHiJmBiBeC_xHqqkZx_
		CDocItem* pItem;
// 06.05.10 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//		ar.ReadObject(pItem);
		ar >> pItem;
		// OLE_xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiCpAjAnNjCoIiBeC_xHqqkZx_
		m_pOleItem = (COleClientItem*)pItem;
	}
	else
	{
		m_pOleItem = NULL;
	}
} // MC3ObjOle::InStream.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjOle::~MC3ObjOle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *************************************************************************/
MC3ObjOle::~MC3ObjOle ()
{
	if (m_pOleItem != NULL)
	{
		// _xZkqqHx_iDeBiDhGiDiKiPeJjHlJiOjOiCmJ_xHqqkZx_ m_pOleItem->Delete();_xZkqqHx_iCpAiOmAiNhDiClHiCoJiCmG_xHqqkZx_
		// Mol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