Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "mfcpch.h"
00021 #include "werdit.h"
00022
00023
00024
00025
00026
00027
00028
00029
00030 WERD *make_pseudo_word(PAGE_RES* page_res,
00031 TBOX &selection_box,
00032 BLOCK *&pseudo_block,
00033 ROW *&pseudo_row) {
00034 PAGE_RES_IT pr_it(page_res);
00035 C_BLOB_LIST new_blobs;
00036 C_BLOB_IT new_blob_it = &new_blobs;
00037 WERD *pseudo_word;
00038
00039 for (WERD_RES* word_res = pr_it.word(); word_res != NULL;
00040 word_res = pr_it.forward()) {
00041 WERD* word = word_res->word;
00042 if (word->bounding_box().overlap(selection_box)) {
00043 C_BLOB_IT blob_it(word->cblob_list());
00044 for (blob_it.mark_cycle_pt();
00045 !blob_it.cycled_list(); blob_it.forward()) {
00046 C_BLOB* blob = blob_it.data();
00047 if (blob->bounding_box().overlap(selection_box)) {
00048 new_blob_it.add_after_then_move(C_BLOB::deep_copy(blob));
00049 pseudo_row = pr_it.row()->row;
00050 pseudo_block = pr_it.block()->block;
00051 }
00052 }
00053 }
00054 }
00055 if (!new_blobs.empty())
00056 pseudo_word = new WERD(&new_blobs, 1, NULL);
00057 else
00058 pseudo_word = NULL;
00059 return pseudo_word;
00060 }