diff --git a/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1 b/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1
index f45c77d0e..200576bf3 100644
--- a/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1
+++ b/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1
@@ -1253,41 +1253,6 @@ function Borrow-Form {
}
}
- # Auto-borrow StyleItems referenced in ChildItems and in the form's conditional appearance
- # (стиль только из оформления Конфигуратор тоже заимствует — эталон УТ CAStyle)
- # Pattern 1: ,
- # Pattern 2: style:XXX, style:XXX, etc.
- # Порядок первого упоминания — как в Python-порте (от него зависит порядок в ChildObjects)
- $styleScanXml = $childItemsXml + $srcCondAppearanceXml
- $referencedStyles = [ordered]@{}
- $styleRefs1 = [regex]::Matches($styleScanXml, 'ref="style:(\w+)"[^>]*kind="StyleItem"')
- foreach ($m in $styleRefs1) { $referencedStyles[$m.Groups[1].Value] = $true }
- # Закрывающий тег может быть с префиксом: в оформлении значение — style:X
- $styleRefs2 = [regex]::Matches($styleScanXml, '>style:(\w+)[\w:]+>')
- foreach ($m in $styleRefs2) { $referencedStyles[$m.Groups[1].Value] = $true }
-
- foreach ($styleName in $referencedStyles.Keys) {
- if (-not (Test-ObjectBorrowed "StyleItem" $styleName)) {
- $styleSrcFile = Join-Path (Join-Path $cfgDir "StyleItems") "${styleName}.xml"
- if (Test-Path $styleSrcFile) {
- $src = Read-SourceObject "StyleItem" $styleName
- $borrowedXml = Build-BorrowedObjectXml "StyleItem" $styleName $src.Uuid $src.Properties
- $targetDir = Join-Path $extDir "StyleItems"
- if (-not (Test-Path $targetDir)) {
- New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
- }
- $targetFile = Join-Path $targetDir "${styleName}.xml"
- $encBom = New-Object System.Text.UTF8Encoding($true)
- [System.IO.File]::WriteAllText($targetFile, $borrowedXml, $encBom)
- Add-ToChildObjects "StyleItem" $styleName
- $script:borrowedFiles += $targetFile
- Info " Auto-borrowed: StyleItem.${styleName}"
- }
- # Файла нет — встроенный стиль платформы (ImportantColor, AccentColor…): заимствовать
- # нечего, пропускаем молча. Пользовательский стиль, на который ссылается форма, в
- # валидном источнике существует всегда — предупреждение было только шумом.
- }
- }
# Auto-borrow Enums + EnumValues referenced via DesignTimeRef in ChoiceParameters
# Collect Enum -> [EnumValue names] map
$dtRefs = [regex]::Matches($childItemsXml, 'xr:DesignTimeRef">Enum\.(\w+)\.EnumValue\.(\w+)')
@@ -1363,6 +1328,42 @@ function Borrow-Form {
}
}
+ # Вне блока ChildItems: стили нужны и оформлению формы без элементов
+ # Auto-borrow StyleItems referenced in ChildItems and in the form's conditional appearance
+ # (стиль только из оформления Конфигуратор тоже заимствует — эталон УТ CAStyle)
+ # Pattern 1: ,
+ # Pattern 2: style:XXX, style:XXX, etc.
+ # Порядок первого упоминания — как в Python-порте (от него зависит порядок в ChildObjects)
+ $styleScanXml = $childItemsXml + $srcCondAppearanceXml
+ $referencedStyles = [ordered]@{}
+ $styleRefs1 = [regex]::Matches($styleScanXml, 'ref="style:(\w+)"[^>]*kind="StyleItem"')
+ foreach ($m in $styleRefs1) { $referencedStyles[$m.Groups[1].Value] = $true }
+ # Закрывающий тег может быть с префиксом: в оформлении значение — style:X
+ $styleRefs2 = [regex]::Matches($styleScanXml, '>style:(\w+)[\w:]+>')
+ foreach ($m in $styleRefs2) { $referencedStyles[$m.Groups[1].Value] = $true }
+
+ foreach ($styleName in $referencedStyles.Keys) {
+ if (-not (Test-ObjectBorrowed "StyleItem" $styleName)) {
+ $styleSrcFile = Join-Path (Join-Path $cfgDir "StyleItems") "${styleName}.xml"
+ if (Test-Path $styleSrcFile) {
+ $src = Read-SourceObject "StyleItem" $styleName
+ $borrowedXml = Build-BorrowedObjectXml "StyleItem" $styleName $src.Uuid $src.Properties
+ $targetDir = Join-Path $extDir "StyleItems"
+ if (-not (Test-Path $targetDir)) {
+ New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
+ }
+ $targetFile = Join-Path $targetDir "${styleName}.xml"
+ $encBom = New-Object System.Text.UTF8Encoding($true)
+ [System.IO.File]::WriteAllText($targetFile, $borrowedXml, $encBom)
+ Add-ToChildObjects "StyleItem" $styleName
+ $script:borrowedFiles += $targetFile
+ Info " Auto-borrowed: StyleItem.${styleName}"
+ }
+ # Файла нет — встроенный стиль платформы (ImportantColor, AccentColor…): заимствовать
+ # нечего, пропускаем молча. Пользовательский стиль, на который ссылается форма, в
+ # валидном источнике существует всегда — предупреждение было только шумом.
+ }
+ }
# Открывающий тег