diff --git a/crengine/src/hyphman.cpp b/crengine/src/hyphman.cpp index fd30f7efb..397e55bd6 100644 --- a/crengine/src/hyphman.cpp +++ b/crengine/src/hyphman.cpp @@ -1103,7 +1103,6 @@ bool AlgoHyph::hyphenate( const lChar32 * str, int len, lUInt16 * widths, lUInt8 if ( len > WORD_LENGTH-2 ) len = WORD_LENGTH - 2; lStr_getCharProps( str, len, chprops ); - bool res = false; int min = len+1; int nb_visible = 0; diff --git a/crengine/src/lvdocview.cpp b/crengine/src/lvdocview.cpp index 6eca8d971..89379d54f 100644 --- a/crengine/src/lvdocview.cpp +++ b/crengine/src/lvdocview.cpp @@ -136,7 +136,9 @@ static css_font_family_t DEFAULT_FONT_FAMILY = css_ff_sans_serif; /// minimum EM width of page (prevents show two pages for windows that not enougn wide) #define MIN_EM_PER_PAGE 20 +#if USE_LIMITED_FONT_SIZES_SET static int def_font_sizes[] = { 18, 20, 22, 24, 29, 33, 39, 44 }; +#endif LVDocView::LVDocView(int bitsPerPixel, bool noDefaultDocument) : m_bitsPerPixel(bitsPerPixel), m_dx(400), m_dy(200), _pos(0), _page(0), diff --git a/crengine/src/lvfntman.cpp b/crengine/src/lvfntman.cpp index 26989892a..2129148f7 100644 --- a/crengine/src/lvfntman.cpp +++ b/crengine/src/lvfntman.cpp @@ -2880,9 +2880,13 @@ class LVFreeTypeFace : public LVFont hb_shape(_hb_font, _hb_buffer, _hb_features.ptr(), (unsigned int)_hb_features.length()); // Harfbuzz has guessed and set a direction even if we did not provide one. + #ifdef DEBUG_MEASURE_TEXT bool is_rtl = false; + #endif if ( hb_buffer_get_direction(_hb_buffer) == HB_DIRECTION_RTL ) { + #ifdef DEBUG_MEASURE_TEXT is_rtl = true; + #endif // "For buffers in the right-to-left (RTL) or bottom-to-top (BTT) text // flow direction, the directionality of the buffer itself is reversed // for final output as a matter of design. Therefore, HarfBuzz inverts @@ -2947,7 +2951,6 @@ class LVFreeTypeFace : public LVFont int cur_cluster = 0; int hg = 0; // index in glyph_info/glyph_pos int hcl = 0; // cluster glyph at hg - bool is_cluster_tail = false; int t_notdef_start = -1; int t_notdef_end = -1; for (int t = 0; t < len; t++) { @@ -3132,9 +3135,6 @@ class LVFreeTypeFace : public LVFont } // _kerningMode == KERNING_MODE_HARFBUZZ else if (_kerningMode == KERNING_MODE_HARFBUZZ_LIGHT) { - unsigned int glyph_count; - hb_glyph_info_t* glyph_info = 0; - hb_glyph_position_t* glyph_pos = 0; struct LVCharTriplet triplet; struct LVCharPosInfo posInfo; triplet.Char = 0; @@ -3625,10 +3625,9 @@ class LVFreeTypeFace : public LVFont int value = 0; // Tables we might look at TT_OS2 * os2 = (TT_OS2 *)FT_Get_Sfnt_Table(_face, FT_SFNT_OS2); - bool has_ot_math_data = false; #if MATHML_SUPPORT==1 #if USE_HARFBUZZ==1 - has_ot_math_data = hb_ot_math_has_data(hb_font_get_face(_hb_font)); + bool has_ot_math_data = hb_ot_math_has_data(hb_font_get_face(_hb_font)); #define VALUE_FROM_OT_MATH_CONSTANT(x) if ( has_ot_math_data ) { \ value = hb_ot_math_get_constant(_hb_font, HB_OT_MATH_CONSTANT_##x); \ value_set = true; } @@ -4409,11 +4408,6 @@ class LVFreeTypeFace : public LVFont } // _kerningMode == KERNING_MODE_HARFBUZZ else if (_kerningMode == KERNING_MODE_HARFBUZZ_LIGHT) { - hb_glyph_info_t *glyph_info = 0; - hb_glyph_position_t *glyph_pos = 0; - unsigned int glyph_count; - int w; - unsigned int len_new = 0; struct LVCharTriplet triplet; struct LVCharPosInfo posInfo; triplet.Char = 0; diff --git a/crengine/src/lvpagesplitter.cpp b/crengine/src/lvpagesplitter.cpp index b24b80c6b..b346e0b83 100644 --- a/crengine/src/lvpagesplitter.cpp +++ b/crengine/src/lvpagesplitter.cpp @@ -1386,12 +1386,10 @@ bool LVRendPageInfo::deserialize( SerialBuf & buf ) void LVRendPageList::replacePages(int old_y, int old_h, LVRendPageList * pages, int next_pages_shift_y) { - int i = 0; int remove_idx = -1; int remove_count = 0; int insert_idx = -1; int added_count = pages->length(); - int new_page_index_shift = 0; for ( int i=0; i < length(); i++ ) { LVRendPageInfo * pi = ((*this)[i]); if ( pi->start + pi->height <= old_y ) { diff --git a/crengine/src/lvrend.cpp b/crengine/src/lvrend.cpp index 6a3045f8e..cb4a87b3f 100644 --- a/crengine/src/lvrend.cpp +++ b/crengine/src/lvrend.cpp @@ -7428,7 +7428,6 @@ void renderBlockElementEnhanced( FlowState * flow, ldomNode * enode, int x, int // we should compute our width from the child style, and possibly // from its rendered content width. ldomNode * child = enode->getChildNode(0); - lUInt16 childElementId = child->getNodeId(); css_style_ref_t child_style = child->getStyle(); // We may tweak child styles diff --git a/crengine/src/lvstsheet.cpp b/crengine/src/lvstsheet.cpp index d0dc84b60..ddb66c9d2 100644 --- a/crengine/src/lvstsheet.cpp +++ b/crengine/src/lvstsheet.cpp @@ -23,10 +23,12 @@ //#define DUMP_CSS_PARSING // Helper to debug string parsing, showing current position and context +#if 0 static void dbg_str_pos(const char * prefix, const char * str) { printf("/----------|---------- %s\n", prefix); printf("\\%.*s\n", 20, str - 10); } +#endif #define IMPORTANT_DECL_HIGHER ((lUInt32)0x80000000U) // | to prop_code #define IMPORTANT_DECL_SET ((lUInt32)0x40000000U) // | to prop_code @@ -317,6 +319,7 @@ inline bool css_is_alnum( char ch ) return ( css_is_alpha(ch) || ( ch>='0' && ch<='9' ) ); } +#if 0 static int substr_compare( const char * sub, const char * & str ) { int j; @@ -334,6 +337,7 @@ static int substr_compare( const char * sub, const char * & str ) } return 0; } +#endif inline char toLower( char c ) { diff --git a/crengine/src/lvtextfm.cpp b/crengine/src/lvtextfm.cpp index f081dc3b0..4d0c815ca 100644 --- a/crengine/src/lvtextfm.cpp +++ b/crengine/src/lvtextfm.cpp @@ -6054,7 +6054,6 @@ void LFormattedText::Draw( LVDrawBuf * buf, int x, int y, ldomMarkedRangeList * for (j=0; jword_count; j++) { word = &frmline->words[j]; srcline = &m_pbuffer->srctext[word->src_text_index]; - ldomNode * node = (ldomNode *) srcline->object; if (word->flags & LTEXT_WORD_IS_PAD && word->o.baseline ) { // there is some border to draw bool is_right_pad = srcline->o.objflags & LTEXT_OBJECT_IS_PAD_RIGHT; bool is_mirrored = word->flags & LTEXT_WORD_DIRECTION_IS_RTL; // will be drawn as if on the other side diff --git a/crengine/src/lvtinydom.cpp b/crengine/src/lvtinydom.cpp index a63b163aa..a8d12774a 100644 --- a/crengine/src/lvtinydom.cpp +++ b/crengine/src/lvtinydom.cpp @@ -5437,7 +5437,7 @@ bool ldomDocument::partialRender( ldomNode * node ) { lvRect new_rc; node->getAbsRect(new_rc); int orig_h = orig_rc.bottom - base_y; - int new_h = new_rc.bottom - base_y; + // int new_h = new_rc.bottom - base_y; int next_fragments_shift_y = new_rc.bottom - orig_rc.bottom; // printf("fixing fragment %d (%d ~ %d => %d , +%d => +%d)\n", node->getNodeIndex(), base_y, orig_rc.top, new_rc.top, orig_h, new_h);