You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
873 B
C++

#include "StdAfx.h"
#include "CommandModifiFont.h"
#include "ObjTxt.h"
CCommandModifiFont::CCommandModifiFont(void)
{
}
CCommandModifiFont::~CCommandModifiFont(void)
{
}
//b Ϊtrue ʱÉèÖþɲÎÊý
void CCommandModifiFont::SetStringPar(SFontPar &par,bool b)
{
if(b)
{
m_OldFontPar = par;
}
else
{
m_NewFontPar = par;
}
}
void CCommandModifiFont::ExcuteExt()
{
ReCreatObj(true);
}
void CCommandModifiFont::UndoExt()
{
ReCreatObj(false);
}
void CCommandModifiFont::ReCreatObj(bool bExcute)
{
CObjBase *pBase = m_ObjContainer.GetCurOpObj();
if(pBase)
{
CObjTxt *p = dynamic_cast<CObjTxt*>(pBase);
if(bExcute)
{
p->SetFontPar(m_NewFontPar);
}
else
{
p->SetFontPar(m_OldFontPar);
}
p->Creat();
}
}