| 550 | #define PageTextsMaxCount 300 |
| 551 | |
| 552 | void Preference::cachePageTexts(const ElementPtr &rootElement) { |
| 553 | if (this->_pageTextsCache.size() > PageTextsMaxCount) { |
| 554 | this->_pageTextsCache.erase(this->_pageTextsCache.begin(), |
| 555 | this->_pageTextsCache.begin() + 20); |
| 556 | } |
| 557 | if (rootElement && !rootElement->getText().empty()) { |
| 558 | this->_pageTextsCache.push_back(rootElement->getText()); |
| 559 | } |
| 560 | for (const auto &childElement: rootElement->getChildren()) { |
| 561 | this->cachePageTexts(childElement); |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | |
| 566 | void Preference::setListenMode(bool listen) { |