multiple line pastes


Subject: multiple line pastes
From: Matt Kraai (kraai@subdimension.com)
Date: Mon Mar 27 2000 - 11:41:10 CST


Howdy,

In an effort to address bugs #551 and #780, I discovered a new bug.
It appears that if you copy and paste a newline before other text, it
will cause an assertion failure.

I have been trying to track this down, and as far as I can tell, it
appears that the handling of PendingWords doesn't take into account
the new paragraphs. From tracing through this, it appears that the
m_pPendingword variable is set before the newline is inserted, which
causes it to, when later checking the inserted word, not have a block
long enough. It seems that the right way to fix this would probably
be to reset the PendingWord when a paragraph is inserted, but I don't
know enough about it to be sure.

To reproduce the problem, try the following:

Start abiword, and enter the following key sequence:
x <enter> <enter> <shift>-<up> <shift-up> <control-c> y <left> <control-v>

This problem goes away if I undefine FASTSQUIGGLE.

As for the bugs I was actually looking at, it appears that the RTF
importer always drops the last empty paragraph when reading, both from
a file and from the Paste buffer. This can be simply fixed by changing
the lines at the end of ie_imp_RTF.cc:IE_Imp_RTF::_parseFile from

        if (ok)
        {
                ok = FlushStoredChars();
        }
        return ok ? UT_OK : UT_ERROR;

to

        if (ok)
        {
                ok = FlushStoredChars(UT_TRUE);
        }
        return ok ? UT_OK : UT_ERROR;

but it appears from the comments that the current behavior may be
intentional. Does anyone know about the RTF importer, and what it
is trying to do with empty/trailing paragraphs?

Yours,
 Matt



This archive was generated by hypermail 2b25 : Mon Mar 27 2000 - 11:49:03 CST