Skip to content

2.1.0

Choose a tag to compare

@iliaal iliaal released this 02 Jun 02:44
2.1.0
297785d

Added

  • libxl 5.2.0 support. New methods, available when built against libxl 5.2.0 or newer: - ExcelSheet::dataValidationSize() — number of data validations on the sheet. - ExcelSheet::dataValidation(int $index) — read a data validation by zero-based index, returned as an associative array (type, op, row_first, row_last, col_first, col_last, value1, value2); false for an out-of-range index. Note: libxl only surfaces validations parsed from xlsx files written by Excel (or another standards-compliant writer), not those added in the same session via addDataValidation(). - ExcelTable::isAutoFilter() — whether the table has an autofilter. - ExcelTable::removeFilter() — remove the table's autofilter.

Fixed

  • Reject child-wrapper handles from a different ExcelBook. libxl Format/Font/RichString/AutoFilter/ConditionalFormat handles are scoped to the workbook that created them; applying one to another workbook silently produced wrong output and could dangle once the source book was freed. ExcelSheet::write/writeRow/writeCol/setCellFormat/writeError/ setColWidth/setRowHeight/setColPx/setRowPx/writeRichStr/ applyFilter2, ExcelFormat::setFont, and the ExcelConditionalFormatting rule methods now return false with a warning instead. Template-copy methods (ExcelBook::addFormat/addFont/insertSheet) still accept a handle from another book by design.
  • Reject out-of-range values at every public libxl integer/enum/color boundary instead of silently truncating the 64-bit argument to int. This covers the full surface, not only set* methods: - Setters: ExcelSheet (setZoom, setZoomPrint, setPaper, setPrintFit, setBorder, setColPx/setRowPx pixel sizes, setTabColor, setRightToLeft, writeComment width/height, setProtect enhanced-protection bitmask), ExcelBook (setCalcMode, setDefaultFont size), ExcelConditionalFormat (all setBorder*, setNumFormat, setFillPattern, setPattern*Color), ExcelFormControl (setChecked, setDropLines, setDx, setFirstButton, setHoriz, setInc, setMax, setMin, setSel), ExcelTable::setStyle, and ExcelFilterColumn::setCustomFilter operators. - Other ExcelBook int boundaries: colorUnpack (colour index — now also upper-bounded), addFormatFromStyle (builtin-style id), packDateValues (year upper bound; month/day/time were already checked), and getCustomFormat (id — had a < 1 check but no upper bound). - Named-range scope: ExcelSheet::setNamedRange, delNamedRange, and getNamedRange passed scope_id to libxl unchecked, so a 64-bit value could alias the SCOPE_WORKBOOK (-1) sentinel or a different sheet after narrowing. Now bounded to [SCOPE_UNDEFINED (-2), INT_MAX], preserving both documented scope sentinels. - Add/rule/constructor APIs: ExcelSheet::addDataValidation/ addDataValidationDouble (type/op/error-style), addIgnoredError, addTable (style), the ExcelConditionalFormatting rule methods (addRule, addTopRule, addOpNumRule, addOpStrRule, addAboveAverageRule, addTimePeriodRule, and the 2-/3-colour-scale rules' colour and type enums), and ExcelTable::__construct (style). - ExcelSheet::setTabRgbColor requires each component in 0-255. Documented -1 sentinels (PROT_DEFAULT, setCustomFilter's absent second operator, named-range scope) are preserved. ExcelFormat/ExcelFont setters were already range-checked.

Changed

  • Tightened the published parameter types for several ExcelSheet setters that were declared mixed but parse a concrete scalar: setZoom/setZoomPrint (int), setPrintGridlines/setLandscape/setHCenter/setVCenter (bool), setMarginLeft/setMarginRight/setMarginTop/setMarginBottom (float), and setHeader/setFooter (string, float). Reflection and static analysis now report the real signatures.