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

From: Ben Martin <monkeyiq_at_users.sourceforge.net>
Date: Sun Jul 17 2011 - 08:58:20 CEST

  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;

  I am a magic
     and special wizard<text:span>....

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/

Received on Sun Jul 17 08:58:33 2011

This archive was generated by hypermail 2.1.8 : Sun Jul 17 2011 - 08:58:33 CEST