Skip to content

Commit

Permalink
Fix: SimpleXmlReader did not set drawing on each figure.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrandelshofer committed Aug 17, 2024
1 parent 30907ee commit d142776
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,13 @@ private Figure read(AutoCloseable in, @Nullable Drawing drawing, @Nullable URI d
if (figure == null) {
throw new IOException("Input file is empty.");
}
if ((figure instanceof Drawing)) {
if ((figure instanceof Drawing d)) {
figure.set(Drawing.DOCUMENT_HOME, documentHome);

for (Figure f : figure.preorderIterable()) {
f.addedToDrawing(d);
}

}
workState.updateProgress(1.0);
return figure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ public CompletionStage<DataFormat> read(URI uri, DataFormat format, ImmutableMap
FigureFactory factory = new DefaultFigureFactory(idFactory);
SimpleXmlReader io = new SimpleXmlReader(factory, idFactory, GRAPHER_NAMESPACE_URI);
AbstractDrawing drawing = (AbstractDrawing) io.read(uri, null, workState);
System.out.println("READING..." + uri);
applyUserAgentStylesheet(drawing);
return drawing;
}).thenApply(drawing -> {
Expand Down

0 comments on commit d142776

Please sign in to comment.