Several Users want to select multiple object text and strikthru all selected object text. |
Re: DOORS Strikethru Function
If you are editing a single object text (in-place-editing), I don't think there is a way to select more than one contiguous group of letters. Buffer bufText = create() for obj in (current Module) do { if (isDeleted(obj)) continue if (!isSelected(obj)) continue bufText = "{//strikeout " // ?strikethrough? bufText += richTextWithOle(obj."Object Text") bufText += "}" obj."Object Text" = richText(bufText) } delete(bufText)
|
Re: DOORS Strikethru Function Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: DOORS Strikethru Function llandale - Wed Sep 28 14:34:13 EDT 2011
If you are editing a single object text (in-place-editing), I don't think there is a way to select more than one contiguous group of letters. Buffer bufText = create() for obj in (current Module) do { if (isDeleted(obj)) continue if (!isSelected(obj)) continue bufText = "{//strikeout " // ?strikethrough? bufText += richTextWithOle(obj."Object Text") bufText += "}" obj."Object Text" = richText(bufText) } delete(bufText)
I believe that we need to chunk the paragraph and use the RichText rt function to use the strike function. Any suggestion is appreciated. Second suggestion- clipboard cut/paste option is not clear to me how to implement. FZ Object obj Buffer bufText = create() for obj in (current Module) do { if (isDeleted(obj)) continue if (!isSelected(obj)) continue bufText = "{\\strike " bufText += richTextWithOle(obj."Object Text") bufText += "}" obj."Object Text" = richText(bufText) } delete(bufText) |
Re: DOORS Strikethru Function faisal.zahidi@boeing.com - Fri Sep 30 17:48:15 EDT 2011 int strikethru(Object currObj) { if ( null currObj ) { ack (NLS_("promote: null object.")) return -1 } if ( isDeleted currObj ) return level(currObj) Buffer text = create string s = richTextWithOle currObj.(NLS_("Object Text")) if (length (s) > 0) { text = (NLS_("{\\strike ")) text += richTextFragment( s ) text += (NLS_("}")) currObj.(NLS_("Object Text")) = richText stringOf(text) } return 0 } // when you move an object, you lose the current selection. // So better build a skip list of selected objects first Object firstObj = null Object lastObj = null Skip selection = create() Object o for o in current Module do { // if ( isSelected(o) ) { // put(selection, o, o) if ( null firstObj ) firstObj = o lastObj = o } } for o in selection do { // strikethru(o) } FZ |