Skip to content

Commit

Permalink
Fix CID 1270406, CID 1270407 and CID 1270411 Arguments in wrong order (
Browse files Browse the repository at this point in the history
…#1410)

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil authored and zdenop committed Mar 22, 2018
1 parent 660b366 commit 8c84d29
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions textord/tospace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ void Textord::block_spacing_stats(
blob_box = box_next (&blob_it);
if (blob_box.width () < minwidth)
minwidth = blob_box.width ();
gap_width = blob_box.left () - prev_blob_box.right ();
if (!ignore_big_gap (row, row_length, gapmap,
prev_blob_box.right (), blob_box.left ())) {
int16_t left = prev_blob_box.right();
int16_t right = blob_box.left();
gap_width = right - left;
if (!ignore_big_gap(row, row_length, gapmap, left, right)) {
all_gap_stats.add (gap_width, 1);

centre_to_centre = (blob_box.left () + blob_box.right () -
(prev_blob_box.left () +
prev_blob_box.right ())) / 2;
centre_to_centre = (right + blob_box.right () -
(prev_blob_box.left () + left)) / 2;
//DEBUG
centre_to_centre_stats.add (centre_to_centre, 1);
// DEBUG
Expand Down Expand Up @@ -245,11 +245,11 @@ void Textord::block_spacing_stats(
blob_box = reduced_box_next (row, &blob_it);
else
blob_box = box_next (&blob_it);
gap_width = blob_box.left () - prev_blob_box.right ();
int16_t left = prev_blob_box.right();
int16_t right = blob_box.left();
gap_width = right - left;
if ((gap_width > real_space_threshold) &&
!ignore_big_gap (row, row_length, gapmap,
prev_blob_box.right (),
blob_box.left ())) {
!ignore_big_gap(row, row_length, gapmap, left, right)) {
/*
If tosp_use_cert_spaces is enabled, the estimate of the space gap is
restricted to obvious spaces - those wider than half the xht or those
Expand Down Expand Up @@ -350,11 +350,12 @@ void Textord::row_spacing_stats(
blob_box = reduced_box_next (row, &blob_it);
else
blob_box = box_next (&blob_it);
gap_width = blob_box.left () - prev_blob_box.right ();
if (ignore_big_gap (row, row_length, gapmap,
prev_blob_box.right (), blob_box.left ()))
int16_t left = prev_blob_box.right();
int16_t right = blob_box.left();
gap_width = right - left;
if (ignore_big_gap(row, row_length, gapmap, left, right)) {
large_gap_count++;
else {
} else {
if (gap_width >= real_space_threshold) {
if (!tosp_row_use_cert_spaces ||
(gap_width > tosp_fuzzy_space_factor2 * row->xheight) ||
Expand Down Expand Up @@ -728,9 +729,10 @@ BOOL8 Textord::isolated_row_stats(TO_ROW *row,
blob_box = reduced_box_next (row, &blob_it);
else
blob_box = box_next (&blob_it);
gap_width = blob_box.left () - prev_blob_box.right ();
if (!ignore_big_gap (row, row_length, gapmap,
prev_blob_box.right (), blob_box.left ()) &&
int16_t left = prev_blob_box.right();
int16_t right = blob_box.left();
gap_width = right - left;
if (!ignore_big_gap(row, row_length, gapmap, left, right) &&
(gap_width > crude_threshold_estimate)) {
if ((gap_width > tosp_fuzzy_space_factor2 * row->xheight) ||
((gap_width > tosp_fuzzy_space_factor1 * row->xheight) &&
Expand Down

0 comments on commit 8c84d29

Please sign in to comment.