Skip to content

Commit

Permalink
Fix "map" issue that was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudroques committed Dec 12, 2017
1 parent a7b5a02 commit b9bb9c7
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@
import net.sourceforge.plantuml.BlockUml;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.NullOutputStream;
import net.sourceforge.plantuml.SourceStringReader;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.servlet.utility.NullOutputStream;
import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.version.Version;
import net.sourceforge.plantuml.PSystemError;
import net.sourceforge.plantuml.ErrorUml;
Expand Down Expand Up @@ -108,12 +109,13 @@ void sendMap(String uml) throws IOException {
if (StringUtils.isDiagramCacheable(uml)) {
addHeaderForCache(blockUml);
}
String map = reader.outputImage(new NullOutputStream(),
new FileFormatOption(FileFormat.PNG, false)).getDescription();
String[] mapLines = map.split("[\\r\\n]");
PrintWriter httpOut = response.getWriter();
for (int i = 2; (i + 1) < mapLines.length; i++) {
httpOut.print(mapLines[i]);
final Diagram diagram = blockUml.getDiagram();
ImageData map = diagram.exportDiagram(new NullOutputStream(), 0,
new FileFormatOption(FileFormat.PNG, false));
if (map.containsCMapData()) {
PrintWriter httpOut = response.getWriter();
final String cmap = map.getCMapData("plantuml");
httpOut.print(cmap);
}
}

Expand Down

0 comments on commit b9bb9c7

Please sign in to comment.