HotXLS Docs

TXLSLineFormat.CustomDashPattern

Version 2.384.451 adds typed custom line dash arrays to 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;

Each unsigned 32-bit entry is a line-width multiplier, alternating dash, space, dash, space; the represented array uses four-byte elements and does not require an even element count or nonzero multipliers

The supported wire representation has at most 65535 entries; this typed profile does not admit every alternative retained array encoding

Detached reading and editing

Both the getter result and assigned input are detached from the shape's stored array; changing a caller array alone does not edit 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 resolves from the shape's primary local property, then its represented primary document default, then the no-custom default; unsupported master or alternate-property contexts do not acquire a guessed value

The getter exposes the retained represented custom state; it does not prove visual precedence when a non-solid preset coexists with an inherited array

Setting a nonempty 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, while 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 behavior

Known equal assignments preserve document generation and can return under a read lease; real edits require the normal write guard and prepare replacement state before publication

A retained complex empty array remains distinct from explicit no-custom state when deciding whether a write is a no-op

Source-effective copying and Classic persistence

Supported whole-worksheet and selected-group copying owns independent pattern payloads; cross-workbook copying materializes the represented source pattern or explicit no-custom state with its preset, compound line style, line width and line-cap context

A destination custom default does not become active for a source occurrence that had no effective custom pattern; supported copies retain their own Classic state after source release and file or stream reopening

Malformed arrays, inconsistent retained property storage, unrepresented owners and exhausted preparation budgets refuse the additional typed or copy operation before that prepared state is published; this is not a guarantee of arbitrary allocation-failure rollback for every worksheet operation

Validation and preparation limits

The finite typed profile validates complete array framing and actual payload extent; before this operation clones a property table, it also checks retained storage consistency, including scalar properties with hidden payloads and complex properties with competing body providers

Edit preparation checks the final table against 16 MiB and 4095 properties before cloning; copy preparation has a 16 MiB allowance for charged custom entries and their four scalar contexts, plus 8388608 work units for property-key and array inspection

Inherited arrays count separately for each copied occurrence; these preparation limits do not establish a whole-workbook or process-heap memory ceiling

Consumer and rendering boundaries

This increment qualifies library Classic representation, editing and the stated copy profile; it does not qualify custom-pattern appearance, XLSX, ODS or XLSB conversion, or portable custom-dash rendering

The recorded Excel 16 consumer opens the Classic custom-array specimen but removes its custom property when saving a new Classic file; this observation does not establish native preservation or rendering success

A separate attempted custom DrawingML input is refused by that consumer, and the cause has not been established; that observation does not define a general DrawingML custom-pattern rule

Canonical semantic snapshots do not encode custom arrays, including a retained complex empty array, and refuse when an included shape has such an array or an unrepresented line context; portable capture refuses an unsupported custom pattern or unrepresented owner for a shape included in the scene, retaining its existing hidden and off-scene exclusions

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, while 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