Re: A slight regression in 2.9.1 text:p loading...

From: Martin Sevior <msevior_at_gmail.com>
Date: Mon Jul 18 2011 - 03:04:11 CEST

Hi Ben,

Yes, I did write that code! it was revision 29316 with the commit comment:

"Properly fix bug 11847 Spaces inserted before paragraphs."

So when you do your fixes, check that bug 11847 remains fixed :-)

Cheers

Martin

On Mon, Jul 18, 2011 at 10:50 AM, Martin Sevior <msevior@gmail.com> wrote:
> Hi Ben,
>
> This seems vaguely familiar to me but revision  29384 appears t be a
> commit by uwog that cleans up a bit of code. As far as I can tell
> if(!m_bContentWritten) {...}  was present before 29384.
>
> I think I might have put that code in place but I can't recall the
> reason. I'll do a bit of digging with viewVC
>
> Cheers
>
> Martin
>
>
> On Sun, Jul 17, 2011 at 4:58 PM, Ben Martin
> <monkeyiq@users.sourceforge.net> wrote:
>> Hi,
>>  I dug into the loading of hand crafted ODT files in 2.9.1 and have
>> filed a bug 13112 [1]. I've been looking into fixing the bug, but also
>> don't want to step on anyone's toes in doing so.
>>
>> The gist of what I see being the problem is a special case in void
>> ODi_TextContent_ListenerState::charData() where
>> if(!m_bContentWritten) {...} is called. I'm not sure what use case
>> prompted this special case to be added, so I don't want to blindly
>> change it without discussion first.
>>
>>  It seems from "6.1.2 White Space Characters" of the spec [2], in
>> particular page 120 of [3], that leading and trailing whitespace is to
>> be removed, and internal whitespace is to be collapsed. ie, a stream of
>> 2+ SPACE to be replaced with a single SPACE.
>>
>> Prior to collapsing anything in
>> Z = { U+0009, U+000D, U+000A ) is first replaced with
>> SPACE = U+0020.
>>
>> The current code, when given something like the following will preserve
>> the newline after magic;
>>
>> <text:p>
>>  I am a magic
>>     and special wizard<text:span>....
>> </text:p>
>>
>> This is because the entire string "\n  I am a magic\n     and special
>> wizard" will be passed to charData() on the first call when
>> m_bContentWritten == false;
>>
>> FWIW the special case was brought in at revision 29384.
>>
>>
>> [1] http://bugzilla.abisource.com/show_bug.cgi?id=13112
>> [2] http://docs.oasis-open.org/office/v1.2/cos01/
>> [3]
>> http://docs.oasis-open.org/office/v1.2/cos01/OpenDocument-v1.2-cos01-part1.pdf
>>
>>
>
Received on Mon Jul 18 03:04:20 2011

This archive was generated by hypermail 2.1.8 : Mon Jul 18 2011 - 03:04:20 CEST