mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-20 04:00:53 +00:00
Merge pull request #742 from a-krawciw/ditaa_error
Fix Exception in empty Ditaa Diagram
This commit is contained in:
commit
0bc682468f
@ -1507,16 +1507,16 @@ public class TextGrid {
|
|||||||
public boolean initialiseWithLines(ArrayList<StringBuffer> lines, ProcessingOptions options) throws UnsupportedEncodingException {
|
public boolean initialiseWithLines(ArrayList<StringBuffer> lines, ProcessingOptions options) throws UnsupportedEncodingException {
|
||||||
|
|
||||||
//remove blank rows at the bottom
|
//remove blank rows at the bottom
|
||||||
boolean done = false;
|
|
||||||
int i;
|
rows = new ArrayList<>();
|
||||||
for(i = lines.size() - 1; !done; i--){
|
|
||||||
StringBuffer row = lines.get(i);
|
for (StringBuffer row:lines) {
|
||||||
if(!StringUtils.isBlank(row.toString())) done = true;
|
if(!StringUtils.isBlank(row.toString()))
|
||||||
|
rows.add(row);
|
||||||
}
|
}
|
||||||
rows = new ArrayList<StringBuffer>(lines.subList(0, i + 2));
|
|
||||||
|
|
||||||
if(options != null) fixTabs(options.getTabSize());
|
if(options != null) fixTabs(options.getTabSize());
|
||||||
else fixTabs(options.DEFAULT_TAB_SIZE);
|
else fixTabs(ProcessingOptions.DEFAULT_TAB_SIZE);
|
||||||
|
|
||||||
|
|
||||||
// make all lines of equal length
|
// make all lines of equal length
|
||||||
|
Loading…
Reference in New Issue
Block a user