Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 20-Sep-2005 03:15
User is offline View Users Profile Print this message


Tim Schier

Posts: 1
Joined: 10-Dec-2004

Hi all,

Has anyone else has problems with RichText.indentLevel returning erroneous numbers instead of the expected multiples of 360?

Running the following simple script illustrates the problem:
Object o = current Object
string s = richTextWithOle o."Object text"
RichText rt
for rt in s do{
  print ((rt.indentLevel)) "\n"
}

Notes:
- RichParagraph.indentLevel works fine. I could work around the current code to use it, but would like to think that shouldn't be necessary
- The integer->string conversion/concatenation problem mentioned in the "intOf(Date d) != (intOf(Date d))" thread of the Defect/Issue Tracking forum doens't solve the problem.

All feedback welcome, please.

    Tim Schier
    Boeing Australia

Report this to a Moderator Report this to a Moderator
 20-Sep-2005 17:10
User is offline View Users Profile Print this message


Shawn Stepper

Posts: 96
Joined: 6-Aug-2004

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.