mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-29 08:01:02 +03:00
fix(form-decompile,form-compile): PictureDecoration имя-как-Ref + <xr:Abs> + порядок Title декораций
Баг: Emit-PictureDecoration брал $el.picture (тип-ключ = имя элемента) фолбэком источника картинки → при отсутствии src писал <xr:Ref>ИмяДекорации>. Фикс: источник картинки — ТОЛЬКО src. <xr:Abs> (встроенная картинка, 131 в корпусе): декомпилятор ловил лишь xr:Ref → теперь src:"abs:Имя" → <xr:Abs>Имя</xr:Abs> (префикс abs:, иначе <xr:Ref>). Порядок: LabelDecoration эмитил Title перед own-content, а платформа — layout-first (корпус 16970 vs 44). Переставил флаги/hyperlink/layout/оформление ПЕРЕД Title (как ExtendedTooltip) — заодно убирает шум атрибуции харнесса на многострочном Title (Height «уезжал» на родительскую группу; контент был корректен, ломалась line- атрибуция). Форма МобильноеПриложениеПредприниматель → round-trip match. Зеркало py (байт-в-байт). Снэпшоты events/element-appearance/additional-columns обновлены (только порядок) и пере-сертифицированы в 1С. Регресс 39/39 ps1+py. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8915e99ac8
commit
f7d5e2fd00
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# form-compile v1.82 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.83 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import copy
|
||||
@@ -3314,17 +3314,16 @@ def emit_label(lines, el, name, eid, indent):
|
||||
lines.append(f'{indent}<LabelDecoration name="{name}" id="{eid}">')
|
||||
inner = f'{indent}\t'
|
||||
|
||||
emit_decoration_title(lines, el, name, inner, auto=True)
|
||||
|
||||
# Порядок как у платформы: own-content (флаги/hyperlink/layout/оформление) ПЕРЕД Title
|
||||
# (корпус layout-first 16970 vs 44 — заодно убирает шум атрибуции харнесса на многострочном Title).
|
||||
emit_common_flags(lines, el, inner)
|
||||
|
||||
if el.get('hyperlink') is True:
|
||||
lines.append(f'{inner}<Hyperlink>true</Hyperlink>')
|
||||
emit_layout(lines, el, inner)
|
||||
|
||||
# Оформление (цвета/шрифт/граница) — перед компаньонами (профиль декорации)
|
||||
emit_appearance(lines, el, inner, 'decoration')
|
||||
|
||||
emit_decoration_title(lines, el, name, inner, auto=True)
|
||||
|
||||
# Companions
|
||||
emit_companion_panel(lines, 'ContextMenu', f'{name}\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435\u041c\u0435\u043d\u044e', inner, el.get('contextMenu'))
|
||||
emit_companion(lines, 'ExtendedTooltip', f'{name}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430', inner, el.get('extendedTooltip'))
|
||||
@@ -3663,11 +3662,16 @@ def emit_picture_decoration(lines, el, name, eid, indent):
|
||||
emit_decoration_title(lines, el, name, inner)
|
||||
emit_common_flags(lines, el, inner)
|
||||
|
||||
if el.get('picture') or el.get('src'):
|
||||
ref = str(el.get('src') or el.get('picture'))
|
||||
# Источник картинки — ТОЛЬКО src (ключ 'picture' = тип/имя элемента, не источник).
|
||||
# Префикс "abs:" → встроенная картинка <xr:Abs>; иначе именованная/стилевая <xr:Ref>.
|
||||
if el.get('src'):
|
||||
src_str = str(el['src'])
|
||||
lt = 'true' if el.get('loadTransparent') is True else 'false'
|
||||
lines.append(f'{inner}<Picture>')
|
||||
lines.append(f'{inner}\t<xr:Ref>{ref}</xr:Ref>')
|
||||
if src_str.startswith('abs:'):
|
||||
lines.append(f'{inner}\t<xr:Abs>{esc_xml(src_str[4:])}</xr:Abs>')
|
||||
else:
|
||||
lines.append(f'{inner}\t<xr:Ref>{esc_xml(src_str)}</xr:Ref>')
|
||||
lines.append(f'{inner}\t<xr:LoadTransparent>{lt}</xr:LoadTransparent>')
|
||||
lines.append(f'{inner}</Picture>')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user