Re: CVS: commit sum1 abiword-plugins/wp/impexp/OpenDocument/exp/xp ODe_Text_Listener.cpp

From: J.M. Maurer <uwog_at_uwog.net>
Date: Thu Jan 11 2007 - 00:48:47 CET

On Wed, 2007-01-10 at 19:57 +0000, cvs@abisource.com wrote:
> Update of /cvsroot/abiword-plugins/wp/impexp/OpenDocument/exp/xp
> In directory abiword.snt.utwente.nl:/tmp/cvs-serv12371/exp/xp
>
> Modified Files:
> ODe_Text_Listener.cpp
> Log Message:
> Fix a dataloss bug in the ODT exporter that occurs when field values aren't calculated during a command line conversion. Please backport.
>

You'll have to force layouting for this to work afaik. That is what I do
with a custom patch in the regression suite.

Marc

>
>
> Index: ODe_Text_Listener.cpp
> ===================================================================
> RCS file: /cvsroot/abiword-plugins/wp/impexp/OpenDocument/exp/xp/ODe_Text_Listener.cpp,v
> retrieving revision 1.14
> retrieving revision 1.15
> diff -u -d -r1.14 -r1.15
> --- ODe_Text_Listener.cpp 8 Jan 2007 23:13:54 -0000 1.14
> +++ ODe_Text_Listener.cpp 10 Jan 2007 19:57:37 -0000 1.15
> @@ -279,7 +279,13 @@
> *
> */
> void ODe_Text_Listener::openField(const fd_Field* field, const UT_UTF8String& fieldType, const UT_UTF8String& fieldValue) {
> - UT_return_if_fail(field && fieldType.length() && fieldValue.length());
> + UT_return_if_fail(field && fieldType.length());
> +
> + if(!fieldValue.length()) {
> + // for some reason, field values aren't calculated when files are converted on the command line;
> + // instead of returning and creating an invalid document, we'll just assert.
> + UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN);
> + }
>
> UT_UTF8String escape = fieldValue;
> escape.escapeXML();
>
> -----------------------------------------------
> To unsubscribe from this list, send a message to
> abisource-cvs-commit-request@abisource.com with the word
> unsubscribe in the message body.
Received on Thu Jan 11 00:48:58 2007

This archive was generated by hypermail 2.1.8 : Thu Jan 11 2007 - 00:48:58 CET