// Remove indents from object text /* Modification history: Date: Who: Description: 12 Sep 2006 R.Swan Initial Entry Comments 1) Enhancements 1) use buffer/skiplist to avoid overuse of strings. 2) Handle the case where object has multiple paras, and some are indented. */ //--------------declarations---------- Module sm Object so so = current Object sm = current Module int ocount int ccount RichTextParagraph rp string s string str2 string shead bool DontTouch //-----------Functions, Routines, and Procedures--------------- //========= void CheckCanRun () { if (null current Module) { ack "Please run this function from a module" halt } } //======== //----------------Main Code Body------------------- //monitor code //print "--GO-- \n" CheckCanRun infoBox "This routine will remove all indents from the visible objects. \nDon't save until you've checked nothing else has gone.\n Those containing bullets or OLE will not be changed.\n" ocount = 0 ccount = 0 for so in sm do { ocount++ s = richText so."Object Text" shead = so."Object Heading" if (!(shead == "")) {//print (identifier so) " = " "found a header" " .." stest ".. \n" continue } else {//print "found text" " .." s ".. \n" DontTouch= false for rp in s do { if (rp.isBullet) { DontTouch= true //print (identifier so) " " "has a bullet \n" break//if any part is a bullet exit } if (oleCount(so."Object Text")>0) { DontTouch= true //print ((identifier so) " " "has an OLE \n") break//if any part is a ole exit } if (rp.indentLevel ==0) { DontTouch= true //print (identifier so) " " "has no indents set\n" break //this is a weakness ifthere are multiple parts in the object. } } if (! DontTouch) { ccount++ s = richText so."Object Text" so."Object text" = richText (applyTextFormattingToParagraph(s,false,0,0)) } } } infoBox "Checked " ocount " Objects; "ccount " changed \n" Objects