@@ -12,6 +12,7 @@ import { SlideInfo } from '../types/xml-types';
1212import { XmlHelper } from '../helper/xml-helper' ;
1313import { vd } from '../helper/general-helper' ;
1414import { ContentTracker } from '../helper/content-tracker' ;
15+ import CacheHelper from '../helper/cache-helper' ;
1516
1617export class Template implements ITemplate {
1718 /**
@@ -53,23 +54,26 @@ export class Template implements ITemplate {
5354 creationIds : SlideInfo [ ] ;
5455 existingSlides : number ;
5556
56- constructor ( location : string ) {
57+ constructor ( location : string , cache ?: CacheHelper ) {
5758 this . location = location ;
5859 const file = FileHelper . readFile ( location ) ;
59- this . archive = FileHelper . extractFileContent ( file as unknown as Buffer ) ;
60+ this . archive = FileHelper . extractFileContent (
61+ file as unknown as Buffer ,
62+ cache ?. setLocation ( location ) ,
63+ ) ;
6064 }
6165
6266 static import (
6367 location : string ,
6468 name ?: string ,
69+ cache ?: CacheHelper ,
6570 ) : PresTemplate | RootPresTemplate {
6671 let newTemplate : PresTemplate | RootPresTemplate ;
67-
6872 if ( name ) {
69- newTemplate = new Template ( location ) as PresTemplate ;
73+ newTemplate = new Template ( location , cache ) as PresTemplate ;
7074 newTemplate . name = name ;
7175 } else {
72- newTemplate = new Template ( location ) as RootPresTemplate ;
76+ newTemplate = new Template ( location , cache ) as RootPresTemplate ;
7377 newTemplate . slides = [ ] ;
7478 newTemplate . counter = [
7579 new CountHelper ( 'slides' , newTemplate ) ,
0 commit comments