![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: RichText indentLevel Bug Topic Summary: The RichText.indentLevel attribute doesn't work correctly Created On: 20-Sep-2005 03:15 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi all, |
|
![]() |
|
![]() |
|
I also found that this does not work. It must be done at the paragraph level. Here is an example loop that uses it. (Thanks to Michael Sutherland!!! This is from his "Normalize Rich Text" script on his web site.) (FYI - I tried to use "Attach Code" but it has a rediculous limit of 2000 characters!
RichTextParagraph rp for rp in richStringOld do { rtfParaCount++ // debug( "\tRTF Para: " rtfParaCount "" ) // debug( "\t\tRTF Para Text: " rp.text "" ) // Bullets and indents exist at rich text paragraph level // Apart from the bullet characters themselves nothing needs to be done if this // paragraph has the same format as the last one if ((rp.isBullet != bulletsOn) || (rp.indentLevel != indent)) { // Paragraph format has changes richBufferNew += "\\pard" if ( rp.isBullet ) { // debug( "\t\tBullets On" ) richBufferNew += "{\\pntext\\f1\\'B7\\tab}{\\*\\pn\\pnlvlblt\\pnf1\\pnindent0{\\pntxtb\\'B7}}" bulletsOn = true includeSymbols = true } else { bulletsOn = false } if ( rp.indentLevel != 0 ) { // debug( "\t\tIndentLevel " rp.indentLevel "" ) richBufferNew += "\\li" richBufferNew += rp.indentLevel " " } indent = rp.indentLevel if (!rp.isBullet && (rp.indentLevel == 0)) { richBufferNew += " " } } else { if ( rp.isBullet ) { // debug( "\t\tBullets On" ) richBufferNew += "{\\pntext\\f1\\'B7\\tab}" } if ( rp.indentLevel != 0 ) { // debug( "\t\tIndentLevel " rp.indentLevel "" ) } } RichText rt int rtfChunkCount = 0 for rt in rp do { // Test contents of each chunk and insert rich text codes as required setempty textChunk textChunk = rt.text setempty markupPrefix setempty markupSuffix rtfChunkCount++ // debug( "\t\tRTF Chunk: " rtfChunkCount " - " textChunk "") if ( rt.bold ) { tempBuff = tempStringOf(markupPrefix) markupPrefix = "{\\b " markupPrefix += tempBuff markupSuffix += "}" // debug( "\t\t\tBold" ) } if ( rt.italic ) { tempBuff = tempStringOf(markupPrefix) markupPrefix = "{\\i " markupPrefix += tempBuff markupSuffix += "}" // debug( "\t\t\tItalic" ) } if ( rt.strikethru ) { tempBuff = tempStringOf(markupPrefix) markupPrefix = "{\\strike " markupPrefix += tempBuff markupSuffix += "}" // debug( "\t\t\tStrikethru" ) } if ( rt.underline ) { tempBuff = tempStringOf(markupPrefix) markupPrefix = "{\\ul " markupPrefix += tempBuff markupSuffix += "}" // debug( "\t\t\tUnderline" ) } if ( rt.superscript ) { tempBuff = tempStringOf(markupPrefix) markupPrefix = "{\\super " markupPrefix += tempBuff markupSuffix += "}" // debug( "\t\t\tSuperscript" ) } if ( rt.subscript ) { tempBuff = tempStringOf(markupPrefix) markupPrefix = "{\\sub " markupPrefix += tempBuff markupSuffix += "}" // debug( "\t\t\tSubscript" ) } if ( rt.isOle ) { oCount++ extractRichOle( o, attr, oCount, textChunk ) // debug( "\t\t\tOle " oCount "") } // if ( rt.newline && !rt.last) { if ( rt.newline) { // markupSuffix += "\\par\n" // debug( "\t\t\tNewline" ) } if ( rt.charset == charsetSymbol ) { includeSymbols = true markupPrefix += "{\\f1 " tempBuff = tempStringOf(markupSuffix) markupSuffix = "}" markupSuffix += tempBuff // debug( "\t\t\tCharacter Set Symbol " "[" rt.text "]" ) } // No action will be taken for the following character sets: if ( rt.charset == charsetAnsi ) { // debug( "\t\t\tCharacter Set Ansi" ) } if ( rt.charset == charsetGreek ) { // debug( "\t\t\tCharacter Set Greek" ) } if ( rt.charset == charsetRussian ) { // debug( "\t\t\tCharacter Set Russian" ) } if ( rt.charset == charsetEastEurope ) { // debug( "\t\t\tCharacter Set EastEurope" ) } if ( rt.charset == charsetTurkish ) { // debug( "\t\t\tCharacter Set Turkish" ) } if ( rt.charset == charsetHebrew ) { // debug( "\t\t\tCharacter Set Hebrew" ) } // Check for backslashes in text. These need to be escaped if ( !rt.isOle ) { if (contains(textChunk, '\\') >= 0) { escapeBackSlashes(textChunk) } } // Rebuild RTF chunk richBufferNew += markupPrefix richBufferNew += textChunk richBufferNew += markupSuffix } } ------------------------- Shawn Stepper shawn.e.stepper@wellsfargo.com |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
RichText indentLevel Bug
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.