Skip to content

Commit

Permalink
Merge pull request #383 from liaochong/Hotfix/4.3.0.RC2
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
liaochong authored Oct 6, 2022
2 parents d8fa549 + 4e4af82 commit cb2ba3c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.github.liaochong</groupId>
<artifactId>myexcel</artifactId>
<version>4.3.0.RC1</version>
<version>4.3.0.RC2</version>
<packaging>jar</packaging>

<name>myexcel</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ public void processRecord(Record record) {
lastRowNumber = thisRow;
newRow(thisRow, !detectedMergeOfThisSheet || waitCount == 0);
if (detectedMergeOfThisSheet && waitCount == 0) {
waitCount = mergeCellMapping.values().stream().filter(c -> Objects.equals(c.getRow(), lastRowNumber) && c.getColumn() == 0).count() + 1;
waitCount = mergeCellMapping.entrySet().stream().filter(c -> c.getValue().getColumn() == 0
&& Objects.equals(c.getValue().getRow(), lastRowNumber)
&& c.getKey().getRow() != c.getValue().getRow()).count() + 1;
}
waitCount--;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ else if ("str".equals(cellType))
}
output.startRow(rowNum, !detectedMerge || waitCount == 0);
if (detectedMerge && waitCount == 0) {
waitCount = mergeCellMapping.values().stream().filter(c -> Objects.equals(c.getRow(), rowNum) && c.getColumn() == 0).count() + 1;
waitCount = mergeCellMapping.entrySet().stream().filter(c -> c.getValue().getColumn() == 0
&& Objects.equals(c.getValue().getRow(), rowNum)
&& c.getKey().getRow() != c.getValue().getRow()).count() + 1;
}
waitCount--;
this.preRowNum = rowNum;
Expand Down

0 comments on commit cb2ba3c

Please sign in to comment.