mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
..
This commit is contained in:
parent
2799244987
commit
6746a3a0ab
@ -6,8 +6,6 @@
|
||||
* Copyright (C) 2013 Lu Wang <coolwanglu@gmail.com>
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "HTMLTextPage.h"
|
||||
|
||||
namespace pdf2htmlEX {
|
||||
@ -23,7 +21,10 @@ HTMLTextPage::HTMLTextPage(const Param & param, AllStateManager & all_manager)
|
||||
|
||||
void HTMLTextPage::dump_text(ostream & out)
|
||||
{
|
||||
prepare();
|
||||
for(auto iter = text_lines.begin(); iter != text_lines.end(); ++iter)
|
||||
(*iter)->prepare();
|
||||
if(param.optimize_text)
|
||||
optimize();
|
||||
for(auto iter = text_lines.begin(); iter != text_lines.end(); ++iter)
|
||||
(*iter)->dump_text(out);
|
||||
}
|
||||
@ -74,21 +75,6 @@ void HTMLTextPage::open_new_line(void)
|
||||
}
|
||||
}
|
||||
|
||||
static bool is_text_line_empty(const unique_ptr<HTMLTextLine>& p)
|
||||
{
|
||||
return p->empty();
|
||||
}
|
||||
|
||||
void HTMLTextPage::prepare(void)
|
||||
{
|
||||
// remove empty lines
|
||||
text_lines.erase(remove_if(text_lines.begin(), text_lines.end(), is_text_line_empty), text_lines.end());
|
||||
for(auto iter = text_lines.begin(); iter != text_lines.end(); ++iter)
|
||||
(*iter)->prepare();
|
||||
if(param.optimize_text)
|
||||
optimize();
|
||||
}
|
||||
|
||||
void HTMLTextPage::optimize(void)
|
||||
{
|
||||
//TODO
|
||||
|
@ -39,7 +39,6 @@ public:
|
||||
void open_new_line(void);
|
||||
|
||||
private:
|
||||
void prepare(void);
|
||||
void optimize(void);
|
||||
|
||||
const Param & param;
|
||||
|
Loading…
Reference in New Issue
Block a user