diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2017-02-20 10:46:45 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2017-02-20 14:36:01 +0000 |
commit | 2d028dfe846a4dccb8b4572cc51f2b57f0305d61 (patch) | |
tree | de384793b739446098fe55be951e4e906f2e8c1b /lingucomponent | |
parent | 65cfa0eed38ceeb4e96c97b76772bb191129fd83 (diff) |
Prefix members
Change-Id: I342ac49877c928c52eb3001f5a7bab07588636fa
Reviewed-on: https://gerrit.libreoffice.org/34463
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'lingucomponent')
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.cxx | 160 | ||||
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.hxx | 20 |
2 files changed, 90 insertions, 90 deletions
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index bb370e144c93..686f52fe24b0 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -68,47 +68,47 @@ using namespace linguistic; #endif SpellChecker::SpellChecker() : - aDicts(nullptr), - aDEncs(nullptr), - aDLocs(nullptr), - aDNames(nullptr), - numdict(0), - aEvtListeners(GetLinguMutex()), - pPropHelper(nullptr), - bDisposing(false) + m_aDicts(nullptr), + m_aDEncs(nullptr), + m_aDLocs(nullptr), + m_aDNames(nullptr), + m_nNumDict(0), + m_aEvtListeners(GetLinguMutex()), + m_pPropHelper(nullptr), + m_bDisposing(false) { } SpellChecker::~SpellChecker() { - if (aDicts) + if (m_aDicts) { - for (int i = 0; i < numdict; ++i) + for (int i = 0; i < m_nNumDict; ++i) { - delete aDicts[i]; + delete m_aDicts[i]; } - delete[] aDicts; + delete[] m_aDicts; } - delete[] aDEncs; - delete[] aDLocs; - delete[] aDNames; - if (pPropHelper) + delete[] m_aDEncs; + delete[] m_aDLocs; + delete[] m_aDNames; + if (m_pPropHelper) { - pPropHelper->RemoveAsPropListener(); - delete pPropHelper; + m_pPropHelper->RemoveAsPropListener(); + delete m_pPropHelper; } } PropertyHelper_Spelling & SpellChecker::GetPropHelper_Impl() { - if (!pPropHelper) + if (!m_pPropHelper) { Reference< XLinguProperties > xPropSet( GetLinguProperties(), UNO_QUERY ); - pPropHelper = new PropertyHelper_Spelling( static_cast<XSpellChecker *>(this), xPropSet ); - pPropHelper->AddAsPropListener(); //! after a reference is established + m_pPropHelper = new PropertyHelper_Spelling( static_cast<XSpellChecker *>(this), xPropSet ); + m_pPropHelper->AddAsPropListener(); //! after a reference is established } - return *pPropHelper; + return *m_pPropHelper; } Sequence< Locale > SAL_CALL SpellChecker::getLocales() @@ -117,7 +117,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() // this routine should return the locales supported by the installed // dictionaries. - if (!numdict) + if (!m_nNumDict) { SvtLinguConfig aLinguCfg; @@ -181,13 +181,13 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() } } // ... and add them to the resulting sequence - aSuppLocales.realloc( aLocaleNamesSet.size() ); + m_aSuppLocales.realloc( aLocaleNamesSet.size() ); std::set<OUString>::const_iterator aItB; k = 0; for (aItB = aLocaleNamesSet.begin(); aItB != aLocaleNamesSet.end(); ++aItB) { Locale aTmp( LanguageTag::convertToLocale( *aItB )); - aSuppLocales[k++] = aTmp; + m_aSuppLocales[k++] = aTmp; } //! For each dictionary and each locale we need a separate entry. @@ -195,15 +195,15 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() //! it is undefined which dictionary gets used. //! In the future the implementation should support using several dictionaries //! for one locale. - numdict = 0; + m_nNumDict = 0; for (aDictIt = aDics.begin(); aDictIt != aDics.end(); ++aDictIt) - numdict = numdict + aDictIt->aLocaleNames.getLength(); + m_nNumDict = m_nNumDict + aDictIt->aLocaleNames.getLength(); // add dictionary information - aDicts = new Hunspell* [numdict]; - aDEncs = new rtl_TextEncoding [numdict]; - aDLocs = new Locale [numdict]; - aDNames = new OUString [numdict]; + m_aDicts = new Hunspell* [m_nNumDict]; + m_aDEncs = new rtl_TextEncoding [m_nNumDict]; + m_aDLocs = new Locale [m_nNumDict]; + m_aDNames = new OUString [m_nNumDict]; k = 0; for (aDictIt = aDics.begin(); aDictIt != aDics.end(); ++aDictIt) { @@ -218,40 +218,40 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() // Once for each of its supported locales. for (sal_Int32 i = 0; i < nLocales; ++i) { - aDicts[k] = nullptr; - aDEncs[k] = RTL_TEXTENCODING_DONTKNOW; - aDLocs[k] = LanguageTag::convertToLocale( aLocaleNames[i] ); + m_aDicts[k] = nullptr; + m_aDEncs[k] = RTL_TEXTENCODING_DONTKNOW; + m_aDLocs[k] = LanguageTag::convertToLocale( aLocaleNames[i] ); // also both files have to be in the same directory and the // file names must only differ in the extension (.aff/.dic). // Thus we use the first location only and strip the extension part. OUString aLocation = aDictIt->aLocations[0]; sal_Int32 nPos = aLocation.lastIndexOf( '.' ); aLocation = aLocation.copy( 0, nPos ); - aDNames[k] = aLocation; + m_aDNames[k] = aLocation; ++k; } } } - DBG_ASSERT( k == numdict, "index mismatch?" ); + DBG_ASSERT( k == m_nNumDict, "index mismatch?" ); } else { // no dictionary found so register no dictionaries - numdict = 0; - delete[] aDicts; - aDicts = nullptr; - delete[] aDEncs; - aDEncs = nullptr; - delete[] aDLocs; - aDLocs = nullptr; - delete[] aDNames; - aDNames = nullptr; - aSuppLocales.realloc(0); + m_nNumDict = 0; + delete[] m_aDicts; + m_aDicts = nullptr; + delete[] m_aDEncs; + m_aDEncs = nullptr; + delete[] m_aDLocs; + m_aDLocs = nullptr; + delete[] m_aDNames; + m_aDNames = nullptr; + m_aSuppLocales.realloc(0); } } - return aSuppLocales; + return m_aSuppLocales; } sal_Bool SAL_CALL SpellChecker::hasLocale(const Locale& rLocale) @@ -259,11 +259,11 @@ sal_Bool SAL_CALL SpellChecker::hasLocale(const Locale& rLocale) MutexGuard aGuard( GetLinguMutex() ); bool bRes = false; - if (!aSuppLocales.getLength()) + if (!m_aSuppLocales.getLength()) getLocales(); - const Locale *pLocale = aSuppLocales.getConstArray(); - sal_Int32 nLen = aSuppLocales.getLength(); + const Locale *pLocale = m_aSuppLocales.getConstArray(); + sal_Int32 nLen = m_aSuppLocales.getLength(); for (sal_Int32 i = 0; i < nLen; ++i) { if (rLocale == pLocale[i]) @@ -313,17 +313,17 @@ sal_Int16 SpellChecker::GetSpellFailure(const OUString &rWord, const Locale &rLo if (n) { - for (sal_Int32 i = 0; i < numdict; ++i) + for (sal_Int32 i = 0; i < m_nNumDict; ++i) { pMS = nullptr; eEnc = RTL_TEXTENCODING_DONTKNOW; - if (rLocale == aDLocs[i]) + if (rLocale == m_aDLocs[i]) { - if (!aDicts[i]) + if (!m_aDicts[i]) { - OUString dicpath = aDNames[i] + ".dic"; - OUString affpath = aDNames[i] + ".aff"; + OUString dicpath = m_aDNames[i] + ".dic"; + OUString affpath = m_aDNames[i] + ".aff"; OUString dict; OUString aff; osl::FileBase::getSystemPathFromFileURL(dicpath,dict); @@ -341,15 +341,15 @@ sal_Int16 SpellChecker::GetSpellFailure(const OUString &rWord, const Locale &rLo OString aTmpdict(OU2ENC(dict,osl_getThreadTextEncoding())); #endif - aDicts[i] = new Hunspell(aTmpaff.getStr(),aTmpdict.getStr()); + m_aDicts[i] = new Hunspell(aTmpaff.getStr(),aTmpdict.getStr()); #if defined(H_DEPRECATED) - aDEncs[i] = getTextEncodingFromCharset(aDicts[i]->get_dict_encoding().c_str()); + m_aDEncs[i] = getTextEncodingFromCharset(m_aDicts[i]->get_dict_encoding().c_str()); #else - aDEncs[i] = getTextEncodingFromCharset(aDicts[i]->get_dic_encoding()); + m_aDEncs[i] = getTextEncodingFromCharset(m_aDicts[i]->get_dic_encoding()); #endif } - pMS = aDicts[i]; - eEnc = aDEncs[i]; + pMS = m_aDicts[i]; + eEnc = m_aDEncs[i]; } if (pMS) @@ -476,15 +476,15 @@ Reference< XSpellAlternatives > int numsug = 0; Sequence< OUString > aStr( 0 ); - for (int i = 0; i < numdict; i++) + for (int i = 0; i < m_nNumDict; i++) { pMS = nullptr; eEnc = RTL_TEXTENCODING_DONTKNOW; - if (rLocale == aDLocs[i]) + if (rLocale == m_aDLocs[i]) { - pMS = aDicts[i]; - eEnc = aDEncs[i]; + pMS = m_aDicts[i]; + eEnc = m_aDEncs[i]; } if (pMS) @@ -564,7 +564,7 @@ sal_Bool SAL_CALL SpellChecker::addLinguServiceEventListener( MutexGuard aGuard( GetLinguMutex() ); bool bRes = false; - if (!bDisposing && rxLstnr.is()) + if (!m_bDisposing && rxLstnr.is()) { bRes = GetPropHelper().addLinguServiceEventListener( rxLstnr ); } @@ -577,7 +577,7 @@ sal_Bool SAL_CALL SpellChecker::removeLinguServiceEventListener( MutexGuard aGuard( GetLinguMutex() ); bool bRes = false; - if (!bDisposing && rxLstnr.is()) + if (!m_bDisposing && rxLstnr.is()) { bRes = GetPropHelper().removeLinguServiceEventListener( rxLstnr ); } @@ -593,7 +593,7 @@ void SAL_CALL SpellChecker::initialize( const Sequence< Any >& rArguments ) { MutexGuard aGuard( GetLinguMutex() ); - if (!pPropHelper) + if (!m_pPropHelper) { sal_Int32 nLen = rArguments.getLength(); if (2 == nLen) @@ -606,8 +606,8 @@ void SAL_CALL SpellChecker::initialize( const Sequence< Any >& rArguments ) //! And the reference to the UNO-functions while increasing //! the ref-count and will implicitly free the memory //! when the object is not longer used. - pPropHelper = new PropertyHelper_Spelling( static_cast<XSpellChecker *>(this), xPropSet ); - pPropHelper->AddAsPropListener(); //! after a reference is established + m_pPropHelper = new PropertyHelper_Spelling( static_cast<XSpellChecker *>(this), xPropSet ); + m_pPropHelper->AddAsPropListener(); //! after a reference is established } else { OSL_FAIL( "wrong number of arguments in sequence" ); @@ -619,16 +619,16 @@ void SAL_CALL SpellChecker::dispose() { MutexGuard aGuard( GetLinguMutex() ); - if (!bDisposing) + if (!m_bDisposing) { - bDisposing = true; + m_bDisposing = true; EventObject aEvtObj( static_cast<XSpellChecker *>(this) ); - aEvtListeners.disposeAndClear( aEvtObj ); - if (pPropHelper) + m_aEvtListeners.disposeAndClear( aEvtObj ); + if (m_pPropHelper) { - pPropHelper->RemoveAsPropListener(); - delete pPropHelper; - pPropHelper = nullptr; + m_pPropHelper->RemoveAsPropListener(); + delete m_pPropHelper; + m_pPropHelper = nullptr; } } } @@ -637,16 +637,16 @@ void SAL_CALL SpellChecker::addEventListener( const Reference< XEventListener >& { MutexGuard aGuard( GetLinguMutex() ); - if (!bDisposing && rxListener.is()) - aEvtListeners.addInterface( rxListener ); + if (!m_bDisposing && rxListener.is()) + m_aEvtListeners.addInterface( rxListener ); } void SAL_CALL SpellChecker::removeEventListener( const Reference< XEventListener >& rxListener ) { MutexGuard aGuard( GetLinguMutex() ); - if (!bDisposing && rxListener.is()) - aEvtListeners.removeInterface( rxListener ); + if (!m_bDisposing && rxListener.is()) + m_aEvtListeners.removeInterface( rxListener ); } // Service specific part diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.hxx b/lingucomponent/source/spellcheck/spell/sspellimp.hxx index a1320bc6f597..c7e8cbf7a6a6 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.hxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.hxx @@ -54,16 +54,16 @@ class SpellChecker : XServiceDisplayName > { - Sequence< Locale > aSuppLocales; - Hunspell ** aDicts; - rtl_TextEncoding * aDEncs; - Locale * aDLocs; - OUString * aDNames; - sal_Int32 numdict; + Sequence< Locale > m_aSuppLocales; + Hunspell ** m_aDicts; + rtl_TextEncoding * m_aDEncs; + Locale * m_aDLocs; + OUString * m_aDNames; + sal_Int32 m_nNumDict; - ::comphelper::OInterfaceContainerHelper2 aEvtListeners; - linguistic::PropertyHelper_Spelling* pPropHelper; - bool bDisposing; + ::comphelper::OInterfaceContainerHelper2 m_aEvtListeners; + linguistic::PropertyHelper_Spelling* m_pPropHelper; + bool m_bDisposing; SpellChecker(const SpellChecker &) = delete; SpellChecker & operator = (const SpellChecker &) = delete; @@ -71,7 +71,7 @@ class SpellChecker : linguistic::PropertyHelper_Spelling& GetPropHelper_Impl(); linguistic::PropertyHelper_Spelling& GetPropHelper() { - return pPropHelper ? *pPropHelper : GetPropHelper_Impl(); + return m_pPropHelper ? *m_pPropHelper : GetPropHelper_Impl(); } sal_Int16 GetSpellFailure( const OUString &rWord, const Locale &rLocale ); |