Skip to content

Conversation

@lsergio
Copy link

@lsergio lsergio commented Dec 3, 2025

Fixed cell row and column index tracking when there are blank cells at the beginning of the row, like:

<row>
			<c r="B2" t="s">
				<v>136316</v>
			</c>
			<c t="s">
				<v>136317</v>
			</c>
			<c t="b">
				<v>1</v>
			</c>
			<c t="b">
				<v>1</v>
			</c>
			<c t="s">
				<v>136318</v>
			</c>
			<c t="s">
				<v>265</v>
			</c>
			<c t="s">
				<v>136319</v>
			</c>
			<c r="J2" s="2">
				<v>45411.095648645831</v>
			</c>
		</row>

The A2 cells is blank the the lib loses track of the indexes.

@rzymek
Copy link
Collaborator

rzymek commented Dec 4, 2025

Thank you!
Could you add a test that would verify the fix (that is it would fail before your changes)?

*/
private String parseSharedFormula(Integer dCol, Integer dRow, String baseFormula) {
String res = "";
StringBuilder res = new StringBuilder();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}

Cell cell = parseCell(trackedColIndex++);
Cell cell = parseCell(trackedColIndex++, rowIndex);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we have both trackedRowIndex field and parameter.
Shouldn't this.trackedRowIndex just be increated in this loop?

Copy link
Author

@lsergio lsergio Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's an option. I added the rowIndex parameter to match the existing colIndex parameter instead of getting one piece of info from the parameter and the other from the attribute

@lsergio
Copy link
Author

lsergio commented Dec 18, 2025

Thank you! Could you add a test that would verify the fix (that is it would fail before your changes)?

I added a new test case for the RowSpliterator class. I could not create a test that processes the spreadsheet where I found the issue because it contains customer sensitive data, and I didn't manage to create another one - in all my attempts all cells had explicit addresses in the xml content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants