Hi Marcin,

...
> OK, this is pretty clear. Yet starting the check is not such a big issue 
> to me - I still don't know where the results of the check should go. Is 
> there API to dispatch them somewhere? I'm trying to write a skeleton of 
> the method that will call our checker on the paragraph but I simply 
> don't know what to do with the results of the check.

For simple Grammar checker implementation that does not use a new thread
to get the result you can look up the file grammarchecker.cxx in linguistic.
At the end of the function GrammarChecker::doGrammarChecking there is
the code that notifies the listeners (should only be the GC Iterator)
about the results:

        if(m_aGCListeners.getLength() > 0)
        {

        ::cppu::OInterfaceIteratorHelper pIterator( m_aGCListeners );
        while ( pIterator.hasMoreElements( ) )
        {
                        uno::Reference< 
linguistic2::XGrammarCheckingResultListener > xLstnr(
pIterator.next(), uno::UNO_QUERY );
                        xLstnr->GrammarCheckingFinished(paRes);
        }
        }

Then in its listener function
GrammarCheckingIterator::GrammarCheckingFinished the GC Iterator calls
the function commitTextMarkup which will draw the green lines.

Currently I'm wrestling some problem details here though.
For testing you should stick with fixed texts and start the grammar
checking from a macro. Even then if everything was fine you still need
to make the Writer repaint it's window manually.
I'm currently looking how to fix this problem as well as that grammar
checking should be implicitly restarted when modifying text.
Should be done soon..

Thus for the next few days your best expected result will be with a
fixed text in the document and you need to manually trigger the window
repaint.

When I'm done with my fixes and the results got a bit of testing I can
provide you with some patches for improved overall behavior.


Regards,
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to