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

List:       koffice-devel
Subject:    Re: Problems with User-defined variables in KWord
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2006-03-17 11:52:23
Message-ID: 441AA2F7.5070006 () iidea ! pl
[Download RAW message or body]


Gary, thanks for so detailed explanation.

> Given these conflicting behaviors, two possible solutions come to mind:
> 
> 1.  Recursively walk the QDom tree and eliminate leading spaces in the content 
> of each textual node.  Then you can follow your calls to 
> QDomDocument::toString() with  simplyWhiteSpace() to collapse consecutive 
> spaces to a single space. 

 From my quick and simplified observations, QDomDocument::toString() 
unfourtanely already wastes the infromation contained within whitespaces:

oo.org XML string (1):
<elem1/><elem2/>

...becomes, after calling QDomDocument::toString() (2):
<elem1/>\n[some spaces for indentation]<elem2/>

...so simplifyWhiteSpace step will just transfer (1) to something like:
<elem1/> <elem2/>
         ^simplified whitespace

I can see that KWord properly saves elements within textual (text:p) context - 
everything inside text:p is saved within a single line. I dont know how it's 
performed (any hint?) but I cannot do this easily by postprocessing the string 
after QDomDocument::toString(). I prefer to reuse koffice saving code for ODF.

> 2.  Use a stylesheet to preprocess the document as suggested in the oo.org 
> spec I linked to.

I can use whatever koffice filter already used.

-- 
regards / pozdrawiam,
  Jaroslaw Staniek / OpenOffice Polska

Sponsored by OpenOffice Polska to work on
* Kexi & KOffice: http://www.kexi-project.org | http://koffice.org/kexi
* KDE3 & KDE4 Libraries For Developing MS Windows Applications:
                   http://www.kdelibs.com/wiki
See also:
* Kexi For MS Windows: http://kexi.pl/wiki/index.php/Kexi_for_MS_Windows
* Kexi Support:        http://www.kexi-project.org/support.html
_______________________________________________
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