/** * Set the class attributes from a passed object. * @param obj text block from which the attributes are taken */ void TextBlock::setAttributesFromObject(TextBlock * obj) { // DON'T set tag here. setIndentationLevel(obj->getIndentationLevel()); setText(obj->getText()); setWriteOutText(obj->getWriteOutText()); m_canDelete = obj->canDelete(); }
/** * Set the class attributes of this object from * the passed element node. * @param root the xmi element from which to load */ void TextBlock::setAttributesFromNode(QDomElement & root) { QString endLine = UMLApp::app()->commonPolicy()->getNewLineEndingChars(); setIndentationLevel(root.attribute("indentLevel", "0").toInt()); setTag(root.attribute("tag", "")); setText(decodeText(root.attribute("text", ""), endLine)); setWriteOutText(root.attribute("writeOutText", "true") == "true" ? true : false); m_canDelete = root.attribute("canDelete", "true") == "true" ? true : false; }
/** * Set the class attributes of this object from * the passed element node. * @param root the xmi element from which to load */ void TextBlock::setAttributesFromNode(QDomElement & root) { QString endLine = UMLApp::app()->commonPolicy()->getNewLineEndingChars(); setIndentationLevel(root.attribute(QLatin1String("indentLevel"), QLatin1String("0")).toInt()); setTag(root.attribute(QLatin1String("tag"))); setText(decodeText(root.attribute(QLatin1String("text")), endLine)); const QString trueStr = QLatin1String("true"); setWriteOutText(root.attribute(QLatin1String("writeOutText"), trueStr) == trueStr); m_canDelete = root.attribute(QLatin1String("canDelete"), trueStr) == trueStr; }