本文整理汇总了C++中CellAddress类的典型用法代码示例。如果您正苦于以下问题:C++ CellAddress类的具体用法?C++ CellAddress怎么用?C++ CellAddress使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CellAddress类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateCell
void SheetView::updateCell(const App::Property *prop)
{
try {
CellAddress address;
sheet->getCellAddress(prop, address);
if (currentIndex().row() == address.row() && currentIndex().column() == address.col() )
updateContentLine();
}
catch (...) {
// Property is not a cell
return;
}
}
示例2: clear
void Sheet::clear(CellAddress address, bool /*all*/)
{
Cell * cell = getCell(address);
std::string addr = address.toString();
Property * prop = props.getDynamicPropertyByName(addr.c_str());
// Remove alias, if defined
std::string aliasStr;
if (cell && cell->getAlias(aliasStr))
this->removeDynamicProperty(aliasStr.c_str());
cells.clear(address);
// Update dependencies
std::set<DocumentObject*> ds(cells.getDocDeps());
// Make sure we don't reference ourselves
ds.erase(this);
std::vector<DocumentObject*> dv(ds.begin(), ds.end());
docDeps.setValues(dv);
propAddress.erase(prop);
this->removeDynamicProperty(addr.c_str());
}
示例3: recomputeCell
void Sheet::recomputeCell(CellAddress p)
{
Cell * cell = cells.getValue(p);
std::string docName = getDocument()->Label.getValue();
std::string docObjName = std::string(getNameInDocument());
std::string name = docName + "#" + docObjName + "." + p.toString();
try {
if (cell) {
cell->clearException();
cell->clearResolveException();
}
updateProperty(p);
cells.clearDirty(p);
cellErrors.erase(p);
}
catch (const Base::Exception & e) {
QString msg = QString::fromUtf8("ERR: %1").arg(QString::fromUtf8(e.what()));
setStringProperty(p, Base::Tools::toStdString(msg));
if (cell)
cell->setException(e.what());
// Mark as erroneous
cellErrors.insert(p);
}
updateAlias(p);
if (!cell || cell->spansChanged())
cellSpanChanged(p);
}
示例4: updateAlias
void Sheet::updateAlias(CellAddress key)
{
std::string alias;
Property * prop = props.getDynamicPropertyByName(key.toString().c_str());
if (!prop)
return;
Cell * cell = getCell(key);
if (cell && cell->getAlias(alias)) {
Property * aliasProp = props.getDynamicPropertyByName(alias.c_str());
/* Update or create alias? */
if (aliasProp) {
// Type of alias and property must always be the same
if (aliasProp->getTypeId() != prop->getTypeId()) {
this->removeDynamicProperty(alias.c_str());
aliasProp = 0;
}
}
if (!aliasProp)
aliasProp = props.addDynamicProperty(prop->getTypeId().getName(), alias.c_str(), 0, 0, Prop_ReadOnly | Prop_Transient);
aliasProp->Paste(*prop);
}
}
示例5: clear
void Sheet::clear(CellAddress address, bool all)
{
Cell * cell = getCell(address);
std::string addr = address.toString();
Property * prop = props.getDynamicPropertyByName(addr.c_str());
// Remove alias, if defined
std::string aliasStr;
if (cell && cell->getAlias(aliasStr))
props.removeDynamicProperty(aliasStr.c_str());
cells.clear(address);
propAddress.erase(prop);
props.removeDynamicProperty(addr.c_str());
}
示例6: setAlias
void Sheet::setAlias(CellAddress address, const std::string &alias)
{
std::string existingAlias = getAddressFromAlias(alias);
if (existingAlias.size() > 0) {
if (existingAlias == address.toString()) // Same as old?
return;
else
throw Base::Exception("Alias already defined");
}
else if (alias.size() == 0) // Empty?
cells.setAlias(address, "");
else if (isValidAlias(alias)) // Valid?
cells.setAlias(address, alias);
else
throw Base::Exception("Invalid alias");
}
示例7: providesTo
void Sheet::providesTo(CellAddress address, std::set<CellAddress> & result) const
{
const char * docName = getDocument()->Label.getValue();
const char * docObjName = getNameInDocument();
std::string fullName = std::string(docName) + "#" + std::string(docObjName) + "." + address.toString();
result = cells.getDeps(fullName);
}
示例8: getDocument
void Sheet::providesTo(CellAddress address, std::set<std::string> & result) const
{
const char * docName = getDocument()->Label.getValue();
const char * docObjName = getNameInDocument();
std::string fullName = std::string(docName) + "#" + std::string(docObjName) + "." + address.toString();
std::set<CellAddress> tmpResult = cells.getDeps(fullName);
for (std::set<CellAddress>::const_iterator i = tmpResult.begin(); i != tmpResult.end(); ++i)
result.insert(std::string(docName) + "#" + std::string(docObjName) + "." + i->toString());
}
示例9: cellUpdated
void SheetModel::cellUpdated(CellAddress address)
{
QModelIndex i = index(address.row(), address.col());
dataChanged(i, i);
}