I have a script which properly justifies the rich text in the Object Text i.e. left justify regular text, multiple levels of indent of enumerated lists and bullets, wile retaining Bold, Italics, Super- and Sub-script, Greek characters, etc., everything works well except wen there are multiple bullets in the same object. it works fine when there is only a single bullet in the Object Text, when there are more, only the last one is displayed. When I check the parameters going into applyTextFormattingToParagaph(), everything is right there, indicating it is not a logic error up to that point.just that somewhere between there and the paragraph accumulator buffer and getting the richtext back to the attribute something is lost. the file I have attached is a boiled down version of the script highlighting only what doesn't work in the of the whole script. Don Fowler - Thu May 09 18:51:12 EDT 2019 |
Re: Multiple Bullets in Single Object Text Attribute Rich Text has a lot of different bullets and it could be the case that the specific DOORS bullets are not the same as other DXL bullets and it could be that the formating that you try to implement is not what expected to recognied as bullets by DOORS. As there is no specific example of the object rich text that you try to format, there is no specific answer to the issue. If you download the rtf manual from microsoft you might be able to find what you need to build your code. But you need also to consider that each rtf string has a header that defines the formating (codepage, etc.) so you need to build this up also. When I had similar issue I tried to do that in word and then import it back as I found it easier to process all those things in word and then put it back to dxl. Or make the simplest processing be changing the definition of formating and then introduce the bullets and the indentation that DOORS defines. Othertwise it will not be accepted correctly and it is not going to be displayed as expected in the module. |
Re: Multiple Bullets in Single Object Text Attribute Costas..Aravidis - Fri May 10 02:00:23 EDT 2019 Rich Text has a lot of different bullets and it could be the case that the specific DOORS bullets are not the same as other DXL bullets and it could be that the formating that you try to implement is not what expected to recognied as bullets by DOORS. As there is no specific example of the object rich text that you try to format, there is no specific answer to the issue. If you download the rtf manual from microsoft you might be able to find what you need to build your code. But you need also to consider that each rtf string has a header that defines the formating (codepage, etc.) so you need to build this up also. When I had similar issue I tried to do that in word and then import it back as I found it easier to process all those things in word and then put it back to dxl. Or make the simplest processing be changing the definition of formating and then introduce the bullets and the indentation that DOORS defines. Othertwise it will not be accepted correctly and it is not going to be displayed as expected in the module. Actually, I have taken care of the case of rich text having many different kinds of bullets in another section of the script using integerOf(char c) and setting a boolean bullet to true. the rest of the script is some 700 lines of code. As a test case, I put in three lines of left-justified text then add bullets to them, that way I know that the code will know it is bullets. I run this code on the Object. After running the script there should be three lines of bulleted text, first line indented 360 twips (1/4 in.) to the bullet and subsequent lines (hanging) indented 710 twips. in fact what I get is three lines of text with the last line only bulleted. All indented 1/4 inch.
this is what is the output: Some text Some More Text
The logic in this code dictates that if a bullet is not detected the paragraph would not be indented at all, nor bulleted. It is not a misunderstood richText paragraph. it is isolated to either an error in my DXL coding in which the accumulator buffer, ParaAccum, is not the right vehicle to accumulate the rich text paragraphs, or there is an error in the standard DXL utility applyTextFormattingToParagraph() doesn't work with multiple lines of bullets or there might be something else that I am not seeing. |
Re: Multiple Bullets in Single Object Text Attribute
Just in case: a Paragraph that looks like it is bulleted could be one of the following: [] There is a bullet character followed by a tab at the start of the paragraph. -Louie |
Re: Multiple Bullets in Single Object Text Attribute llandale - Fri May 10 20:52:03 EDT 2019
Just in case: a Paragraph that looks like it is bulleted could be one of the following: [] There is a bullet character followed by a tab at the start of the paragraph. -Louie Yes, I check the first non-white space ascii character if (intOf c == 183 || intOf c == 32 || intOf c == 45) bullet = true which are a bullet character, a smaller bullet character and a dash. then lop off the character and any following white space after the bullet character. |