fix(skd-compile): remove spurious vMerge flag from source cells in template DSL

The vertical merge flag (ОбъединятьПоВертикали) was incorrectly placed on
both the source cell (with content) and continuation cells ("|"). 1C only
expects it on continuation cells. Removed startsVMerge logic from both
PS1 and PY scripts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-04-07 16:49:56 +03:00
parent 123fc41b06
commit e2924c4ae0
3 changed files with 2289 additions and 2315 deletions
@@ -1,4 +1,4 @@
# skd-compile v1.7 — Compile 1C DCS from JSON
# skd-compile v1.8 — Compile 1C DCS from JSON
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$DefinitionFile,
@@ -1231,12 +1231,6 @@ function Emit-AreaTemplateDSL {
$w = if ($c -lt $widths.Count) { [double]$widths[$c] } else { 0 }
$isVMerged = $vMerge[$r][$c] -eq $true
$isHMerged = $hMerge[$r][$c] -eq $true
# Check if this cell starts a vertical merge (next row has "|" in same column)
$startsVMerge = $false
for ($nr = $r + 1; $nr -lt $rows.Count; $nr++) {
if ($vMerge[$nr][$c] -eq $true) { $startsVMerge = $true } else { break }
}
X "`t`t`t`t<dcsat:tableCell>"
if ($isVMerged) {
# Vertically merged cell — only appearance with vMerge flag + width
@@ -1281,7 +1275,7 @@ function Emit-AreaTemplateDSL {
# Appearance
$h = if ($r -eq 0) { $minHeight } else { 0 }
if (-not $cellExtraItems) { $cellExtraItems = @() }
Emit-CellAppearance $style $w $startsVMerge $false $h $cellExtraItems
Emit-CellAppearance $style $w $false $false $h $cellExtraItems
$cellExtraItems = @()
}
X "`t`t`t`t</dcsat:tableCell>"
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# skd-compile v1.7 — Compile 1C DCS from JSON
# skd-compile v1.8 — Compile 1C DCS from JSON
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import json
@@ -1041,14 +1041,6 @@ def _emit_area_template_dsl(lines, t):
w = float(widths[c]) if c < len(widths) else 0
is_v_merged = v_merge.get(r, {}).get(c, False)
is_h_merged = h_merge.get(r, {}).get(c, False)
# Check if this cell starts a vertical merge
starts_v_merge = False
for nr in range(r + 1, len(rows)):
if v_merge.get(nr, {}).get(c, False):
starts_v_merge = True
else:
break
lines.append('\t\t\t\t<dcsat:tableCell>')
if is_v_merged:
_emit_cell_appearance(lines, style, w, True)
@@ -1086,7 +1078,7 @@ def _emit_area_template_dsl(lines, t):
lines.append('\t\t\t\t\t\t</dcsat:value>')
lines.append('\t\t\t\t\t</dcsat:item>')
h = min_height if r == 0 else 0
_emit_cell_appearance(lines, style, w, starts_v_merge, False, h, cell_extra_items or None)
_emit_cell_appearance(lines, style, w, False, False, h, cell_extra_items or None)
lines.append('\t\t\t\t</dcsat:tableCell>')
lines.append('\t\t\t</dcsat:item>')
File diff suppressed because it is too large Load Diff