New method RemoveAllChild.

--HG--
branch : develop
This commit is contained in:
dismine 2013-10-25 14:16:07 +03:00
parent 473c90c72c
commit d20667f056
3 changed files with 10 additions and 5 deletions

View file

@ -136,6 +136,14 @@ const VContainer *VAbstractTool::getData()const{
return &data;
}
void VAbstractTool::RemoveAllChild(QDomElement &domElement){
if ( domElement.hasChildNodes() ){
while ( domElement.childNodes().length() >= 1 ){
domElement.removeChild( domElement.firstChild() );
}
}
}
void VAbstractTool::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c){
//коефіцієнти для рівняння відрізку
*a = line.p2().y() - line.p1().y();

View file

@ -55,6 +55,7 @@ protected:
void AddAttribute(QDomElement &domElement, const QString &name, const QString &value);
const VContainer *getData() const;
virtual void RemoveReferens(){}
void RemoveAllChild(QDomElement &domElement);
private:
Q_DISABLE_COPY(VAbstractTool)
};

View file

@ -296,11 +296,7 @@ void VToolDetail::FullUpdateFromGui(int result){
domElement.setAttribute("supplement", QString().setNum(det.getSupplement()));
domElement.setAttribute("closed", QString().setNum(det.getClosed()));
domElement.setAttribute("width", QString().setNum(det.getWidth()));
if ( domElement.hasChildNodes() ){
while ( domElement.childNodes().length() >= 1 ){
domElement.removeChild( domElement.firstChild() );
}
}
RemoveAllChild(domElement);
for(qint32 i = 0; i < det.CountNode(); ++i){
AddNode(domElement, det[i]);
}