TXLSLineFormat.CustomDashPattern
Version 2.384.451 brings typed custom line dash arrays into the represented Classic shape line profile in lxDraw, alongside the existing preset DashStyle API
Syntax
TXLSLineDashPattern = array of LongWord; property CustomDashPattern: TXLSLineDashPattern read GetCustomDashPattern write SetCustomDashPattern; function TryGetCustomDashPattern( out Value: TXLSLineDashPattern): Boolean;
Every unsigned 32-bit entry is a multiplier of the line width, alternating dash and space; the represented array stores four-byte elements and neither requires an even element count nor forbids zero multipliers
The supported wire form holds no more than 65535 entries; this typed profile does not accept every alternative encoding of a retained array
Detached reading and editing
The result from the getter, like the input assigned to the setter, is detached from the array stored in the shape; altering a caller's array on its own does not change the document
TryGetCustomDashPattern returns False when the retained owner cannot be represented; the property getter raises ERangeError for that state instead of guessing a pattern
For an existing Classic Shape: TXLSShape, assign the pattern explicitly
var Pattern: TXLSLineDashPattern; begin SetLength(Pattern, 4); Pattern[0] := 3; Pattern[1] := 1; Pattern[2] := 1; Pattern[3] := 1; Shape.Line.CustomDashPattern := Pattern; end.
Presets and represented document defaults
The custom array is resolved first from the shape's primary local property, then from its represented primary document default, and finally from the no-custom default; master or alternate-property contexts that are unsupported are not given a guessed value
The getter exposes the represented custom state that is retained; it does not settle visual precedence where a non-solid preset and an inherited array coexist
Setting a non-empty custom pattern selects the solid preset as its companion state; DashStyle = 0 alone therefore does not mean that no custom pattern exists
An empty assignment selects solid; when replacing an active custom state it writes explicit no-custom state so a document-level custom pattern does not resume through inheritance, whilst an already represented no-custom state can remain unchanged
Selecting a preset through DashStyle suppresses an inherited custom pattern; the preset API keeps its represented line-cap behaviour
An assignment known to be equal leaves document generation untouched and can return under a read lease; a genuine edit needs the usual write guard and prepares replacement state before publication
When deciding whether a write is a no-op, a retained complex empty array stays distinct from explicit no-custom state
Source-effective copying and Classic persistence
Supported whole-worksheet and selected-group copying owns independent pattern payloads; cross-workbook copying materialises the represented source pattern or explicit no-custom state with its preset, compound line style, line width and line-cap context
A custom default at the destination does not become active for a source occurrence without an effective custom pattern; supported copies keep their own Classic state after the source is released and after a file or stream reopen
Malformed arrays, inconsistent retained property storage, unrepresented owners and exhausted preparation budgets cause the extra typed or copy operation to be refused before its prepared state is published; that is not a promise of rollback for arbitrary allocation failures across every worksheet operation
Validation and preparation limits
The finite typed profile checks the complete array framing and the actual payload extent; before cloning a property table, the operation also verifies retained storage consistency, covering scalar properties with hidden payloads and complex properties whose body providers compete
Before cloning, edit preparation checks the final table against 16 MiB and 4095 properties; copy preparation allows 16 MiB for charged custom entries and their four scalar contexts, plus 8388608 work units for inspecting property keys and arrays
Each copied occurrence counts inherited arrays separately; these preparation limits do not set a memory ceiling for the whole workbook or the process heap
Consumer and rendering boundaries
This increment qualifies library representation of Classic data, editing and the stated copy profile; it does not qualify the appearance of custom patterns, conversion to XLSX, ODS or XLSB, or portable rendering of custom dashes
The recorded Excel 16 consumer opens the Classic specimen with a custom array but drops its custom property when it saves a new Classic file; that observation proves neither native preservation nor successful rendering
That consumer also refuses a separate attempt at custom DrawingML input, for a cause not yet established; the observation does not lay down a general rule for DrawingML custom patterns
Canonical semantic snapshots leave custom arrays unencoded, a retained complex empty array included, and refuse when a shape in the snapshot holds such an array or an unrepresented line context; portable capture refuses an unsupported custom pattern or unrepresented owner for any shape in the scene, while keeping its existing exclusions for hidden and off-scene shapes
Explicit no-custom state and ordinary preset lines keep their existing supported semantic and portable paths; selecting a non-solid preset and then returning to solid does not itself require custom-pattern rendering, whilst all other existing admission checks remain active
The array and property representation follow [MS-ODRAW] section 2.3.8.19 and section 2.3.8.18