mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-18 16:49:41 +03:00
fix(cfe-borrow,form-edit,cfe-patch-method): fix borrowed form structure to match Configurator
- cfe-borrow: keep AutoCommandBar ChildItems (buttons) with CommandName=0 instead of stripping them — Configurator expects buttons to be present - form-edit: insert Events section after AutoCommandBar, not before — matches Configurator's element ordering - cfe-patch-method(py): fix \r\r\n double line endings by using newline="" in open() calls Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1078,11 +1078,18 @@ if ($def.formEvents -and $def.formEvents.Count -gt 0) {
|
||||
$eventsSection = $xmlDoc.CreateElement("Events", $formNs)
|
||||
$insertAfter = $root.SelectSingleNode("f:AutoCommandBar", $nsMgr)
|
||||
if ($insertAfter) {
|
||||
$refNode = $insertAfter
|
||||
$ws = $xmlDoc.CreateWhitespace("`r`n`t")
|
||||
# Insert before the AutoCommandBar (Events come before AutoCommandBar in 1C)
|
||||
$root.InsertBefore($ws, $refNode) | Out-Null
|
||||
$root.InsertBefore($eventsSection, $refNode) | Out-Null
|
||||
# Insert after AutoCommandBar (Events come after AutoCommandBar in 1C)
|
||||
$ws1 = $xmlDoc.CreateWhitespace("`r`n`t")
|
||||
$ws2 = $xmlDoc.CreateWhitespace("`r`n`t")
|
||||
if ($insertAfter.NextSibling) {
|
||||
$root.InsertBefore($ws1, $insertAfter.NextSibling) | Out-Null
|
||||
$root.InsertBefore($eventsSection, $ws1) | Out-Null
|
||||
$root.InsertBefore($ws2, $eventsSection) | Out-Null
|
||||
} else {
|
||||
$root.AppendChild($xmlDoc.CreateWhitespace("`r`n`t")) | Out-Null
|
||||
$root.AppendChild($eventsSection) | Out-Null
|
||||
$root.AppendChild($xmlDoc.CreateWhitespace("`r`n")) | Out-Null
|
||||
}
|
||||
} else {
|
||||
$firstChild = $root.FirstChild
|
||||
if ($firstChild) {
|
||||
|
||||
Reference in New Issue
Block a user