* Find the transform (xfrm) node. Shapes use `p:spPr > a:xfrm`, * groups use `p:grpSpPr > a:xfrm`, graphic frames use `p:xfrm`.
(node: SafeXmlNode)
| 76 | * groups use `p:grpSpPr > a:xfrm`, graphic frames use `p:xfrm`. |
| 77 | */ |
| 78 | function findXfrm(node: SafeXmlNode): SafeXmlNode { |
| 79 | // Try spPr first (most shapes) |
| 80 | const spPr = node.child('spPr') |
| 81 | if (spPr.exists()) { |
| 82 | const xfrm = spPr.child('xfrm') |
| 83 | if (xfrm.exists()) return xfrm |
| 84 | } |
| 85 | |
| 86 | // Try grpSpPr (groups) |
| 87 | const grpSpPr = node.child('grpSpPr') |
| 88 | if (grpSpPr.exists()) { |
| 89 | const xfrm = grpSpPr.child('xfrm') |
| 90 | if (xfrm.exists()) return xfrm |
| 91 | } |
| 92 | |
| 93 | // Try direct xfrm (graphic frames) |
| 94 | const directXfrm = node.child('xfrm') |
| 95 | if (directXfrm.exists()) return directXfrm |
| 96 | |
| 97 | // Return empty node — all reads will return defaults |
| 98 | return node.child('__nonexistent__') |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Parse placeholder info from nvPr > p:ph. |
no test coverage detected