From ffea0f2e2f7bef5329aee617f9774faa7c48c19a Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 14 Jul 2021 18:00:07 +0200 Subject: [PATCH] Partially revert "Merge pull request #3330 from Sintun/master" This partially reverts commit 122daf1d640753ecd77208da6636e9e5ac4d0e07, reversing changes made to 4cd56dc5f5183e6ce107067d90634cc1901d926b. This fixes a fatal assertion for certain images: cell_y_.size() >= 2 && cell_x_.size() >= 2:Error:Assert failed:in file ../../../src/textord/tablerecog.cpp, line 363 Signed-off-by: Stefan Weil --- src/textord/colfind.cpp | 2 +- src/textord/tablefind.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/textord/colfind.cpp b/src/textord/colfind.cpp index 44f9e967bc..5d010d8bc3 100644 --- a/src/textord/colfind.cpp +++ b/src/textord/colfind.cpp @@ -37,8 +37,8 @@ #include "scrollview.h" #include "strokewidth.h" #include "tablefind.h" -#include "workingpartset.h" #include "tabletransfer.h" +#include "workingpartset.h" #include diff --git a/src/textord/tablefind.cpp b/src/textord/tablefind.cpp index fe825f1319..46bf4ed572 100644 --- a/src/textord/tablefind.cpp +++ b/src/textord/tablefind.cpp @@ -2003,7 +2003,7 @@ void TableFinder::MakeTableBlocks(ColPartitionGrid *grid, ColPartitionSet **all_ ScrollView::BLUE, ScrollView::LIGHT_BLUE); } #endif // GRAPHICS_DISABLED - + // initializing recognizer in order to extract table row and columnd info TableRecognizer recognizer; { @@ -2013,7 +2013,7 @@ void TableFinder::MakeTableBlocks(ColPartitionGrid *grid, ColPartitionSet **all_ recognizer.set_max_text_height(global_median_xheight_ * 2.0); recognizer.set_min_height(1.5 * gridheight()); } - + // Since we have table blocks already, remove table tags from all // colpartitions GridSearch gsearch(grid); @@ -2068,7 +2068,8 @@ void TableFinder::MakeTableBlocks(ColPartitionGrid *grid, ColPartitionSet **all_ table_partition->set_flow(BTFT_CHAIN); table_partition->SetBlobTypes(); grid->InsertBBox(true, true, table_partition); - + +#if 0 // This code triggers an assertion. // Insert table columns and rows into an api accessible object StructuredTable* table_structure = recognizer.RecognizeTable(table_box); if (table_structure != nullptr) { @@ -2084,9 +2085,10 @@ void TableFinder::MakeTableBlocks(ColPartitionGrid *grid, ColPartitionSet **all_ delete table_structure; } +#endif } } - + #ifndef GRAPHICS_DISABLED if (textord_show_tables) { table_grid_.DisplayBoxes(table_win);