Skip to main content

Метод Cell::getProtectionProperties

Метод возвращает параметры защиты ячейки табличного документа (см. Защита листа табличного документа).

Вызов​


boost::optional<CellProtectionProperties> getProtectionProperties()

Возвращает​

  • CellProtectionProperties: свойства защиты ячейки (boost::none, если ячейка находится в сводной таблице).

Пример​


Table firstSheet = document.getBlocks().getTable(0).get();
Cell cell = firstSheet.getCell("A3");

CellProtectionProperties cellProps = cell.getProtectionProperties().get();
cellProps.lockedForChanges = false;
cellProps.formulasNotDisplayed = false;

cell.setProtectionProperties(cellProps);
firstSheet.setProtection(tableProps);