Skip to content

Commit 1f232f5

Browse files
committed
Less folders are generated at destination
1 parent b9058ba commit 1f232f5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/com/mxgraph/svg2xml/Svg2Xml.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public Svg2Xml(Svg2XmlGui gui)
103103
String groupName = stencilUserMarker;
104104
sourceFolder = gui.sourceFileListComponent.getSelectedFiles()[0].getParent();
105105
boolean isGroupNameInConfig = false;
106+
String lastGroupName = "";
106107

107108
// construct destConfigDoc based on default values, groupConfigDoc and stencilConfigDoc
108109
for (int i = 0; i < gui.sourceFiles.length; i++)
@@ -112,7 +113,7 @@ public Svg2Xml(Svg2XmlGui gui)
112113
isNewGroup = true;
113114

114115
groupName = stencilUserMarker;
115-
116+
116117
String shapeName = gui.sourceFiles[i].getName();
117118
shapeName = shapeName.substring(0, shapeName.lastIndexOf("."));
118119
int configCount = 0;
@@ -567,6 +568,7 @@ else if (aspectRatio.toLowerCase().equals("variable"))
567568
groupName = groupName.replace(File.separator, ".");
568569
}
569570

571+
lastGroupName = groupName;
570572
groupXml = "<shapes name=\"" + groupName + "\">" + System.getProperty("line.separator");
571573
String tmp = Svg2Xml.printDocumentString(destDoc, groupBaos);
572574
tmp = tmp.replaceAll("\\.0\"", "\"");
@@ -587,8 +589,8 @@ else if (aspectRatio.toLowerCase().equals("variable"))
587589

588590
try
589591
{
590-
String currentDestPath = gui.destPath.getAbsolutePath();
591-
currentDestPath += gui.sourceFiles[i].getParent().substring(2, gui.sourceFiles[i].getParent().length()) + ".xml";
592+
String currentDestPath = gui.destPath.getAbsolutePath() + File.separator + lastGroupName.replace(".", File.separator) + ".xml";
593+
592594
currentDestPath = currentDestPath.toLowerCase();
593595
currentDestPath = currentDestPath.replaceAll("\\s", "_");
594596
File myDestFile = new File(currentDestPath);

0 commit comments

Comments
 (0)