Comment 20 for bug 998778

Revision history for this message
In , Daniel Naber (misc2006) wrote :

For reference, here's the comment from unolingu.cxx I was talking about above:

        // for the time being (developer builds until OOo 3.0)
        // we should always check for everything available
        // otherwise we may miss a new installed extension dicitonary
        // just because e.g. the spellchecker is not asked what
        // languages it does support currently...
        // Since the check is on-demand occuring and executed once it should
        // not be too troublesome.
        // In OOo 3.0 we will not need the respective code anymore at all.
// aAny <<= nCurrentDataFilesChangedCheckValue;
        aAny <<= (sal_Int32) -1; // keep the value set to 'need to check'

Further testing unfortunately reveals that it applies to current builds, too (despite saying "builds until OOo 3.0"). So if you use "aAny <<= nCurrentDataFilesChangedCheckValue", newly installed dictionary extentions will not be recognized until you restart LO. By "not recognized" I mean that the checkmarks do not appear on the language in the language drop down.

Another potential solution for the original problem might be in lngsvcmgr.cxx, LngSvcMgr::getAvailableServices(). It says:

        // don't used cached data here (force re-evaluation in order to have downloaded dictionaries
        // already found without the need to restart the office
        delete pAvailGrammarSvcs; pAvailGrammarSvcs = 0;

Commenting out that line makes SvxLinguConfigUpdate::UpdateAll() quite fast so the original problem is gone. Grammar checkers need a restart of LO anyway, so I think the cache could be used here.

Trying to debug this issue, I also found you can solve it by just commenting out (*pLayIter)->GetCurrShell()->LayoutIdle(); in doclay.cxx in the if (pTmpRoot->IsNeedGrammarCheck()) block. That code was committed on 2010-06-13. As I'm just debugging and I don't know much about LO internals I have no idea what the side effects of removing that code might be, but everything worked fine for me at a first glance.