11import { XmlHelper } from '../helper/xml-helper' ;
2- import { GeneralHelper , vd } from '../helper/general-helper' ;
2+ import { GeneralHelper } from '../helper/general-helper' ;
33import { HyperlinkProcessor } from '../helper/hyperlink-processor' ;
44import {
55 ChartModificationCallback ,
@@ -11,7 +11,10 @@ import {
1111} from '../types/types' ;
1212import { RootPresTemplate } from '../interfaces/root-pres-template' ;
1313import { XmlDocument , XmlElement } from '../types/xml-types' ;
14- import { ContentTypeExtension , ContentTypeMap } from '../enums/content-type-map' ;
14+ import {
15+ ContentTypeExtension ,
16+ ContentTypeMap ,
17+ } from '../enums/content-type-map' ;
1518import { ElementSubtype } from '../enums/element-type' ;
1619import IArchive from '../interfaces/iarchive' ;
1720
@@ -121,7 +124,10 @@ export class Shape {
121124 async processHyperlinks ( ) : Promise < void > {
122125 if ( ! this . targetElement || ! this . createdRid ) return ;
123126
124- await HyperlinkProcessor . processSingleHyperlink ( this . targetElement , this . createdRid ) ;
127+ await HyperlinkProcessor . processSingleHyperlink (
128+ this . targetElement ,
129+ this . createdRid ,
130+ ) ;
125131 }
126132
127133 async replaceIntoSlideTree ( ) : Promise < void > {
@@ -142,10 +148,14 @@ export class Shape {
142148 ) ;
143149
144150 const findMethod = this . hasCreationId ? 'findByCreationId' : 'findByName' ;
151+ const selector = this . hasCreationId
152+ ? this . shape . selector . creationId
153+ : this . shape . selector . name ;
145154
146155 const sourceElementOnTargetSlide = await XmlHelper [ findMethod ] (
147156 targetSlideXml ,
148- this . name ,
157+ selector ,
158+ this . shape . selector . nameIdx ,
149159 ) ;
150160
151161 if ( ! sourceElementOnTargetSlide ?. parentNode ) {
@@ -172,7 +182,9 @@ export class Shape {
172182 XmlHelper . writeXmlToArchive ( archive , slideFile , targetSlideXml ) ;
173183 }
174184
175- async updateElementsRelId ( cb ?: ( targetElement : XmlElement ) => void ) : Promise < void > {
185+ async updateElementsRelId (
186+ cb ?: ( targetElement : XmlElement ) => void ,
187+ ) : Promise < void > {
176188 const targetSlideXml = await XmlHelper . getXmlFromArchive (
177189 this . targetArchive ,
178190 this . targetSlideFile ,
@@ -184,8 +196,8 @@ export class Shape {
184196 ) ;
185197
186198 targetElements . forEach ( ( targetElement : XmlElement ) => {
187- if ( cb && typeof cb === 'function' ) {
188- cb ( targetElement )
199+ if ( cb && typeof cb === 'function' ) {
200+ cb ( targetElement ) ;
189201 } else {
190202 this . relParent ( targetElement )
191203 . getElementsByTagName ( this . relRootTag ) [ 0 ]
@@ -212,11 +224,7 @@ export class Shape {
212224 . getElementsByTagName ( 'p:cSld' ) [ 0 ]
213225 . getElementsByTagName ( this . relRootTag ) ;
214226
215- return XmlHelper . findByAttributeValue (
216- sourceList ,
217- this . relAttribute ,
218- rId ,
219- ) ;
227+ return XmlHelper . findByAttributeValue ( sourceList , this . relAttribute , rId ) ;
220228 }
221229
222230 async updateTargetElementRelId ( ) : Promise < void > {
0 commit comments