当前位置: 首页>>代码示例>>C++>>正文


C++ CXmlNode::GetXml方法代码示例

本文整理汇总了C++中xmlutils::CXmlNode::GetXml方法的典型用法代码示例。如果您正苦于以下问题:C++ CXmlNode::GetXml方法的具体用法?C++ CXmlNode::GetXml怎么用?C++ CXmlNode::GetXml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xmlutils::CXmlNode的用法示例。


在下文中一共展示了CXmlNode::GetXml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LoadFromXML

bool CPPTShape::LoadFromXML(XmlUtils::CXmlNode& oNodePict)
{
    std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
    bool isPathList = false;
    if (id != _T(""))
    {
        SetShapeType((PPTShapes::ShapeType)XmlUtils::GetInteger(id));
    }
    else
    {
        XmlUtils::CXmlNode oNodeTemplate;
        if (oNodePict.GetNode(_T("template"), oNodeTemplate))
        {
            std::wstring strAdj = oNodeTemplate.GetAttributeOrValue(_T("adj"));
            LoadAdjustValuesList(strAdj);

            XmlUtils::CXmlNode oNodeGuides;
            if (oNodeTemplate.GetNode(_T("v:formulas"), oNodeGuides))
            {
                LoadGuidesList(oNodeGuides.GetXml());
            }

            std::wstring strPath = oNodeTemplate.GetAttributeOrValue(_T("path"));
            if (strPath != _T(""))
            {
                LoadPathList(strPath);
                isPathList = true;
            }
        }
    }

    XmlUtils::CXmlNode oNodeGuides;
    if (oNodePict.GetNode(_T("path"), oNodeGuides))
    {
        std::wstring strPath = oNodeGuides.GetAttributeOrValue(_T("val"));
        if (strPath != _T(""))
        {
            LoadPathList(strPath);
            isPathList = true;
        }
    }

    if (!isPathList)
        ReCalculate();
    return true;
}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:46,代码来源:PptShape.cpp

示例2: LoadFromXMLShapeType

bool CPPTShape::LoadFromXMLShapeType(XmlUtils::CXmlNode& oNodeShapeType) // vml object
{		// из за особенносей форматирования vmlDrawing могут вылезти пустые текстовые значения - value ..
    std::wstring sId = oNodeShapeType.GetAttribute(_T("o:spt"));

    bool bIsNeedRecalc = true;
    if (sId != _T(""))
    {
        int id = XmlUtils::GetInteger(sId);
        if (id > 0)
        {
            SetShapeType((PPTShapes::ShapeType)id);
            //ReCalculate();
            m_eType = (PPTShapes::ShapeType)id;
        }
    }
    std::wstring strAdj = oNodeShapeType.GetAttribute(_T("adj"));
    if (strAdj != _T(""))
        LoadAdjustValuesList(strAdj);

    XmlUtils::CXmlNode oNodeGuides;
    if (oNodeShapeType.GetNode(_T("v:formulas"), oNodeGuides))
    {
        LoadGuidesList(oNodeGuides.GetXml());
    }

    XmlUtils::CXmlNode oNodePath;
    if (oNodeShapeType.GetNode(_T("v:path"), oNodePath))
    {
        std::wstring strTextR = oNodePath.GetAttribute(_T("textboxrect"));
        if (strTextR != _T(""))
            LoadTextRect(strTextR);
    }

    XmlUtils::CXmlNode oNodeAHs;
    if (oNodeShapeType.GetNode(_T("v:handles"), oNodeAHs))
    {
        LoadAHList(oNodeAHs);
    }

    std::wstring strPath = oNodeShapeType.GetAttribute(_T("path"));
    if (strPath != _T(""))
    {
        LoadPathList(strPath);
    }

    XmlUtils::CXmlNode oNodeTextPath;
    if (oNodeShapeType.GetNode(_T("v:textpath"), oNodeTextPath))
    {
        if (m_eType < PPTShapes::ShapeType::sptCTextPlain || m_eType > PPTShapes::ShapeType::sptCTextCanDown)
            m_eType = PPTShapes::ShapeType::sptCTextPlain;
    }

    std::wstring strFilled = oNodeShapeType.GetAttribute(_T("filled"));
    std::wstring strStroked = oNodeShapeType.GetAttribute(_T("stroked"));

    if (strFilled != _T(""))
    {
        if (strFilled == _T("false") || strFilled == _T("f"))
            m_bIsFilled = false;
        else
            m_bIsFilled = true;
    }

    if (strStroked != _T(""))
    {
        if (strStroked == _T("false") || strStroked == _T("f"))
            m_bIsStroked = false;
        else
            m_bIsStroked = true;
    }
    XmlUtils::CXmlNode oNodeSignature;
    if (oNodeShapeType.GetNode(_T("o:signatureline"), oNodeSignature))
    {
        m_oSignatureLine = oNodeSignature;
    }

    ReCalculate();
    return true;
}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:79,代码来源:PptShape.cpp


注:本文中的xmlutils::CXmlNode::GetXml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。