[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: [patch] KoOdfExporter and MSWordOdfImport port & fixes
From:       Jaroslaw S <kexipl () gmail ! com>
Date:       2009-05-31 19:27:29
Message-ID: 56a746380905311227v5bbb413fs1fc578c312738d0b () mail ! gmail ! com
[Download RAW message or body]

2009/5/31 Thorsten Zachmann <t.zachmann@zagge.de>:
> On Friday 29 May 2009, Jarosław Staniek wrote:
>> Dear all,
>> For review:
>>
>> 1. KoOdfExporter.patch
>> The goal: the code in convert is common, so KoOdfExporter is introduced to
>> avoid copy/pastes.
>>
>> *created KoOdfExporter
>> **based on MSWordOdfImport::convert()
>> **added KoOdfWriters helper struct to make the API a bit cleaner
>>
>
> +    // open main tags
> +    bodyWriter.startElement("office:body");
> +    bodyWriter.startElement("office:text");

True, I will address this need in next version of the patch, eg. by
adding and officeElement argument passed to the ctor.

> This should be done is the createDocument method, to allow also other type of
> doucments to be created. e.g. a office:presentation.
>
> +    //now create real content/body writers & dump the information there
> +    KoXmlWriter* realContentWriter = oasisStore.contentWriter();
> +    realContentWriter->addCompleteElement(&contentBuf);
> +    KoXmlWriter* realBodyWriter = oasisStore.bodyWriter();
> +    realBodyWriter->addCompleteElement(&bodyBuf);
>
> Why is this copy needed? Can't you use the correct writers from the beginning?

The code for KoOdfExporter mostly copied from based on
MSWordOdfImport::convert() and just abstracted.

Perhaps the buffered writers for body and content are no longer needed
once we do not use QDom? Here are the comments that may say something,
from KoOdfExporter::save() (previously
fromMSWordOdfImport::createDocument()):

//open contentWriter & bodyWriter *temp* writers
//so we can write picture files while we parse

Or Benjamin, could you please give a hint on the purpose of using QBuffer here?

-- 
regards / pozdrawiam, Jaroslaw Staniek
 Kexi & KOffice (http://www.kexi-project.org, http://www.koffice.org)
 KDE Libraries for MS Windows (http://windows.kde.org)
 http://www.linkedin.com/in/jstaniek
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic