@@ -11,6 +11,7 @@ import { XmlTemplateHelper } from '../helper/xml-template-helper';
1111import { SlideInfo } from '../types/xml-types' ;
1212import { XmlHelper } from '../helper/xml-helper' ;
1313import { vd } from '../helper/general-helper' ;
14+ import CacheHelper from '../helper/cache-helper' ;
1415
1516export class Template implements ITemplate {
1617 /**
@@ -52,23 +53,26 @@ export class Template implements ITemplate {
5253 creationIds : SlideInfo [ ] ;
5354 existingSlides : number ;
5455
55- constructor ( location : string ) {
56+ constructor ( location : string , cache ?: CacheHelper ) {
5657 this . location = location ;
5758 const file = FileHelper . readFile ( location ) ;
58- this . archive = FileHelper . extractFileContent ( file as unknown as Buffer ) ;
59+ this . archive = FileHelper . extractFileContent (
60+ file as unknown as Buffer ,
61+ cache ?. setLocation ( location ) ,
62+ ) ;
5963 }
6064
6165 static import (
6266 location : string ,
6367 name ?: string ,
68+ cache ?: CacheHelper ,
6469 ) : PresTemplate | RootPresTemplate {
6570 let newTemplate : PresTemplate | RootPresTemplate ;
66-
6771 if ( name ) {
68- newTemplate = new Template ( location ) as PresTemplate ;
72+ newTemplate = new Template ( location , cache ) as PresTemplate ;
6973 newTemplate . name = name ;
7074 } else {
71- newTemplate = new Template ( location ) as RootPresTemplate ;
75+ newTemplate = new Template ( location , cache ) as RootPresTemplate ;
7276 newTemplate . slides = [ ] ;
7377 newTemplate . counter = [
7478 new CountHelper ( 'slides' , newTemplate ) ,
0 commit comments