App: fix Expression _moveCells()
The problem is caused by not refreshing ObjectIdentifier internal cache after change.
This commit is contained in:
@@ -185,25 +185,36 @@ std::string App::ObjectIdentifier::getPropertyName() const
|
||||
|
||||
/**
|
||||
* @brief Get Component at given index \a i.
|
||||
* @param i Index to get
|
||||
* @param i: Index to get
|
||||
* @param idx: optional return of adjusted component index
|
||||
* @return A component.
|
||||
*/
|
||||
|
||||
const App::ObjectIdentifier::Component &App::ObjectIdentifier::getPropertyComponent(int i) const
|
||||
const App::ObjectIdentifier::Component &App::ObjectIdentifier::getPropertyComponent(int i, int *idx) const
|
||||
{
|
||||
ResolveResults result(*this);
|
||||
|
||||
assert(result.propertyIndex + i >=0 && static_cast<std::size_t>(result.propertyIndex) + i < components.size());
|
||||
i += result.propertyIndex;
|
||||
if (i < 0 || i >= static_cast<int>(components.size()))
|
||||
FC_THROWM(Base::ValueError, "Invalid property component index");
|
||||
|
||||
return components[result.propertyIndex + i];
|
||||
if (idx)
|
||||
*idx = i;
|
||||
|
||||
return components[i];
|
||||
}
|
||||
|
||||
App::ObjectIdentifier::Component &App::ObjectIdentifier::getPropertyComponent(int i)
|
||||
void App::ObjectIdentifier::setComponent(int idx, Component &&comp)
|
||||
{
|
||||
ResolveResults result(*this);
|
||||
assert(result.propertyIndex + i >=0 &&
|
||||
static_cast<std::size_t>(result.propertyIndex) + i < components.size());
|
||||
return components[result.propertyIndex + i];
|
||||
if (idx < 0 || idx >= static_cast<int>(components.size()))
|
||||
FC_THROWM(Base::ValueError, "Invalid component index");
|
||||
components[idx] = std::move(comp);
|
||||
_cache.clear();
|
||||
}
|
||||
|
||||
void App::ObjectIdentifier::setComponent(int idx, const Component &comp)
|
||||
{
|
||||
setComponent(idx, Component(comp));
|
||||
}
|
||||
|
||||
std::vector<ObjectIdentifier::Component> ObjectIdentifier::getPropertyComponents() const {
|
||||
|
||||
Reference in New Issue
Block a user