Re: [PR] Prevent NPE on XWPFTableCell.getWidth() when tcW is not set. [poi]

jaragunde (via GitHub) <[email protected]> Mon, 13 Jul 2026 19:12:59 -0000
Newsgroups gmane.comp.jakarta.poi.devel
Message-ID <PR_kwDOAAMmIM7xOW5O-abc9e2ca-ac68-4726-83ed-e3066483004f@gitbox.apache.org>
jaragunde commented on PR #1185:
URL: https://github.com/apache/poi/pull/1185#issuecomment-4961653896

   @pjfanning I would like to know your opinion about returning -1 or 0 for `XWPFTableCell.getWidth()` when there's no explicit width set in the document. `XWPFTable.getWidth()` returns -1, but ``XWPFTable|XWPFTableCell.getWidthDecimal()` both return 0. I'm for using -1, as I explain in the message.
   
   Heads-up: I will still work a bit on this topic; while I was testing this I realized it's possible to crash with NPE if the tcW element of the cell is set but empty.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]