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

List:       koffice-devel
Subject:    Re: otag ??
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-11-26 17:03:52
[Download RAW message or body]

On Sunday 26 November 2000 13:23, Thomas Zander wrote:
> All over kword the term otag is used (open tag) while saving something to XML \
> files. 
> This is very common:
> out << otag << "<TAGNAME>" << endl;
> out << etag << "/TAGNAME>" << endl;
> 
> Question I have is how do I do something like:
> 
> out << otag << "<TAGNAME />" << etag << endl;
> 
> The way is should be done ;) (I.e. without the last etag)
> 
> I figured something like the following would work, but I can't get it
> to compile:
> 
> QString indent = otag;
> 
> kword_frame.cc:1153: conversion from `QTextStream & ()(QTextStream &)' to \
> non-scalar type `QString' requested 
> Could someone explain in english what the h*ll the first type is ??  
> (The QTextStream & ()(QTextStream &))

otag is a function, not a string. It generates correct indentation.
Look in koffice/lib/koml/komlWriter.* for what otag really is/does.

Note that if you are working on KWord's loading/saving code, it would
be a really good idea to move away from koml and use QDom directly.
Besides being more efficient, cleaner, and more standard, you would
also avoid having to care about identation :-)

-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://www.mandrakesoft.com/~david/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today
See http://www.kde.org/kde1-and-kde2.html for how to set up KDE 2

_______________________________________________
Koffice-devel mailing list
Koffice-devel@master.kde.org
http://master.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