1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-05 01:28:39 +00:00

Fix issue of calling abs() in C stdlib

This commit is contained in:
Duan Yao 2014-06-24 16:31:33 +08:00
parent 04630b3020
commit 04c66439ba
3 changed files with 5 additions and 5 deletions

View File

@ -230,7 +230,7 @@ void HTMLRenderer::processLink(AnnotLink * al)
x, y, w, h,
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;";
else
(*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;
//ignore near-zero offsets
if(abs(target) <= param.h_eps)
if(std::abs(target) <= param.h_eps)
{
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)))
{
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 = ' ';
writeUnicodes(out, &u, 1);
@ -351,7 +351,7 @@ void HTMLTextLine::optimize_normal(std::vector<HTMLTextLine*> & lines)
{
const double target = off_iter->width;
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;
}

View File

@ -44,7 +44,7 @@ public:
// return the corresponding id
long long install(double new_value, double * actual_value_ptr = nullptr) {
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)
*actual_value_ptr = iter->first;