void AddToList() { bool hasFootnotes = footnotes.length() > 0; if ( !pageend ) pageend = pagestart; if ( !pagestart && !hasFootnotes ) return; int start = (pagestart && pageend) ? pagestart->getStart() : lastpageend; int h = (pagestart && pageend) ? pageend->getEnd()-pagestart->getStart() : 0; #ifdef DEBUG_FOOTNOTES if ( CRLog::isTraceEnabled() ) { if ( pagestart && pageend ) { //CRLog::trace("AddToList(%d, %d) footnotes: %d pageHeight=%d", pagestart->start, pageend->start+pageend->height, footnotes.length(), h); } else { //CRLog::trace("AddToList(Only footnote: %d) footnotes: %d pageHeight=%d", lastpageend, footnotes.length(), h); } } #endif LVRendPageInfo * page = new LVRendPageInfo(start, h, page_list->length()); lastpageend = start + h;//上一页末尾高度 if ( footnotes.length()>0 ) { page->footnotes.add( footnotes ); footnotes.clear(); footheight = 0; } page_list->add(page); }
bool setManglingKey(lString16 key) { if (key.startsWith(lString16(L"urn:uuid:"))) key = key.substr(9); _fontManglingKey.clear(); _fontManglingKey.reserve(16); lUInt8 b = 0; int n = 0; for (int i=0; i<key.length(); i++) { int d = hexDigit(key[i]); if (d>=0) { b = (b << 4) | d; if (++n > 1) { _fontManglingKey.add(b); n = 0; b = 0; } } } return _fontManglingKey.length() == 16; }
void reinit() { words_.init(); candidates_.clear(); }