| 4688 | } |
| 4689 | |
| 4690 | void Graph::saveDocument(mx::FilePath filePath) |
| 4691 | { |
| 4692 | if (filePath.getExtension() != mx::MTLX_EXTENSION) |
| 4693 | { |
| 4694 | filePath.addExtension(mx::MTLX_EXTENSION); |
| 4695 | } |
| 4696 | |
| 4697 | mx::DocumentPtr writeDoc = _graphDoc; |
| 4698 | |
| 4699 | // If requested, create a modified version of the document for saving. |
| 4700 | if (!_saveNodePositions) |
| 4701 | { |
| 4702 | writeDoc = _graphDoc->copy(); |
| 4703 | for (mx::ElementPtr elem : writeDoc->traverseTree()) |
| 4704 | { |
| 4705 | elem->removeAttribute(mx::Element::XPOS_ATTRIBUTE); |
| 4706 | elem->removeAttribute(mx::Element::YPOS_ATTRIBUTE); |
| 4707 | } |
| 4708 | } |
| 4709 | |
| 4710 | mx::XmlWriteOptions writeOptions; |
| 4711 | writeOptions.elementPredicate = getElementPredicate(); |
| 4712 | mx::writeToXmlFile(writeDoc, filePath, &writeOptions); |
| 4713 | } |
nothing calls this directly
no test coverage detected