mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-19 21:00:55 +08:00
@ -106,6 +106,7 @@ METAFILE_PATH = $$PWD/../../raster/Metafile
|
||||
$$METAFILE_PATH/svg/SvgObjects/CMask.h \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CPattern.h \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CSymbol.h \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CSwitch.h \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CMarker.h \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CImage.h \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CLine.h \
|
||||
@ -130,6 +131,7 @@ METAFILE_PATH = $$PWD/../../raster/Metafile
|
||||
$$METAFILE_PATH/svg/SvgObjects/CMarker.cpp \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CPattern.cpp \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CSymbol.cpp \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CSwitch.cpp \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CImage.cpp \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CLine.cpp \
|
||||
$$METAFILE_PATH/svg/SvgObjects/CRect.cpp \
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include "SvgObjects/CPattern.h"
|
||||
#include "SvgObjects/CEllipse.h"
|
||||
#include "SvgObjects/CSymbol.h"
|
||||
#include "SvgObjects/CSwitch.h"
|
||||
#include "SvgObjects/CMarker.h"
|
||||
#include "SvgObjects/CCircle.h"
|
||||
#include "SvgObjects/CStyle.h"
|
||||
@ -168,6 +169,11 @@ namespace SVG
|
||||
pObject = CTextPath::Create(oElement, pParent, m_pFontManager, pFile);
|
||||
ReadChildrens(oElement, (CTextPath*)pObject, pFile);
|
||||
}
|
||||
else if (L"switch" == wsElementName)
|
||||
{
|
||||
pObject = new CSwitch(oElement, pParent);
|
||||
ReadChildrens(oElement, (CSwitch*)pObject, pFile);
|
||||
}
|
||||
//defs
|
||||
else if (L"defs" == wsElementName)
|
||||
return ReadChildrens<CRenderedObject>(oElement, NULL, pFile);
|
||||
|
||||
@ -70,6 +70,7 @@ namespace SVG
|
||||
friend class CMask;
|
||||
friend class CTSpan;
|
||||
friend class CMarker;
|
||||
friend class CSwitch;
|
||||
friend class CPattern;
|
||||
friend class CGradient;
|
||||
friend class CClipPath;
|
||||
|
||||
@ -135,6 +135,7 @@ namespace SVG
|
||||
friend class CTSpan;
|
||||
friend class CImage;
|
||||
friend class CCircle;
|
||||
friend class CSwitch;
|
||||
friend class CPolygon;
|
||||
friend class CEllipse;
|
||||
friend class CPolyline;
|
||||
|
||||
29
DesktopEditor/raster/Metafile/svg/SvgObjects/CSwitch.cpp
Normal file
29
DesktopEditor/raster/Metafile/svg/SvgObjects/CSwitch.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include "CSwitch.h"
|
||||
|
||||
namespace SVG
|
||||
{
|
||||
CSwitch::CSwitch(XmlUtils::CXmlNode &oNode, CRenderedObject *pParent)
|
||||
: CRenderedObject(oNode, pParent)
|
||||
{
|
||||
}
|
||||
|
||||
bool CSwitch::Draw(IRenderer *pRenderer, const CSvgFile *pFile, CommandeMode oMode, const TSvgStyles *pStyles) const
|
||||
{
|
||||
for (const CRenderedObject* pObject : m_arObjects)
|
||||
{
|
||||
if (NULL != pObject && pObject->Draw(pRenderer, pFile, oMode, pStyles))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
TBounds CSwitch::GetBounds() const
|
||||
{
|
||||
for (const CRenderedObject* pObject : m_arObjects)
|
||||
if (NULL != pObject)
|
||||
return pObject->GetBounds();
|
||||
|
||||
return TBounds{0., 0., 0., 0.};
|
||||
}
|
||||
}
|
||||
18
DesktopEditor/raster/Metafile/svg/SvgObjects/CSwitch.h
Normal file
18
DesktopEditor/raster/Metafile/svg/SvgObjects/CSwitch.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef CSWITCH_H
|
||||
#define CSWITCH_H
|
||||
|
||||
#include "CContainer.h"
|
||||
|
||||
namespace SVG
|
||||
{
|
||||
class CSwitch : public CRenderedObject, public CContainer<CRenderedObject>
|
||||
{
|
||||
public:
|
||||
CSwitch(XmlUtils::CXmlNode& oNode, CRenderedObject* pParent = NULL);
|
||||
|
||||
bool Draw(IRenderer* pRenderer, const CSvgFile *pFile, CommandeMode oMode = CommandeModeDraw, const TSvgStyles* pStyles = NULL) const override;
|
||||
|
||||
TBounds GetBounds() const override;
|
||||
};
|
||||
}
|
||||
#endif // CSWITCH_H
|
||||
Reference in New Issue
Block a user