! Remove block from background checking queue \param pBlock Block to remove When the last block is removed from the queue, the background timer is stopped. The function does not return before the background spell-checking timer has stopped. */
| 3530 | spell-checking timer has stopped. |
| 3531 | */ |
| 3532 | bool |
| 3533 | FL_DocLayout::dequeueBlockForBackgroundCheck(fl_BlockLayout *pBlock) |
| 3534 | { |
| 3535 | bool bRes = false; |
| 3536 | |
| 3537 | // Remove block from queue if it's found there |
| 3538 | bRes = pBlock->isQueued(); |
| 3539 | if (bRes) { |
| 3540 | pBlock->dequeueFromSpellCheck(); |
| 3541 | } |
| 3542 | if(pBlock == m_PendingBlockForGrammar) |
| 3543 | { |
| 3544 | xxx_UT_DEBUGMSG(("Dequeue block %x in dequeue \n",pBlock)); |
| 3545 | m_PendingBlockForGrammar = NULL; |
| 3546 | } |
| 3547 | // When queue is empty, kill timer |
| 3548 | if (spellQueueHead() == NULL) |
| 3549 | { |
| 3550 | m_bStopSpellChecking = true; |
| 3551 | if(m_pBackgroundCheckTimer) |
| 3552 | { |
| 3553 | m_pBackgroundCheckTimer->stop(); |
| 3554 | // Wait for checking to complete before returning. |
| 3555 | while(m_bImSpellCheckingNow == true) |
| 3556 | { |
| 3557 | // TODO shouldn't we have a little sleep here? |
| 3558 | } |
| 3559 | } |
| 3560 | } |
| 3561 | |
| 3562 | return bRes; |
| 3563 | } |
| 3564 | |
| 3565 | /*! |
| 3566 | Mark a region of a block to be spell checked |
no test coverage detected