#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(pBase); if(bExcute) { p->SetFontPar(m_NewFontPar); } else { p->SetFontPar(m_OldFontPar); } p->Creat(); } }