public int handleCtrlWord ( RtfCtrlWordData ctrlWordData ) { int result = errOK ; this . ctrlWordCount ++ ; // stats if ( debugParser ) { RtfParser . outputDebug ( this . rtfDoc , groupLevel , "DEBUG: handleCtrlWord=" + ctrlWordData . ctrlWord + " param=[" + ctrlWordData . param + "]" ) ; } if ( this . getTokeniserState ( ) == TOKENISER_SKIP_GROUP ) { this . ctrlWordSkippedCount ++ ; if ( debugParser ) { RtfParser . outputDebug ( this . rtfDoc , groupLevel , "DEBUG: SKIPPED" ) ; } return result ; } // RtfDestination dest = (RtfDestination)this.getCurrentDestination(); // boolean handled = false; // if(dest != null) { // handled = dest.handleControlWord(ctrlWordData); // } result = this . rtfKeywordMgr . handleKeyword ( ctrlWordData , this . groupLevel ) ; if ( result == errOK ) { this . ctrlWordHandledCount ++ ; } else { this . ctrlWordNotHandledCount ++ ; result = errOK ; // hack for now. } return result ; }
Handles control word tokens . Depending on the current state a control word can lead to a state change . When parsing the actual document contents certain tabled values are remapped . i . e . colors fonts styles etc .