| 5639 | } |
| 5640 | |
| 5641 | void DocumentPrivate::textGenerationDone(Page *page) |
| 5642 | { |
| 5643 | if (!m_pageController) { |
| 5644 | return; |
| 5645 | } |
| 5646 | |
| 5647 | // 1. If we reached the cache limit, delete the first text page from the fifo |
| 5648 | if (m_allocatedTextPagesFifo.size() == m_maxAllocatedTextPages) { |
| 5649 | int pageToKick = m_allocatedTextPagesFifo.takeFirst(); |
| 5650 | if (pageToKick != page->number()) // this should never happen but better be safe than sorry |
| 5651 | { |
| 5652 | m_pagesVector.at(pageToKick)->setTextPage(nullptr); // deletes the textpage |
| 5653 | } |
| 5654 | } |
| 5655 | |
| 5656 | // 2. Add the page to the fifo of generated text pages |
| 5657 | m_allocatedTextPagesFifo.append(page->number()); |
| 5658 | } |
| 5659 | |
| 5660 | void Document::setRotation(int r) |
| 5661 | { |
no test coverage detected