Bug 112373

Summary: cleanup SpellChecker
Product: LibreOffice Reporter: Michael Meeks <michael.meeks>
Component: LinguisticAssignee: abstatic <x.abhishek.flyhigh>
Status: RESOLVED FIXED    
Severity: normal CC: admin, aron.budea, mentoring, telesto, xiscofauli
Priority: medium Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Version: 5.3.3.1 rc   
Hardware: All   
OS: All   
Whiteboard: target:6.1.0
Crash report or crash signature: Regression By:

Description Michael Meeks 2017-09-13 14:26:59 UTC
The SpellChecker class:

lingucomponent/source/spell/sspellimp.hxx / .cxx

has this:

    Hunspell **                        m_aDicts;
    Locale *                           m_aDLocs;
    sal_Int32                          m_nNumDict;

Which looks like a mess to me; we should use std::vector<> for these instead; and nice iterators.

We should prolly use a std::unique_ptr<> as well for the Hunspell objects - but please do add some debug / check that the Hunspell objects are not created and destroyed more frequently than before the re-factor.

Thanks ! =)
Comment 1 Sahil Yadav 2017-12-12 06:32:02 UTC
I would like to take this task up. May I proceed ? Anything that I should keep in mind relating to the last line in the description : "destroyed more frequently than before the re-factor." ?
Comment 2 abstatic 2018-01-17 10:12:59 UTC
I'd like to work on this, if its up for taking?
Comment 3 Michael Meeks 2018-01-17 10:28:22 UTC
Sahil - can you confirm you're not making progress here ? I don't see it assigned to you. If so just assign it to yourself - abstatic & go for it ! =) looking forward to your patch.
Comment 4 Commit Notification 2018-01-20 06:27:30 UTC
abstatic committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4edc58af369244fb734d34fee027237624cca9e6

tdf#112373 Using vector of struct to manage hunspell dicts

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Xisco FaulĂ­ 2018-02-20 03:35:48 UTC Comment hidden (obsolete)
Comment 6 abstatic 2018-02-20 14:06:00 UTC
I think this bug was fixed, with my patch.
Comment 7 Michael Meeks 2018-02-20 15:07:16 UTC
Indeed - thanks abstatic ! =) closing.