diff --git a/.claude/skills/mxl-decompile/scripts/mxl-decompile.ps1 b/.claude/skills/mxl-decompile/scripts/mxl-decompile.ps1 index 999d03e5..f2425b6a 100644 --- a/.claude/skills/mxl-decompile/scripts/mxl-decompile.ps1 +++ b/.claude/skills/mxl-decompile/scripts/mxl-decompile.ps1 @@ -1,4 +1,4 @@ -# mxl-decompile v1.6 — Decompile 1C spreadsheet to JSON +# mxl-decompile v1.7 — Decompile 1C spreadsheet to JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)] @@ -638,8 +638,13 @@ foreach ($area in $blocks) { if ($rowStyleKey -and $cellStyleKey -eq $rowStyleKey) { # Inherits rowStyle } else { + # Стиль пишем, только когда он отличается от того, что подставит компилятор: + # без rowStyle умолчание и есть "default", поэтому такой ключ — шум (56% ячеек). + # А при заданном rowStyle стиль "default" писать ОБЯЗАТЕЛЬНО: раньше здесь стояло + # `-not $rowStyleName`, и такая ячейка теряла стиль вовсе — при обратной сборке + # она наследовала rowStyle. $sn = Get-StyleName $cell.FormatIdx - if ($sn -ne "default" -or -not $rowStyleName) { + if ($sn -ne "default" -or $rowStyleName) { $dslCell["style"] = $sn } } diff --git a/.claude/skills/mxl-decompile/scripts/mxl-decompile.py b/.claude/skills/mxl-decompile/scripts/mxl-decompile.py index 4a03139f..0ef1792f 100644 --- a/.claude/skills/mxl-decompile/scripts/mxl-decompile.py +++ b/.claude/skills/mxl-decompile/scripts/mxl-decompile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# mxl-decompile v1.6 — Decompile 1C spreadsheet to JSON +# mxl-decompile v1.7 — Decompile 1C spreadsheet to JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -807,8 +807,13 @@ def main(): if row_style_key and cell_style_key == row_style_key: pass # Inherits rowStyle else: + # Стиль пишем, только когда он отличается от того, что подставит компилятор: + # без rowStyle умолчание и есть "default", поэтому такой ключ — шум (56% ячеек). + # А при заданном rowStyle стиль "default" писать ОБЯЗАТЕЛЬНО: раньше здесь было + # `not row_style_name`, и такая ячейка теряла стиль вовсе — при обратной сборке + # она наследовала rowStyle. sn = get_style_name(cell["FormatIdx"]) - if sn != "default" or not row_style_name: + if sn != "default" or row_style_name: dsl_cell["style"] = sn # Content diff --git a/tests/skills/cases/mxl-decompile/snapshots/output-absolute-path/back.json b/tests/skills/cases/mxl-decompile/snapshots/output-absolute-path/back.json index e11b0818..7d36d508 100644 --- a/tests/skills/cases/mxl-decompile/snapshots/output-absolute-path/back.json +++ b/tests/skills/cases/mxl-decompile/snapshots/output-absolute-path/back.json @@ -1 +1 @@ -{ "columns": 2, "defaultWidth": 10, "fonts": { "default": { "face": "Arial", "size": 10 } }, "styles": {}, "areas": [{ "name": "Test", "rows": [{ "cells": [{ "col": 1, "style": "default", "text": "A" }, { "col": 2, "style": "default", "text": "B" }] }] }] } \ No newline at end of file +{ "columns": 2, "defaultWidth": 10, "fonts": { "default": { "face": "Arial", "size": 10 } }, "styles": {}, "areas": [{ "name": "Test", "rows": [{ "cells": [{ "col": 1, "text": "A" }, { "col": 2, "text": "B" }] }] }] } \ No newline at end of file