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

List:       koffice-devel
Subject:    Re: Koffice file manipulation
From:       David Faure <dfaure () trolltech ! com>
Date:       2003-08-27 16:40:26
[Download RAW message or body]

On Wednesday 27 August 2003 18:26, Michael Hoeller wrote:
> Hi Nicolas,
> 
> thanks for the hint. This works as long as you only relpace a string. 
> But the Format is not covered this way. So if a tag is ^adr1 and marked 
> as bold so the xml format contains "bold" at the offset of ^adr1, in 
> the length of ^adr1. This is not want you want when the replaced String 
> is longer than the tag..

But this is exactly what my suggestion covers:

when you replace N chars with M at position P, you need to
* update P's format to add M-N to its length
* update all formats after P by adding M-N to their starting position
(M-N can be negative, no problem).

-- 
David FAURE, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://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