processWordElements method

Future<void> processWordElements(
  1. XmlElement wordElements,
  2. int elementDepth,
  3. List<Relationship> relationShips,
  4. String wordOutputDirectory,
  5. List<Styles> stylesList,
  6. Document wordDocument,
  7. String fileType,
)

Function for processing word elements

Implementation

Future<void> processWordElements(xml.XmlElement wordElements, int elementDepth, List<Relationship> relationShips, String wordOutputDirectory,
    List<Styles> stylesList, Document wordDocument, String fileType) async {
  if (wordElements.name.local == "tbl") {
    MsTable table = await compute(processWordTable, ProcessWordTableParams(wordElements));
    wordDocument.pages.last.components.add(table);
    //processWordTable(wordElements, elementDepth, wordDocument);
  } else if (wordElements.name.local == "p") {
    List<WordPage> pages =
        await compute(processParagraph, ProcessParagraphParams(wordElements, relationShips, wordOutputDirectory, stylesList, wordDocument));

    wordDocument.pages = pages;
  } else if (wordElements.name.local == "sectPr") {
    processSectionDetails(wordElements, wordDocument);
  }
}