Spreadsheet: change alias handling

No longer add dynamic property for alias, simply rely on
get(Dynamic)PropertyByName() to check for aliases.

Add new API PropertyContainer::getPropertyNamedList() so that
ExpressionCompleter can discover properties with aliases.
This commit is contained in:
Zheng, Lei
2019-12-26 19:02:04 +08:00
committed by Chris Hennes
parent 79cda0a1b7
commit 2a3951ca32
10 changed files with 108 additions and 104 deletions

View File

@@ -101,6 +101,12 @@ void PropertyContainer::getPropertyList(std::vector<Property*> &List) const
getPropertyData().getPropertyList(this,List);
}
void PropertyContainer::getPropertyNamedList(std::vector<std::pair<const char*, Property*> > &List) const
{
dynamicProps.getPropertyNamedList(List);
getPropertyData().getPropertyNamedList(this,List);
}
void PropertyContainer::setPropertyStatus(unsigned char bit,bool value)
{
std::vector<Property*> List;
@@ -586,6 +592,18 @@ void PropertyData::getPropertyList(OffsetBase offsetBase,std::vector<Property*>
List.push_back((Property *) (spec.Offset + offsetBase.getOffset()));
}
void PropertyData::getPropertyNamedList(OffsetBase offsetBase,
std::vector<std::pair<const char*,Property*> > &List) const
{
merge();
size_t base = List.size();
List.reserve(base+propertyData.size());
for (auto &spec : propertyData.get<0>()) {
auto prop = (Property *) (spec.Offset + offsetBase.getOffset());
List.emplace_back(prop->getName(),prop);
}
}
/** \defgroup PropFrame Property framework