return the correct immutability

This commit is contained in:
Marco Martin 2014-02-17 12:00:24 +01:00
parent e03570227c
commit 12a766795e

View File

@ -356,12 +356,21 @@ Types::Types::ImmutabilityType Applet::immutability() const
//Returning the more strict immutability between the applet immutability, Containment and Corona
Types::ImmutabilityType upperImmutability = Types::Mutable;
if (!isContainment()) {
if (isContainment()) {
Corona *cor = static_cast<Containment*>(const_cast<Applet*>(this))->corona();
if (cor) {
upperImmutability = cor->immutability();
}
} else {
const Containment *cont = containment();
if (cont) {
if (cont->corona()) {
upperImmutability = cont->corona()->immutability();
} else {
upperImmutability = cont->immutability();
}
}
}
if (upperImmutability != Types::Mutable) {
// it's either system or user immutable, and we already check for local system immutability,