Hello werner,
thanks for the feedback. I still think that there is a oddity. The case in question is the following:
1. Create a spreadsheet
2. Add a number and make a cell alias named e.g. "test"
3. Deselect the spreadsheet in the tree
4. Select the spreadsheet in the tree
5. try to edit the property "test"
You find that the editing is possible in the gui, but the python console gives an error that the property is read only. To test this further I added some test code to PropertyItem to test the different ways for detecting the read only status:
Code: Select all
void PropertyItem::setPropertyData(const std::vector<App::Property*>& items)
{
for( std::vector<App::Property*>::const_iterator it = items.begin(); it != items.end(); ++it ) {
Base::Console().Message("Property: %s\n", (*it)->getName());
Base::Console().Message("Container read only: %s\n", (*it)->getContainer()->isReadOnly(*it) ? "true" : "false");
Base::Console().Message("Status bit read only: %s\n", (*it)->StatusBits.test(2) ? "true" : "false");
Base::Console().Message("Property Type read only: %s:\n\n", ((*it)->getContainer()->getPropertyType(*it) & App::Prop_ReadOnly) ? "true" : "false");
};
For the spreadsheet scenario the following output is generated:
Code: Select all
Property: test
Container read only: false
Status bit read only: false
Property Type read only: true
The PropertyItem checks read only with the first two methods, the python code for setting properties uses the last one. They give different results. I really don't know what is the correct thing here, but it does seem odd.