1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

Merge pull request #375 from duanyao/Fix_abs

Fix issue of calling abs() in C stdlib
This commit is contained in:
Lu Wang 2014-06-24 11:29:28 -07:00
commit 3c5d491a95
3 changed files with 5 additions and 5 deletions

View File

@ -230,7 +230,7 @@ void HTMLRenderer::processLink(AnnotLink * al)
x, y, w, h, x, y, w, h,
border_top_bottom_width, border_left_right_width); border_top_bottom_width, border_left_right_width);
if(abs(border_top_bottom_width - border_left_right_width) < EPS) if(std::abs(border_top_bottom_width - border_left_right_width) < EPS)
(*f_curpage) << "border-width:" << round(border_top_bottom_width) << "px;"; (*f_curpage) << "border-width:" << round(border_top_bottom_width) << "px;";
else else
(*f_curpage) << "border-width:" << round(border_top_bottom_width) << "px " << round(border_left_right_width) << "px;"; (*f_curpage) << "border-width:" << round(border_top_bottom_width) << "px " << round(border_left_right_width) << "px;";

View File

@ -168,7 +168,7 @@ void HTMLTextLine::dump_text(ostream & out)
double actual_offset = 0; double actual_offset = 0;
//ignore near-zero offsets //ignore near-zero offsets
if(abs(target) <= param.h_eps) if(std::abs(target) <= param.h_eps)
{ {
actual_offset = 0; actual_offset = 0;
} }
@ -179,7 +179,7 @@ void HTMLTextLine::dump_text(ostream & out)
if(!(state_iter1->hash_umask & State::umask_by_id(State::WORD_SPACE_ID))) if(!(state_iter1->hash_umask & State::umask_by_id(State::WORD_SPACE_ID)))
{ {
double space_off = state_iter1->single_space_offset(); double space_off = state_iter1->single_space_offset();
if(abs(target - space_off) <= param.h_eps) if(std::abs(target - space_off) <= param.h_eps)
{ {
Unicode u = ' '; Unicode u = ' ';
writeUnicodes(out, &u, 1); writeUnicodes(out, &u, 1);
@ -351,7 +351,7 @@ void HTMLTextLine::optimize_normal(std::vector<HTMLTextLine*> & lines)
{ {
const double target = off_iter->width; const double target = off_iter->width;
auto iter = width_map.lower_bound(target-EPS); auto iter = width_map.lower_bound(target-EPS);
if((iter != width_map.end()) && (abs(iter->first - target) <= EPS)) if((iter != width_map.end()) && (std::abs(iter->first - target) <= EPS))
{ {
++ iter->second; ++ iter->second;
} }

View File

@ -44,7 +44,7 @@ public:
// return the corresponding id // return the corresponding id
long long install(double new_value, double * actual_value_ptr = nullptr) { long long install(double new_value, double * actual_value_ptr = nullptr) {
auto iter = value_map.lower_bound(new_value - eps); auto iter = value_map.lower_bound(new_value - eps);
if((iter != value_map.end()) && (abs(iter->first - new_value) <= eps)) if((iter != value_map.end()) && (std::abs(iter->first - new_value) <= eps))
{ {
if(actual_value_ptr != nullptr) if(actual_value_ptr != nullptr)
*actual_value_ptr = iter->first; *actual_value_ptr = iter->first;