crash on importing RTF


Subject: crash on importing RTF
From: Mike Nordell (tamlin@algonet.se)
Date: Thu Nov 30 2000 - 03:57:32 CST


On importing a moderately large RTF file (about 7.2MB :-) ) I found an
"interesting behaviour.

The constructor for FL_DocLayout tries to add a new listener to the
document. PD_Document forwards this request to its pt_PieceTable. All well
so far. But then pt_PieceTable::addListener calls
pt_PieceTable::_tellAndMaybeAddListener which creates a SpecialChangeRecord.
Now *this* is a mystery to me why it should want to add a change record for
adding a listener. Perhaps it's by design, I dunno. Is adding a listener an
undoable operation?

Well, fl_DocListener::populate gets called, and we get a span populated and
an attempt to insert a forced linebreak (!) which forces a call to
fp_Line::layout and it ends up in fp_Line::calculateWidthOfLine where the
assert
 UT_ASSERT(iX <= m_iMaxWidth);
triggers.

I'm completely at loss here, since I couldn't ever dream of this call chain
taking place just because someone wanted to add a listener. I'd think it
would be a s simle as
    m_collection.add(pListener);
but apparently I'm really ignorant in this area or something is badly broken
with the semantics of this call. I'd like to think the latter. Whatever,
it's a crash and I haven't got a clue where to begin to look for errors.

/Mike



This archive was generated by hypermail 2b25 : Thu Nov 30 2000 - 03:56:24 CST