Hi,

com.lowagie.text.Phrase#add(Object) invokes 
com.lowagie.text.Phrase#addChunk(Chunk) when adding a Chunk. addChunk() 
sets a com.lowagie.text.Chunk.HYPHENATION attribute to the Chunk being 
added if the Chunk was missing this attribute. As one of its conditions 
for returning 'true', com.lowagie.text.Chunk#isEmpty() specifies that 
its 'attributes' field be null. An 'empty' Chunk (as defined by 
com.lowagie.text.Chunk#isEmpty()) added to a Phrase (or one of its 
subclasses) will no longer have a null attributes field, so will no 
longer be 'empty'.

I came across this problem when running a 
com.lowagie.text.Paragraph#isEmpty() on a Paragraph to which an 'empty' 
Chunk had been added. Paragraph#isEmpty() returned false because the 
formerly 'empty' Chunk was being evaluated as 'not empty' because of the 
addition of the HYPHENATION attribute.

Thoughts?

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to