MCPcopy Create free account
hub / github.com/KDE/okular / textGenerationDone

Method textGenerationDone

core/document.cpp:5641–5658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5639}
5640
5641void 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
5660void Document::setRotation(int r)
5661{

Callers 1

Calls 4

numberMethod · 0.80
setTextPageMethod · 0.80
appendMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected