| 2168 | } |
| 2169 | |
| 2170 | void DocumentPrivate::clearAndWaitForRequests() |
| 2171 | { |
| 2172 | m_pixmapRequestsMutex.lock(); |
| 2173 | qDeleteAll(m_pixmapRequestsStack); |
| 2174 | m_pixmapRequestsStack.clear(); |
| 2175 | m_pixmapRequestsMutex.unlock(); |
| 2176 | |
| 2177 | QEventLoop loop; |
| 2178 | bool startEventLoop = false; |
| 2179 | do { |
| 2180 | m_pixmapRequestsMutex.lock(); |
| 2181 | startEventLoop = !m_executingPixmapRequests.empty(); |
| 2182 | |
| 2183 | if (m_generator->hasFeature(Generator::SupportsCancelling)) { |
| 2184 | for (PixmapRequest *executingRequest : std::as_const(m_executingPixmapRequests)) { |
| 2185 | executingRequest->d->mShouldAbortRender = 1; |
| 2186 | } |
| 2187 | |
| 2188 | if (m_generator->d_ptr->mTextPageGenerationThread) { |
| 2189 | m_generator->d_ptr->mTextPageGenerationThread->abortExtraction(); |
| 2190 | } |
| 2191 | } |
| 2192 | |
| 2193 | m_pixmapRequestsMutex.unlock(); |
| 2194 | if (startEventLoop) { |
| 2195 | m_closingLoop = &loop; |
| 2196 | loop.exec(); |
| 2197 | m_closingLoop = nullptr; |
| 2198 | } |
| 2199 | } while (startEventLoop); |
| 2200 | } |
| 2201 | |
| 2202 | int DocumentPrivate::findFieldPageNumber(Okular::FormField *field) |
| 2203 | { |
no test coverage detected