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

clean code

This commit is contained in:
Lu Wang 2013-03-31 12:53:44 +08:00
parent 472b3564e6
commit e454d784bd
2 changed files with 24 additions and 25 deletions

View File

@ -282,26 +282,6 @@ protected:
bool stroke_color_changed;
// font & size
const FontInfo * cur_font_info;
// managers store values actually used in HTML (i.e. scaled)
////////////////////////////////////////////////
TransformMatrixManager transform_matrix_manager;
StrokeColorManager stroke_color_manager;
LetterSpaceManager letter_space_manager;
WhitespaceManager whitespace_manager;
WordSpaceManager word_space_manager;
FillColorManager fill_color_manager;
FontSizeManager font_size_manager;
BottomManager bottom_manager;
HeightManager height_manager;
WidthManager width_manager;
RiseManager rise_manager;
LeftManager left_manager;
////////////////////////////////////////////////
BGImageSizeManager bgimage_size_manager;
// optimize for web
// we try to render the final font size directly
// to reduce the effect of ctm as much as possible
@ -336,7 +316,26 @@ protected:
// styles & resources
////////////////////////////////////////////////////
std::unordered_map<long long, FontInfo> font_name_map;
const FontInfo * cur_font_info;
std::unordered_map<long long, FontInfo> font_info_map;
// managers store values actually used in HTML (i.e. scaled)
////////////////////////////////////////////////
TransformMatrixManager transform_matrix_manager;
StrokeColorManager stroke_color_manager;
LetterSpaceManager letter_space_manager;
WhitespaceManager whitespace_manager;
WordSpaceManager word_space_manager;
FillColorManager fill_color_manager;
FontSizeManager font_size_manager;
BottomManager bottom_manager;
HeightManager height_manager;
WidthManager width_manager;
RiseManager rise_manager;
LeftManager left_manager;
////////////////////////////////////////////////
BGImageSizeManager bgimage_size_manager;
const Param * param;

View File

@ -525,13 +525,13 @@ const FontInfo * HTMLRenderer::install_font(GfxFont * font)
long long fn_id = (font == nullptr) ? 0 : hash_ref(font->getID());
auto iter = font_name_map.find(fn_id);
if(iter != font_name_map.end())
auto iter = font_info_map.find(fn_id);
if(iter != font_info_map.end())
return &(iter->second);
long long new_fn_id = font_name_map.size();
long long new_fn_id = font_info_map.size();
auto cur_info_iter = font_name_map.insert(make_pair(fn_id, FontInfo())).first;
auto cur_info_iter = font_info_map.insert(make_pair(fn_id, FontInfo())).first;
FontInfo & new_font_info = cur_info_iter->second;
new_font_info.id = new_fn_id;