void DataSourceControlWidget::setDataSource(DataSource *dataSource) { mDataSource = dataSource; ui->nameLabel->setText(mDataSource->getDataSourceName()); ui->aliasLineEdit->setText(mDataSource->getDataSourceAlias()); ui->timeDeviationLineEdit->setText(QString::number(mDataSource->timeDeviation())); if (mDataSourceObserverTimer != 0) { killTimer(mDataSourceObserverTimer); mDataSourceObserverTimer = 0; } if (!dataSource->isDataReady()) { mDataSourceObserverTimer = startTimer(1000); ui->saveAsPushButton->hide(); } auto graphStyle = mDataSource->graphStyle(); ui->isStyleAvailableCheckBox->setChecked(graphStyle->isSpecified()); if (graphStyle->isSpecified()) { ui->graphStyleWidget->show(); initiazeStyleWidgets(); } else { ui->graphStyleWidget->hide(); } auto dataSourceWrapper = std::make_shared<DataSourceFilterContainer>(); dataSourceWrapper->setDataSource(mDataSource); ui->filterContainerWidget->setModel(dataSourceWrapper); }
void RenderingRuleSearchRequest::printDebugResult() { if (searchResult) { printf("\n Found : "); HMAP::hash_map<string, RenderingRuleProperty*>::iterator it = PROPS->properties.begin(); for (; it != PROPS->properties.end(); ++it) { RenderingRuleProperty* rp = it->second; if (!rp->input && isSpecified(rp)) { printf(" %s=", rp->attrName.c_str()); if (rp->isString()) { printf("\"%s\"", getStringPropertyValue(rp).c_str()); } else if (rp->isFloat()) { printf("%f", getFloatPropertyValue(rp)); } else if (rp->isColor()) { printf("%s", colorToString(getIntPropertyValue(rp)).c_str()); } else if (rp->isIntParse()) { printf("%d", getIntPropertyValue(rp)); } } } printf("\n"); } else { printf("\nNot found\n"); } }
XERCES_CPP_NAMESPACE_BEGIN /* * The handling of the value field being either the first child node (a * ChildNode*) or directly the value (a DOMString) is rather tricky. In the * DOMString case we need to get the field in the right type so that the * compiler is happy and the appropriate operator gets called. This is * essential for the reference counts of the DOMStrings involved to be updated * as due. * This is consistently achieved by taking the address of the value field and * changing it into a DOMString*, and then dereferencing it to get a DOMString. * The typical piece of code is: * DOMString *x = (DomString *)&value; * ... use of *x which is the DOMString ... * This was amended by neilg after memory management was * introduced. Now a union exists which is either a * DOMString * or a ChildNode *. This will be less efficient * (one more dereference per access) but actually works on all the * compilers we support. */ AttrImpl::AttrImpl(DocumentImpl *ownerDoc, const DOMString &aName) : NodeImpl (ownerDoc) { name = aName.clone(); isSpecified(true); hasStringValue(true); value.child = null; };
void Attr::setValue(String * newvalue) throw(DOMException) { if (isReadOnly()) throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR); if (newvalue == null) { if (isId()) removeIdRef(); while (text != null) removeChild(text); return; } if (text == null) { text = getOwnerDocument()->createTextNode(newvalue); text->isFirstChild(true); text->previousSibling = text; text->ownerNode = this; text->isOwned(true); addIdRef(); } else { removeIdRef(); while (text->getNextSibling() != null) { removeChild(text->getNextSibling()); } text->setData(newvalue); addIdRef(); } isSpecified(true); }
/*------------------------------------------------*/ static AzOut *reset_out(const char *fn, AzOfs &ofs, AzOut &out) { AzOut *out_ptr = NULL; if (isSpecified(fn)) { ofs.open(fn, ios_base::out); ofs.set_to(out); out_ptr = &out; } return out_ptr; }
AttrImpl::AttrImpl(const AttrImpl &other, bool deep) : NodeImpl(other) { name = other.name.clone(); isSpecified(other.isSpecified()); /* We must initialize the void* value to null in *all* cases. Failing to do * so would cause, in case of assignment to a DOMString later, its content * to be derefenced as a DOMString, which would lead the ref count code to * be called on something that is not actually a DOMString... Really bad * things would then happen!!! */ value.child = null; hasStringValue(other.hasStringValue()); if (other.isIdAttr()) { isIdAttr(true); this->getOwnerDocument()->getNodeIDMap()->add(this); } // take care of case where there are kids if (!hasStringValue()) { cloneChildren(other); } else { if(other.value.str == null) { if(value.str != null) { *(value.str) = null; delete value.str; value.str = null; } } else { // get the address of the value field of this as a DOMString* DOMString *x = (value.str == null ?(value.str = new (getOwnerDocument()->getMemoryManager()) DOMString()) :value.str ); // and the address of the value field of other as a DOMString* DOMString *y = other.value.str; // We can now safely do the cloning and assignement, both operands // being a DOMString their ref counts will be updated appropriately *x = y->clone(); } } };
void AttrImpl::setValue(const DOMString &newvalue) { if (isReadOnly()) { throw DOM_DOMException ( DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR, null ); } // If this attribute was of type ID and in the map, take it out, // then put it back in with the new name. For now, we don't worry // about what happens if the new name conflicts // if (isIdAttr()) this->getOwnerDocument()->getNodeIDMap()->remove(this); if (!hasStringValue() && value.str != null) { NodeImpl *kid; while ((kid = value.child) != null) { // Remove existing kids removeChild(kid); if (kid->nodeRefCount == 0) NodeImpl::deleteIf(kid); } } // directly store the string as the value by changing the value field // into a DOMString DOMString *x = (value.str == null ?(value.str = new (getOwnerDocument()->getMemoryManager()) DOMString()) :value.str ); if (newvalue != null) { *x = newvalue.clone(); } else { *x = null; delete x; value.str = null; } hasStringValue(true); isSpecified(true); changed(); if (isIdAttr()) this->getOwnerDocument()->getNodeIDMap()->add(this); };
void Attr::setOwnerElement(Element * e) { if (e == null) { if (ownerNode != null) { ownerNode = getOwnerDocument(); isOwned(false); isSpecified(true); isId(false); } } else { if (isOwned()) throw DOMException(DOMException::INUSE_ATTRIBUTE_ERR); ownerNode = e; isOwned(true); setId(); } }
static bool isSpecified(const AzBytArr *s) { if (s == NULL || s->length() <= 0) return false; return isSpecified(s->c_str()); }
void AttrImpl::setSpecified(bool arg) { isSpecified(arg); };
bool AttrImpl::getSpecified() { return isSpecified(); };
bool Attr::getSpecified() const { return isSpecified(); }