mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
69 lines
1.5 KiB
C++
69 lines
1.5 KiB
C++
#pragma once
|
|
#include "stdafx.h"
|
|
#include "BaseShape.h"
|
|
|
|
#if defined(PPTX_DEF)
|
|
#include "PPTXShape/PPTXShape.h"
|
|
#endif
|
|
|
|
#if defined(PPT_DEF)
|
|
#include "PPTShape/PPTShape.h"
|
|
#endif
|
|
|
|
#if defined(ODP_DEF)
|
|
#include "OdpShape/OdpShape.h"
|
|
#endif
|
|
|
|
NSPresentationEditor::CBaseShape* NSPresentationEditor::CBaseShape::CreateByType(NSPresentationEditor::NSBaseShape::ClassType ClassType, int ShapeType)
|
|
{
|
|
#if defined(PPTX_DEF)
|
|
if(ClassType == pptx)
|
|
{
|
|
return CPPTXShape::CreateByType((OOXMLShapes::ShapeType)ShapeType);
|
|
}
|
|
#endif
|
|
|
|
#if defined(PPT_DEF)
|
|
if (ClassType == ppt)
|
|
{
|
|
return CPPTShape::CreateByType((PPTShapes::ShapeType)ShapeType);
|
|
}
|
|
#endif
|
|
|
|
#if defined(ODP_DEF)
|
|
if(ClassType == NSPresentationEditor::NSBaseShape::odp)
|
|
{
|
|
return COdpShape::CreateByType((OdpShapes::ShapeType)ShapeType);
|
|
}
|
|
#endif
|
|
return NULL;
|
|
}
|
|
|
|
bool NSPresentationEditor::CBaseShape::SetType(NSPresentationEditor::NSBaseShape::ClassType ClassType, int ShapeType)
|
|
{
|
|
if (ClassType != GetClassType())
|
|
return false;
|
|
|
|
#if defined(PPTX_DEF)
|
|
if(ClassType == pptx)
|
|
{
|
|
return ((CPPTXShape*)this)->SetShapeType((OOXMLShapes::ShapeType)ShapeType);
|
|
}
|
|
#endif
|
|
|
|
#if defined(PPT_DEF)
|
|
if(ClassType == ppt)
|
|
{
|
|
return ((CPPTShape*)this)->SetShapeType((PPTShapes::ShapeType)ShapeType);
|
|
}
|
|
#endif
|
|
|
|
#if defined(ODP_DEF)
|
|
if(ClassType == NSBaseShape::odp)
|
|
{
|
|
return ((COdpShape*)this)->SetShapeType((OdpShapes::ShapeType)ShapeType);
|
|
}
|
|
#endif
|
|
|
|
return false;
|
|
} |