protected bool AddChunk(Chunk chunk) {
Font f = chunk.Font;
String c = chunk.Content;
if (font != null && !font.IsStandardFont()) {
f = font.Difference(chunk.Font);
}
if (Count > 0 && !chunk.HasAttributes()) {
try {
Chunk previous = (Chunk) this[Count - 1];
if (!previous.HasAttributes()
&& (f == null
|| f.CompareTo(previous.Font) == 0)
&& previous.Font.CompareTo(f) == 0
&& !"".Equals(previous.Content.Trim())
&& !"".Equals(c.Trim())) {
previous.Append(c);
return true;
}
}
catch {
}
}
Chunk newChunk = new Chunk(c, f);
newChunk.Attributes = chunk.Attributes;
if (hyphenation != null && newChunk.GetHyphenation() == null && !newChunk.IsEmpty()) {
newChunk.SetHyphenation(hyphenation);
}
base.Add(newChunk);
return true;
}