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

List:       calligra-devel
Subject:    Re: Using ODF Relax NG schema to generate easier XML writing classes
From:       Thorsten Zachmann <t.zachmann () zagge ! de>
Date:       2011-06-11 5:56:18
Message-ID: 201106110756.18177.t.zachmann () zagge ! de
[Download RAW message or body]

On Friday, June 10, 2011 17:06:15 Jos van den Oever wrote:
> On Friday, June 10, 2011 08:22:04 AM Jos van den Oever wrote:
> > Here is an idea to improve code quality in Calligra.
> 
> Here is a version that works fine with a small example use:
> 
> #include "odf.h"
> #include <QtCore/QBuffer>
> #include <QtCore/QFile>
> 
> int
> main() {
>     QFile out;
>     out.open(stdout, QIODevice::WriteOnly);
>     KoXmlWriter xml(&out);
>     {
>         OfficeDocumentWriter doc(&xml);
>         OfficeBodyWriter content(doc);
>         OfficeTextWriter text(content);
>         {
>             TextHWriter h(text);
>             h.addTextNode("Hello ODF!");
>         }
>         {
>             TextPWriter p(text);
>             p.addTextNode("This is paragraph 1.");
>         }
>     }
>     out.close();
>     return 0;
> }

That code looks a bit ugly but I have no idea on how to improve that.

Also one thing to notice is that this will increase compilation time quite a 
but I would guess.

Thorsten

_______________________________________________
calligra-devel mailing list
calligra-devel@kde.org
https://mail.kde.org/mailman/listinfo/calligra-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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