![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Returning Rich Text In Layout View Topic Summary: Unwanted RT Markup Returned Created On: 14-Mar-2005 18:02 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: The diff function takes two input Buffers and computes some RTF which describes the differences as redlining. The inputs are treated as plain text, so if you pass in a buffer which is RTF, it just treats it as ordinary text which happens to have a lot of \ and {} characters in it. When it then wraps up the diffs in the RTF markup which describes the additions/deletions, it will escape the \, { and } characters in the original text by putting an extra \ in front of them. This is why you see them even if you use displayRich. I don't see an easy solution to this. You could try attempting to remove the escape characters in the result string (i.e. look for \\ and replace it with \, so \\par becomes \par and is displayed correctly by displayRich). If you did this blindly, you'd most likely end up with a nested rich text string like {\rtf1 ... {\rtf1 .....}} where the outer \rtf was generated by the diff function and the inner one was derived from the input. I don't know how well this would display, and I don't know what would happen if the RTF headers in your two inputs were themselves different... Good luck Judith | |
![]() |
|
I am trying to update some code which pulls object text from two different modules, runs the diff() function on it and puts the result in a column in one of the modules. Originally, any formatting (e.g. bold) was stripped, but now we want to keep it. No matter how I try to grab the original text and how I try to put it in the column with the displayRich function, I keep getting the RT header and /par markup. The underlining and strike throughs from the diff function look fine. Right now, I am still just testing it on plain text, so I don't have the issue of the bolding yet.
To get the richText string (which I am assigning to a buffer) I've tried: - buf = richTextwithOle(obj."Object Text") - buf = richTextNoOle(obj."Object Text") - buf = richText(obj."Object Text") To return the resulting buffer text I've tried: - displayRich result - displayRich stringOf(result) - displayRich richTextFragment(stringOf(result)) - displayRich richTextFragment(result) I've probably tried more things than that, but I can't remember them all. If I get the text back, it invariably begins with some rict text header information, including the font table, and the paragraphs are separated by the /par markup. I'm trying to keep my formatting without seeing the extra markup. ------------------------- Jeremy Eble Software Engineer Teragon Consulting LLC jeremy.r.eble@lmco.com |
|
![]() |
|
![]() |
|
The diff function takes two input Buffers and computes some RTF which describes the differences as redlining. The inputs are treated as plain text, so if you pass in a buffer which is RTF, it just treats it as ordinary text which happens to have a lot of \ and {} characters in it. When it then wraps up the diffs in the RTF markup which describes the additions/deletions, it will escape the \, { and } characters in the original text by putting an extra \ in front of them. This is why you see them even if you use displayRich.
I don't see an easy solution to this. You could try attempting to remove the escape characters in the result string (i.e. look for \\ and replace it with \, so \\par becomes \par and is displayed correctly by displayRich). If you did this blindly, you'd most likely end up with a nested rich text string like {\rtf1 ... {\rtf1 .....}} where the outer \rtf was generated by the diff function and the inner one was derived from the input. I don't know how well this would display, and I don't know what would happen if the RTF headers in your two inputs were themselves different... Good luck Judith |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Returning Rich Text In Layout View
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.