You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

XMLSlideShow.java 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.xslf.usermodel;
  16. import static org.apache.poi.ooxml.POIXMLTypeLoader.DEFAULT_XML_OPTIONS;
  17. import java.awt.Dimension;
  18. import java.io.File;
  19. import java.io.FileInputStream;
  20. import java.io.IOException;
  21. import java.io.InputStream;
  22. import java.io.OutputStream;
  23. import java.util.ArrayList;
  24. import java.util.Arrays;
  25. import java.util.Collections;
  26. import java.util.HashMap;
  27. import java.util.List;
  28. import java.util.Map;
  29. import java.util.OptionalLong;
  30. import java.util.regex.Pattern;
  31. import java.util.stream.Stream;
  32. import org.apache.poi.ooxml.POIXMLDocument;
  33. import org.apache.poi.ooxml.POIXMLDocumentPart;
  34. import org.apache.poi.ooxml.POIXMLException;
  35. import org.apache.poi.ooxml.extractor.POIXMLPropertiesTextExtractor;
  36. import org.apache.poi.ooxml.util.PackageHelper;
  37. import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
  38. import org.apache.poi.openxml4j.opc.OPCPackage;
  39. import org.apache.poi.openxml4j.opc.PackagePart;
  40. import org.apache.poi.sl.usermodel.MasterSheet;
  41. import org.apache.poi.sl.usermodel.PictureData.PictureType;
  42. import org.apache.poi.sl.usermodel.SlideShow;
  43. import org.apache.poi.util.Beta;
  44. import org.apache.poi.util.IOUtils;
  45. import org.apache.poi.util.Internal;
  46. import org.apache.poi.util.LittleEndian;
  47. import org.apache.poi.util.LittleEndianConsts;
  48. import org.apache.poi.util.POILogFactory;
  49. import org.apache.poi.util.POILogger;
  50. import org.apache.poi.util.Units;
  51. import org.apache.xmlbeans.XmlException;
  52. import org.openxmlformats.schemas.presentationml.x2006.main.CTNotesMasterIdList;
  53. import org.openxmlformats.schemas.presentationml.x2006.main.CTNotesMasterIdListEntry;
  54. import org.openxmlformats.schemas.presentationml.x2006.main.CTPresentation;
  55. import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideIdList;
  56. import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideIdListEntry;
  57. import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideSize;
  58. import org.openxmlformats.schemas.presentationml.x2006.main.PresentationDocument;
  59. /**
  60. * High level representation of a ooxml slideshow.
  61. * This is the first object most users will construct whether
  62. * they are reading or writing a slideshow. It is also the
  63. * top level object for creating new slides/etc.
  64. */
  65. @SuppressWarnings("WeakerAccess")
  66. @Beta
  67. public class XMLSlideShow extends POIXMLDocument
  68. implements SlideShow<XSLFShape, XSLFTextParagraph> {
  69. private static final POILogger LOG = POILogFactory.getLogger(XMLSlideShow.class);
  70. //arbitrarily selected; may need to increase
  71. private static final int MAX_RECORD_LENGTH = 1_000_000;
  72. private CTPresentation _presentation;
  73. private final List<XSLFSlide> _slides = new ArrayList<>();
  74. private final List<XSLFSlideMaster> _masters = new ArrayList<>();
  75. private final List<XSLFPictureData> _pictures = new ArrayList<>();
  76. private final List<XSLFChart> _charts = new ArrayList<>();
  77. private XSLFTableStyles _tableStyles;
  78. private XSLFNotesMaster _notesMaster;
  79. private XSLFCommentAuthors _commentAuthors;
  80. public XMLSlideShow() {
  81. this(empty());
  82. }
  83. public XMLSlideShow(OPCPackage pkg) {
  84. super(pkg);
  85. try {
  86. if (getCorePart().getContentType().equals(XSLFRelation.THEME_MANAGER.getContentType())) {
  87. rebase(getPackage());
  88. }
  89. //build a tree of POIXMLDocumentParts, this presentation being the root
  90. load(XSLFFactory.getInstance());
  91. } catch (Exception e) {
  92. throw new POIXMLException(e);
  93. }
  94. }
  95. public XMLSlideShow(InputStream is) throws IOException {
  96. this(PackageHelper.open(is));
  97. }
  98. static OPCPackage empty() {
  99. InputStream is = XMLSlideShow.class.getResourceAsStream("empty.pptx");
  100. if (is == null) {
  101. throw new POIXMLException("Missing resource 'empty.pptx'");
  102. }
  103. try {
  104. return OPCPackage.open(is);
  105. } catch (Exception e) {
  106. throw new POIXMLException(e);
  107. } finally {
  108. IOUtils.closeQuietly(is);
  109. }
  110. }
  111. @Override
  112. protected void onDocumentRead() throws IOException {
  113. try {
  114. PresentationDocument doc =
  115. PresentationDocument.Factory.parse(getCorePart().getInputStream(), DEFAULT_XML_OPTIONS);
  116. _presentation = doc.getPresentation();
  117. Map<String, XSLFSlideMaster> masterMap = new HashMap<>();
  118. Map<String, XSLFSlide> shIdMap = new HashMap<>();
  119. Map<String, XSLFChart> chartMap = new HashMap<>();
  120. for (RelationPart rp : getRelationParts()) {
  121. POIXMLDocumentPart p = rp.getDocumentPart();
  122. if (p instanceof XSLFSlide) {
  123. shIdMap.put(rp.getRelationship().getId(), (XSLFSlide) p);
  124. for (POIXMLDocumentPart c : p.getRelations()) {
  125. if (c instanceof XSLFChart) {
  126. chartMap.put(c.getPackagePart().getPartName().getName(), (XSLFChart) c);
  127. }
  128. }
  129. } else if (p instanceof XSLFSlideMaster) {
  130. masterMap.put(getRelationId(p), (XSLFSlideMaster) p);
  131. } else if (p instanceof XSLFTableStyles) {
  132. _tableStyles = (XSLFTableStyles) p;
  133. } else if (p instanceof XSLFNotesMaster) {
  134. _notesMaster = (XSLFNotesMaster) p;
  135. } else if (p instanceof XSLFCommentAuthors) {
  136. _commentAuthors = (XSLFCommentAuthors) p;
  137. }
  138. }
  139. _charts.clear();
  140. _charts.addAll(chartMap.values());
  141. _masters.clear();
  142. if (_presentation.isSetSldMasterIdLst()) {
  143. _presentation.getSldMasterIdLst().getSldMasterIdList().forEach(
  144. id -> _masters.add(masterMap.get(id.getId2()))
  145. );
  146. }
  147. _slides.clear();
  148. if (_presentation.isSetSldIdLst()) {
  149. _presentation.getSldIdLst().getSldIdList().forEach(id -> {
  150. XSLFSlide sh = shIdMap.get(id.getId2());
  151. if (sh == null) {
  152. LOG.log(POILogger.WARN, "Slide with r:id " + id.getId() + " was defined, but didn't exist in package, skipping");
  153. } else {
  154. _slides.add(sh);
  155. }
  156. });
  157. }
  158. } catch (XmlException e) {
  159. throw new POIXMLException(e);
  160. }
  161. }
  162. @Override
  163. protected void commit() throws IOException {
  164. PackagePart part = getPackagePart();
  165. OutputStream out = part.getOutputStream();
  166. _presentation.save(out, DEFAULT_XML_OPTIONS);
  167. out.close();
  168. }
  169. /**
  170. * Get the document's embedded files.
  171. */
  172. @Override
  173. public List<PackagePart> getAllEmbeddedParts() {
  174. return Collections.unmodifiableList(
  175. getPackage().getPartsByName(Pattern.compile("/ppt/embeddings/.*?"))
  176. );
  177. }
  178. @Override
  179. public List<XSLFPictureData> getPictureData() {
  180. if (_pictures.isEmpty()) {
  181. getPackage().getPartsByName(Pattern.compile("/ppt/media/.*?")).forEach(part -> {
  182. XSLFPictureData pd = new XSLFPictureData(part);
  183. pd.setIndex(_pictures.size());
  184. _pictures.add(pd);
  185. });
  186. }
  187. return Collections.unmodifiableList(_pictures);
  188. }
  189. /**
  190. * Create a slide and initialize it from the specified layout.
  191. *
  192. * @param layout The layout to use for the new slide.
  193. * @return created slide
  194. */
  195. public XSLFSlide createSlide(XSLFSlideLayout layout) {
  196. CTSlideIdList slideList = _presentation.isSetSldIdLst()
  197. ? _presentation.getSldIdLst() : _presentation.addNewSldIdLst();
  198. @SuppressWarnings("deprecation")
  199. OptionalLong maxId = Stream.of(slideList.getSldIdArray())
  200. .mapToLong(CTSlideIdListEntry::getId).max();
  201. final XSLFRelation relationType = XSLFRelation.SLIDE;
  202. final int slideNumber = (int)(Math.max(maxId.orElse(0),255)+1);
  203. final int cnt = findNextAvailableFileNameIndex(relationType);
  204. RelationPart rp = createRelationship
  205. (relationType, XSLFFactory.getInstance(), cnt, false);
  206. XSLFSlide slide = rp.getDocumentPart();
  207. CTSlideIdListEntry slideId = slideList.addNewSldId();
  208. slideId.setId(slideNumber);
  209. slideId.setId2(rp.getRelationship().getId());
  210. layout.copyLayout(slide);
  211. slide.getPackagePart().clearRelationships();
  212. slide.addRelation(null, XSLFRelation.SLIDE_LAYOUT, layout);
  213. _slides.add(slide);
  214. return slide;
  215. }
  216. private int findNextAvailableFileNameIndex(XSLFRelation relationType) {
  217. // Bug 55791: We also need to check that the resulting file name is not already taken
  218. // this can happen when removing/adding slides, notes or charts
  219. try {
  220. return getPackage().getUnusedPartIndex(relationType.getDefaultFileName());
  221. } catch (InvalidFormatException e) {
  222. throw new RuntimeException(e);
  223. }
  224. }
  225. /**
  226. * Create a blank slide using the default (first) master.
  227. */
  228. @Override
  229. public XSLFSlide createSlide() {
  230. XSLFSlideMaster sm = _masters.get(0);
  231. XSLFSlideLayout layout = sm.getLayout(SlideLayout.BLANK);
  232. if (layout == null) {
  233. LOG.log(POILogger.WARN, "Blank layout was not found - defaulting to first slide layout in master");
  234. XSLFSlideLayout[] sl = sm.getSlideLayouts();
  235. if (sl.length == 0) {
  236. throw new POIXMLException("SlideMaster must contain a SlideLayout.");
  237. }
  238. layout = sl[0];
  239. }
  240. return createSlide(layout);
  241. }
  242. /**
  243. * Create a blank chart on the given slide.
  244. */
  245. public XSLFChart createChart(XSLFSlide slide) {
  246. XSLFChart chart = createChart();
  247. slide.addRelation(null, XSLFRelation.CHART, chart);
  248. return chart;
  249. }
  250. /**
  251. * This method is used to create template for chart XML.
  252. * @return Xslf chart object
  253. * @since POI 4.1.0
  254. */
  255. public XSLFChart createChart() {
  256. int chartIdx = findNextAvailableFileNameIndex(XSLFRelation.CHART);
  257. XSLFChart chart = createRelationship(XSLFRelation.CHART, XSLFFactory.getInstance(), chartIdx, true).getDocumentPart();
  258. chart.setChartIndex(chartIdx);
  259. _charts.add(chart);
  260. return chart;
  261. }
  262. /**
  263. * Return notes slide for the specified slide or create new if it does not exist yet.
  264. */
  265. public XSLFNotes getNotesSlide(XSLFSlide slide) {
  266. XSLFNotes notesSlide = slide.getNotes();
  267. if (notesSlide == null) {
  268. notesSlide = createNotesSlide(slide);
  269. }
  270. return notesSlide;
  271. }
  272. /**
  273. * Create a blank notes slide.
  274. */
  275. private XSLFNotes createNotesSlide(XSLFSlide slide) {
  276. if (_notesMaster == null) {
  277. createNotesMaster();
  278. }
  279. XSLFRelation relationType = XSLFRelation.NOTES;
  280. int slideIndex = findNextAvailableFileNameIndex(relationType);
  281. // add notes slide to presentation
  282. XSLFNotes notesSlide = (XSLFNotes) createRelationship
  283. (relationType, XSLFFactory.getInstance(), slideIndex);
  284. // link slide and notes slide with each other
  285. slide.addRelation(null, relationType, notesSlide);
  286. notesSlide.addRelation(null, XSLFRelation.NOTES_MASTER, _notesMaster);
  287. notesSlide.addRelation(null, XSLFRelation.SLIDE, slide);
  288. notesSlide.importContent(_notesMaster);
  289. return notesSlide;
  290. }
  291. /**
  292. * Create a notes master.
  293. */
  294. public void createNotesMaster() {
  295. RelationPart rp = createRelationship
  296. (XSLFRelation.NOTES_MASTER, XSLFFactory.getInstance(), 1, false);
  297. _notesMaster = rp.getDocumentPart();
  298. CTNotesMasterIdList notesMasterIdList = _presentation.addNewNotesMasterIdLst();
  299. CTNotesMasterIdListEntry notesMasterId = notesMasterIdList.addNewNotesMasterId();
  300. notesMasterId.setId(rp.getRelationship().getId());
  301. int themeIndex = 1;
  302. // TODO: check if that list can be replaced by idx = Math.max(idx,themeIdx)
  303. List<Integer> themeIndexList = new ArrayList<>();
  304. for (POIXMLDocumentPart p : getRelations()) {
  305. if (p instanceof XSLFTheme) {
  306. themeIndexList.add(XSLFRelation.THEME.getFileNameIndex(p));
  307. }
  308. }
  309. if (!themeIndexList.isEmpty()) {
  310. boolean found = false;
  311. for (int i = 1; i <= themeIndexList.size(); i++) {
  312. if (!themeIndexList.contains(i)) {
  313. found = true;
  314. themeIndex = i;
  315. }
  316. }
  317. if (!found) {
  318. themeIndex = themeIndexList.size() + 1;
  319. }
  320. }
  321. XSLFTheme theme = (XSLFTheme) createRelationship
  322. (XSLFRelation.THEME, XSLFFactory.getInstance(), themeIndex);
  323. theme.importTheme(getSlides().get(0).getTheme());
  324. _notesMaster.addRelation(null, XSLFRelation.THEME, theme);
  325. }
  326. /**
  327. * Return the Notes Master, if there is one.
  328. * (May not be present if no notes exist)
  329. */
  330. public XSLFNotesMaster getNotesMaster() {
  331. return _notesMaster;
  332. }
  333. @Override
  334. public List<XSLFSlideMaster> getSlideMasters() {
  335. return _masters;
  336. }
  337. /**
  338. * Return all the slides in the slideshow
  339. */
  340. @Override
  341. public List<XSLFSlide> getSlides() {
  342. return _slides;
  343. }
  344. /**
  345. * Return all the charts in the slideshow
  346. */
  347. public List<XSLFChart> getCharts() {
  348. return Collections.unmodifiableList(_charts);
  349. }
  350. /**
  351. * Returns the list of comment authors, if there is one.
  352. * Will only be present if at least one slide has comments on it.
  353. */
  354. public XSLFCommentAuthors getCommentAuthors() {
  355. return _commentAuthors;
  356. }
  357. /**
  358. * @param newIndex 0-based index of the slide
  359. */
  360. public void setSlideOrder(XSLFSlide slide, int newIndex) {
  361. int oldIndex = _slides.indexOf(slide);
  362. if (oldIndex == -1) {
  363. throw new IllegalArgumentException("Slide not found");
  364. }
  365. if (oldIndex == newIndex) {
  366. return;
  367. }
  368. // fix the usermodel container
  369. _slides.add(newIndex, _slides.remove(oldIndex));
  370. // fix ordering in the low-level xml
  371. CTSlideIdList sldIdLst = _presentation.getSldIdLst();
  372. @SuppressWarnings("deprecation")
  373. CTSlideIdListEntry[] entries = sldIdLst.getSldIdArray();
  374. CTSlideIdListEntry oldEntry = entries[oldIndex];
  375. if (oldIndex < newIndex) {
  376. System.arraycopy(entries, oldIndex + 1, entries, oldIndex, newIndex - oldIndex);
  377. } else {
  378. System.arraycopy(entries, newIndex, entries, newIndex + 1, oldIndex - newIndex);
  379. }
  380. entries[newIndex] = oldEntry;
  381. sldIdLst.setSldIdArray(entries);
  382. }
  383. public XSLFSlide removeSlide(int index) {
  384. XSLFSlide slide = _slides.remove(index);
  385. removeRelation(slide);
  386. _presentation.getSldIdLst().removeSldId(index);
  387. for (POIXMLDocumentPart p : slide.getRelations()) {
  388. if (p instanceof XSLFChart) {
  389. XSLFChart chart = (XSLFChart) p;
  390. slide.removeChartRelation(chart);
  391. _charts.remove(chart);
  392. } else if (p instanceof XSLFSlideLayout) {
  393. XSLFSlideLayout layout = (XSLFSlideLayout) p;
  394. slide.removeLayoutRelation(layout);
  395. }
  396. }
  397. return slide;
  398. }
  399. @Override
  400. public Dimension getPageSize() {
  401. CTSlideSize sz = _presentation.getSldSz();
  402. int cx = sz.getCx();
  403. int cy = sz.getCy();
  404. return new Dimension((int) Units.toPoints(cx), (int) Units.toPoints(cy));
  405. }
  406. @Override
  407. public void setPageSize(Dimension pgSize) {
  408. CTSlideSize sz = CTSlideSize.Factory.newInstance();
  409. sz.setCx(Units.toEMU(pgSize.getWidth()));
  410. sz.setCy(Units.toEMU(pgSize.getHeight()));
  411. _presentation.setSldSz(sz);
  412. }
  413. @Internal
  414. public CTPresentation getCTPresentation() {
  415. return _presentation;
  416. }
  417. /**
  418. * Adds a picture to the workbook.
  419. *
  420. * @param pictureData The bytes of the picture
  421. * @param format The format of the picture.
  422. * @return the picture data
  423. */
  424. @Override
  425. public XSLFPictureData addPicture(byte[] pictureData, PictureType format) {
  426. XSLFPictureData img = findPictureData(pictureData);
  427. if (img != null) {
  428. return img;
  429. }
  430. XSLFRelation relType = XSLFPictureData.getRelationForType(format);
  431. if (relType == null) {
  432. throw new IllegalArgumentException("Picture type " + format + " is not supported.");
  433. }
  434. int imageNumber;
  435. try {
  436. imageNumber = getPackage().getUnusedPartIndex("/ppt/media/image#\\..+");
  437. } catch (InvalidFormatException e) {
  438. imageNumber = _pictures.size() + 1;
  439. }
  440. img = createRelationship(relType, XSLFFactory.getInstance(), imageNumber, true).getDocumentPart();
  441. img.setIndex(_pictures.size());
  442. _pictures.add(img);
  443. try (OutputStream out = img.getPackagePart().getOutputStream()) {
  444. out.write(pictureData);
  445. } catch (IOException e) {
  446. throw new POIXMLException(e);
  447. }
  448. return img;
  449. }
  450. /**
  451. * Adds a picture to the slideshow.
  452. *
  453. * @param is The stream to read image from
  454. * @param format The format of the picture
  455. * @return the picture data
  456. * @since 3.15 beta 2
  457. */
  458. @Override
  459. public XSLFPictureData addPicture(InputStream is, PictureType format) throws IOException {
  460. return addPicture(IOUtils.toByteArray(is), format);
  461. }
  462. /**
  463. * Adds a picture to the presentation.
  464. *
  465. * @param pict The file containing the image to add
  466. * @param format The format of the picture.
  467. * @return the picture data
  468. * @since 3.15 beta 2
  469. */
  470. @Override
  471. public XSLFPictureData addPicture(File pict, PictureType format) throws IOException {
  472. byte[] data = IOUtils.safelyAllocate(pict.length(), MAX_RECORD_LENGTH);
  473. try (InputStream is = new FileInputStream(pict)) {
  474. IOUtils.readFully(is, data);
  475. }
  476. return addPicture(data, format);
  477. }
  478. /**
  479. * check if a picture with this picture data already exists in this presentation
  480. *
  481. * @param pictureData The picture data to find in the SlideShow
  482. * @return {@code null} if picture data is not found in this slideshow
  483. * @since 3.15 beta 2
  484. */
  485. @Override
  486. public XSLFPictureData findPictureData(byte[] pictureData) {
  487. long checksum = IOUtils.calculateChecksum(pictureData);
  488. byte[] cs = new byte[LittleEndianConsts.LONG_SIZE];
  489. LittleEndian.putLong(cs, 0, checksum);
  490. for (XSLFPictureData pic : getPictureData()) {
  491. if (Arrays.equals(pic.getChecksum(), cs)) {
  492. return pic;
  493. }
  494. }
  495. return null;
  496. }
  497. /**
  498. * Scan the master slides for the first slide layout with the given name.
  499. *
  500. * @param name The layout name (case-insensitive). Cannot be null.
  501. * @return the first layout found or null on failure
  502. */
  503. public XSLFSlideLayout findLayout(String name) {
  504. for (XSLFSlideMaster master : getSlideMasters()) {
  505. XSLFSlideLayout layout = master.getLayout(name);
  506. if (layout != null) {
  507. return layout;
  508. }
  509. }
  510. return null;
  511. }
  512. public XSLFTableStyles getTableStyles() {
  513. return _tableStyles;
  514. }
  515. @SuppressWarnings("RedundantThrows")
  516. @Override
  517. public MasterSheet<XSLFShape, XSLFTextParagraph> createMasterSheet() throws IOException {
  518. // TODO: implement!
  519. throw new UnsupportedOperationException();
  520. }
  521. @Override
  522. public POIXMLPropertiesTextExtractor getMetadataTextExtractor() {
  523. return new POIXMLPropertiesTextExtractor(this);
  524. }
  525. @Override
  526. public Object getPersistDocument() {
  527. return this;
  528. }
  529. @Override
  530. public XSLFFontInfo addFont(InputStream fontStream) throws IOException {
  531. return XSLFFontInfo.addFontToSlideShow(this, fontStream);
  532. }
  533. @Override
  534. public List<XSLFFontInfo> getFonts() {
  535. return XSLFFontInfo.getFonts(this);
  536. }
  537. }