[DEV] update to the exml patch
This commit is contained in:
parent
18832b2305
commit
b8bb3aebf2
@ -49,13 +49,13 @@ bool esvg::Circle::Parse(exml::Element * _element, agg::trans_affine& _parentTra
|
|||||||
if (content.Size()!=0) {
|
if (content.Size()!=0) {
|
||||||
m_radius = ParseLength(content);
|
m_radius = ParseLength(content);
|
||||||
} else {
|
} else {
|
||||||
SVG_ERROR("(l "<<_element->Pos()<<") Circle \"r\" is not present");
|
SVG_ERROR("(l "<<_element->GetPos()<<") Circle \"r\" is not present");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 > m_radius) {
|
if (0 > m_radius) {
|
||||||
m_radius = 0;
|
m_radius = 0;
|
||||||
SVG_ERROR("(l "<<_element->Pos()<<") Circle \"r\" is negative");
|
SVG_ERROR("(l "<<_element->GetPos()<<") Circle \"r\" is negative");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_sizeMax.setValue(m_position.x() + m_radius, m_position.y() + m_radius);
|
_sizeMax.setValue(m_position.x() + m_radius, m_position.y() + m_radius);
|
||||||
|
@ -50,14 +50,14 @@ bool esvg::Ellipse::Parse(exml::Element * _element, agg::trans_affine& _parentTr
|
|||||||
if (content.Size()!=0) {
|
if (content.Size()!=0) {
|
||||||
m_r.setX(ParseLength(content));
|
m_r.setX(ParseLength(content));
|
||||||
} else {
|
} else {
|
||||||
SVG_ERROR("(l "<<_element->Pos()<<") Ellipse \"rx\" is not present");
|
SVG_ERROR("(l "<<_element->GetPos()<<") Ellipse \"rx\" is not present");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
content = _element->GetAttribute("ry");
|
content = _element->GetAttribute("ry");
|
||||||
if (content.Size()!=0) {
|
if (content.Size()!=0) {
|
||||||
m_r.setY(ParseLength(content));
|
m_r.setY(ParseLength(content));
|
||||||
} else {
|
} else {
|
||||||
SVG_ERROR("(l "<<_element->Pos()<<") Ellipse \"ry\" is not present");
|
SVG_ERROR("(l "<<_element->GetPos()<<") Ellipse \"ry\" is not present");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_sizeMax.setValue(m_c.x() + m_r.x(), m_c.y() + m_r.y());
|
_sizeMax.setValue(m_c.x() + m_r.x(), m_c.y() + m_r.y());
|
||||||
|
@ -82,13 +82,13 @@ bool esvg::Group::Parse(exml::Element * _element, agg::trans_affine& _parentTran
|
|||||||
} else if (child->GetValue() == "text") {
|
} else if (child->GetValue() == "text") {
|
||||||
elementParser = new esvg::Text(m_paint);
|
elementParser = new esvg::Text(m_paint);
|
||||||
} else {
|
} else {
|
||||||
SVG_ERROR("(l "<<child->Pos()<<") node not suported : \""<<child->GetValue()<<"\" must be [g,a,path,rect,circle,ellipse,line,polyline,polygon,text]");
|
SVG_ERROR("(l "<<child->GetPos()<<") node not suported : \""<<child->GetValue()<<"\" must be [g,a,path,rect,circle,ellipse,line,polyline,polygon,text]");
|
||||||
}
|
}
|
||||||
if (NULL == elementParser) {
|
if (NULL == elementParser) {
|
||||||
SVG_ERROR("(l "<<child->Pos()<<") error on node: \""<<child->GetValue()<<"\" allocation error or not supported ...");
|
SVG_ERROR("(l "<<child->GetPos()<<") error on node: \""<<child->GetValue()<<"\" allocation error or not supported ...");
|
||||||
} else {
|
} else {
|
||||||
if (false == elementParser->Parse(child, m_transformMatrix, tmpPos)) {
|
if (false == elementParser->Parse(child, m_transformMatrix, tmpPos)) {
|
||||||
SVG_ERROR("(l "<<child->Pos()<<") error on node: \""<<child->GetValue()<<"\" Sub Parsing ERROR");
|
SVG_ERROR("(l "<<child->GetPos()<<") error on node: \""<<child->GetValue()<<"\" Sub Parsing ERROR");
|
||||||
delete(elementParser);
|
delete(elementParser);
|
||||||
elementParser = NULL;
|
elementParser = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@ -79,7 +79,7 @@ bool esvg::Path::Parse(exml::Element * _element, agg::trans_affine& _parentTrans
|
|||||||
|
|
||||||
etk::UString elementXML1 = _element->GetAttribute("d");
|
etk::UString elementXML1 = _element->GetAttribute("d");
|
||||||
if (elementXML1.Size()==0) {
|
if (elementXML1.Size()==0) {
|
||||||
SVG_ERROR("(l "<<_element->Pos()<<") path: missing 'p' attribute");
|
SVG_ERROR("(l "<<_element->GetPos()<<") path: missing 'p' attribute");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SVG_VERBOSE("Parse Path : \"" << elementXML << "\"");
|
SVG_VERBOSE("Parse Path : \"" << elementXML << "\"");
|
||||||
|
@ -36,7 +36,7 @@ bool esvg::Polyline::Parse(exml::Element * _element, agg::trans_affine& _parentT
|
|||||||
|
|
||||||
etk::UString sss1 = _element->GetAttribute("points");
|
etk::UString sss1 = _element->GetAttribute("points");
|
||||||
if (sss1.Size()==0) {
|
if (sss1.Size()==0) {
|
||||||
SVG_ERROR("(l "<<_element->Pos()<<") polyline: missing points attribute");
|
SVG_ERROR("(l "<<_element->GetPos()<<") polyline: missing points attribute");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_sizeMax.setValue(0,0);
|
_sizeMax.setValue(0,0);
|
||||||
|
@ -121,14 +121,14 @@ esvg::Document::Document(const etk::UString& _fileName) : m_renderedElement(NULL
|
|||||||
// Node ignore : generaly inkscape data
|
// Node ignore : generaly inkscape data
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
SVG_ERROR("(l "<<child->Pos()<<") node not suported : \""<<child->GetValue()<<"\" must be [title,g,a,path,rect,circle,ellipse,line,polyline,polygon,text,metadata]");
|
SVG_ERROR("(l "<<child->GetPos()<<") node not suported : \""<<child->GetValue()<<"\" must be [title,g,a,path,rect,circle,ellipse,line,polyline,polygon,text,metadata]");
|
||||||
}
|
}
|
||||||
if (NULL == elementParser) {
|
if (NULL == elementParser) {
|
||||||
SVG_ERROR("(l "<<child->Pos()<<") error on node: \""<<child->GetValue()<<"\" allocation error or not supported ...");
|
SVG_ERROR("(l "<<child->GetPos()<<") error on node: \""<<child->GetValue()<<"\" allocation error or not supported ...");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (false == elementParser->Parse(child, m_transformMatrix, size)) {
|
if (false == elementParser->Parse(child, m_transformMatrix, size)) {
|
||||||
SVG_ERROR("(l "<<child->Pos()<<") error on node: \""<<child->GetValue()<<"\" Sub Parsing ERROR");
|
SVG_ERROR("(l "<<child->GetPos()<<") error on node: \""<<child->GetValue()<<"\" Sub Parsing ERROR");
|
||||||
delete(elementParser);
|
delete(elementParser);
|
||||||
elementParser = NULL;
|
elementParser = NULL;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user