예제 #1
0
 void init()
 {
     _words.clear();
     //ldomDocument * doc = docview.getDocument();
     int pageIndex = -1; //docview.getCurPage();
     LVRef<ldomXRange> range = docview_.getPageDocumentRange( pageIndex );
     crtrace trace;
     if( !range.isNull() ) {
         LVArray<ldomWord> words;
         range->getRangeWords(words);
         for ( int i=0; i<words.length(); i++ ) {
             lString16 w = words[i].getText();
             lString8 encoded = encoding_.encode_string( w );
             if ( w.length() < DICT_MIN_WORD_LENGTH )
                 continue;
             /*
             trace << "string " << w <<
                 " encoded as " << encoded << "\n";
             */
             int index = -1;
             for ( int j=0; j<_words.length(); j++ )
                 if ( _words[j]->equals(w) ) {
                     index = j;
                     break;
                 }
             if ( index>=0 )
                 _words[index]->add( words[i] );  // add range to existing word
             else
                 _words.add( new WordWithRanges( w, encoded, words[i] ) ); // add new word
         }
     }
 }
예제 #2
0
 virtual void addEncryptedItem(EncryptedItem * item) {
     _list.add(item);
 }
예제 #3
0
 void addItem ( LVPDBContainerItem * item ) {
     _list.add(item);
 }