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.
42 lines
995 B
C++
42 lines
995 B
C++
#include "stdafx.h"
|
|
#include "ActionLayerRenameItem.h"
|
|
#include "SigmaDoc.h"
|
|
#include "SigmaView.h"
|
|
#include "Visitor.h"
|
|
|
|
NAction::CActionLayerRenameItem::CActionLayerRenameItem()
|
|
: CActionItem(nullptr, 0)
|
|
{
|
|
}
|
|
|
|
CActionLayerRenameItem::CActionLayerRenameItem(CSigmaDoc* ppDoc,
|
|
const CString strSourceLayerName, const CString strNewLayerName)
|
|
: CActionItem(ppDoc, ActionTypeLayerRename)
|
|
, m_strSourceLayerName(strSourceLayerName)
|
|
, m_strNewLayerName(strNewLayerName)
|
|
{
|
|
}
|
|
|
|
CActionLayerRenameItem::~CActionLayerRenameItem(void)
|
|
{
|
|
}
|
|
|
|
void CActionLayerRenameItem::Undo()
|
|
{
|
|
CActionItem::Undo();
|
|
GetDoc()->GetDraw()->GetClassList()->ReplaceLayer(m_strNewLayerName, m_strSourceLayerName);
|
|
// this->ReflashLayer();
|
|
}
|
|
|
|
void CActionLayerRenameItem::Redo()
|
|
{
|
|
CActionItem::Redo();
|
|
GetDoc()->GetDraw()->GetClassList()->ReplaceLayer(m_strSourceLayerName, m_strNewLayerName);
|
|
// this->ReflashLayer();
|
|
}
|
|
|
|
void NAction::CActionLayerRenameItem::accept(CActionVisitor& visitor)
|
|
{
|
|
visitor.visit(*this);
|
|
}
|