diff options
author | Mathias Bauer <mba@openoffice.org> | 2011-02-24 17:08:10 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-16 12:14:15 +0200 |
commit | 451314f2947376e9717a30e2e2a06633f6afb3b0 (patch) | |
tree | 2a86ed78b61fa6c8aff183cce2f8631917186e26 /lingucomponent | |
parent | 8d0058914ea6f4ef7f8c70f3eaf5b50e585fc214 (diff) |
CWS gnumake4: convert linguistic to new build system
Diffstat (limited to 'lingucomponent')
6 files changed, 29 insertions, 41 deletions
diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx index 219e3758064e..6230272fdd14 100755 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx @@ -114,17 +114,17 @@ Hyphenator::~Hyphenator() if (aDicts) delete[] aDicts; aDicts = NULL; numdict = 0; + delete pPropHelper; } -PropertyHelper_Hyphen & Hyphenator::GetPropHelper_Impl() +PropertyHelper_Hyphenation& Hyphenator::GetPropHelper_Impl() { if (!pPropHelper) { Reference< XPropertySet > xPropSet( GetLinguProperties(), UNO_QUERY ); - pPropHelper = new PropertyHelper_Hyphen ((XHyphenator *) this, xPropSet ); - xPropHelper = pPropHelper; + pPropHelper = new PropertyHelper_Hyphenation ((XHyphenator *) this, xPropSet ); pPropHelper->AddAsPropListener(); //! after a reference is established } return *pPropHelper; @@ -293,7 +293,7 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const ::rtl::OUStri char *lcword; int k = 0; - PropertyHelper_Hyphen & rHelper = GetPropHelper(); + PropertyHelper_Hyphenation& rHelper = GetPropHelper(); rHelper.SetTmpPropVals(aProperties); sal_Int16 minTrail = rHelper.GetMinTrailing(); sal_Int16 minLead = rHelper.GetMinLeading(); @@ -506,13 +506,13 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const ::rtl::OUStri sal_Int16 nPos = (sal_Int16) ((nHyphenationPosAltHyph < nHyphenationPos) ? nHyphenationPosAltHyph : nHyphenationPos); // dicretionary hyphenation - xRes = new HyphenatedWord( aWord, LocaleToLanguage( aLocale ), nPos, + xRes = HyphenatedWord::CreateHyphenatedWord( aWord, LocaleToLanguage( aLocale ), nPos, aWord.replaceAt(nHyphenationPosAlt + 1, cut[nHyphenationPos], repHyph), (sal_Int16) nHyphenationPosAltHyph); } else { - xRes = new HyphenatedWord( aWord, LocaleToLanguage( aLocale ), + xRes = HyphenatedWord::CreateHyphenatedWord( aWord, LocaleToLanguage( aLocale ), (sal_Int16)nHyphenationPos, aWord, (sal_Int16) nHyphenationPos); } } @@ -558,7 +558,7 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const char *lcword; int k; - PropertyHelper_Hyphen & rHelper = GetPropHelper(); + PropertyHelper_Hyphenation& rHelper = GetPropHelper(); rHelper.SetTmpPropVals(aProperties); sal_Int16 minTrail = rHelper.GetMinTrailing(); sal_Int16 minLead = rHelper.GetMinLeading(); @@ -715,7 +715,7 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const //fprintf(stderr,"result is %s\n",OU2A(hyphenatedWord)); //fflush(stderr); - xRes = new PossibleHyphens( aWord, LocaleToLanguage( aLocale ), + xRes = PossibleHyphens::CreatePossibleHyphens( aWord, LocaleToLanguage( aLocale ), hyphenatedWord, aHyphPos ); delete[] hyphens; @@ -826,7 +826,6 @@ sal_Bool SAL_CALL Hyphenator::removeLinguServiceEventListener( sal_Bool bRes = sal_False; if (!bDisposing && rxLstnr.is()) { - DBG_ASSERT( xPropHelper.is(), "xPropHelper non existent" ); bRes = GetPropHelper().removeLinguServiceEventListener( rxLstnr ); } return bRes; @@ -859,8 +858,7 @@ void SAL_CALL Hyphenator::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_Hyphen( (XHyphenator *) this, xPropSet ); - xPropHelper = pPropHelper; + pPropHelper = new PropertyHelper_Hyphenation( (XHyphenator *) this, xPropSet ); pPropHelper->AddAsPropListener(); //! after a reference is established } else diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx index 6e350146ed9f..eebb67ed67f4 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.hxx @@ -87,17 +87,16 @@ class Hyphenator : sal_Int32 numdict; ::cppu::OInterfaceContainerHelper aEvtListeners; - Reference< XPropertyChangeListener > xPropHelper; Reference< XMultiServiceFactory > rSMgr; - linguistic::PropertyHelper_Hyphen * pPropHelper; + linguistic::PropertyHelper_Hyphenation* pPropHelper; sal_Bool bDisposing; // disallow copy-constructor and assignment-operator for now Hyphenator(const Hyphenator &); Hyphenator & operator = (const Hyphenator &); - linguistic::PropertyHelper_Hyphen & GetPropHelper_Impl(); - linguistic::PropertyHelper_Hyphen & GetPropHelper() + linguistic::PropertyHelper_Hyphenation& GetPropHelper_Impl(); + linguistic::PropertyHelper_Hyphenation& GetPropHelper() { return pPropHelper ? *pPropHelper : GetPropHelper_Impl(); } diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index bd608ffda972..80645f4126df 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -106,17 +106,17 @@ SpellChecker::~SpellChecker() aDNames = NULL; if (pPropHelper) pPropHelper->RemoveAsPropListener(); + delete pPropHelper; } -PropertyHelper_Spell & SpellChecker::GetPropHelper_Impl() +PropertyHelper_Spelling & SpellChecker::GetPropHelper_Impl() { if (!pPropHelper) { Reference< XPropertySet > xPropSet( GetLinguProperties(), UNO_QUERY ); - pPropHelper = new PropertyHelper_Spell( (XSpellChecker *) this, xPropSet ); - xPropHelper = pPropHelper; + pPropHelper = new PropertyHelper_Spelling( (XSpellChecker *) this, xPropSet ); pPropHelper->AddAsPropListener(); //! after a reference is established } return *pPropHelper; @@ -386,7 +386,7 @@ sal_Bool SAL_CALL SpellChecker::isValid( const OUString& rWord, const Locale& rL // You'll probably like to use a simplier solution than the provided // one using the PropertyHelper_Spell. - PropertyHelper_Spell &rHelper = GetPropHelper(); + PropertyHelper_Spelling& rHelper = GetPropHelper(); rHelper.SetTmpPropVals( rProperties ); sal_Int16 nFailure = GetSpellFailure( rWord, rLocale ); @@ -475,12 +475,8 @@ Reference< XSpellAlternatives > } // now return an empty alternative for no suggestions or the list of alternatives if some found - SpellAlternatives *pAlt = new SpellAlternatives; String aTmp(rWord); - pAlt->SetWordLanguage( aTmp, nLang ); - pAlt->SetFailureType( SpellFailure::SPELLING_ERROR ); - pAlt->SetAlternatives( aStr ); - xRes = pAlt; + xRes = SpellAlternatives::CreateSpellAlternatives( aTmp, nLang, SpellFailure::SPELLING_ERROR, aStr ); return xRes; } return xRes; @@ -547,7 +543,6 @@ sal_Bool SAL_CALL SpellChecker::removeLinguServiceEventListener( sal_Bool bRes = sal_False; if (!bDisposing && rxLstnr.is()) { - DBG_ASSERT( xPropHelper.is(), "xPropHelper non existent" ); bRes = GetPropHelper().removeLinguServiceEventListener( rxLstnr ); } return bRes; @@ -580,8 +575,7 @@ 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_Spell( (XSpellChecker *) this, xPropSet ); - xPropHelper = pPropHelper; + pPropHelper = new PropertyHelper_Spelling( (XSpellChecker *) this, xPropSet ); pPropHelper->AddAsPropListener(); //! after a reference is established } else diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.hxx b/lingucomponent/source/spellcheck/spell/sspellimp.hxx index 8a42d98f0f60..f471e551b396 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.hxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.hxx @@ -76,16 +76,15 @@ class SpellChecker : sal_Int32 numdict; ::cppu::OInterfaceContainerHelper aEvtListeners; - Reference< XPropertyChangeListener > xPropHelper; - linguistic::PropertyHelper_Spell * pPropHelper; + linguistic::PropertyHelper_Spelling* pPropHelper; sal_Bool bDisposing; // disallow copy-constructor and assignment-operator for now SpellChecker(const SpellChecker &); SpellChecker & operator = (const SpellChecker &); - linguistic::PropertyHelper_Spell & GetPropHelper_Impl(); - linguistic::PropertyHelper_Spell & GetPropHelper() + linguistic::PropertyHelper_Spelling& GetPropHelper_Impl(); + linguistic::PropertyHelper_Spelling& GetPropHelper() { return pPropHelper ? *pPropHelper : GetPropHelper_Impl(); } diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx index efbe43359474..33918ef20bec 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -137,17 +137,17 @@ Thesaurus::~Thesaurus() if (pPropHelper) pPropHelper->RemoveAsPropListener(); + delete pPropHelper; } -PropertyHelper_Thes & Thesaurus::GetPropHelper_Impl() +PropertyHelper_Thesaurus& Thesaurus::GetPropHelper_Impl() { if (!pPropHelper) { Reference< XPropertySet > xPropSet( GetLinguProperties(), UNO_QUERY ); - pPropHelper = new PropertyHelper_Thes( (XThesaurus *) this, xPropSet ); - xPropHelper = pPropHelper; + pPropHelper = new PropertyHelper_Thesaurus( (XThesaurus *) this, xPropSet ); pPropHelper->AddAsPropListener(); //! after a reference is established } return *pPropHelper; @@ -342,7 +342,7 @@ Sequence < Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL Thes mentry * pmean = NULL; sal_Int32 nmean = 0; - PropertyHelper_Thes &rHelper = GetPropHelper(); + PropertyHelper_Thesaurus &rHelper = GetPropHelper(); rHelper.SetTmpPropVals( rProperties ); MyThes * pTH = NULL; @@ -601,8 +601,7 @@ void SAL_CALL Thesaurus::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_Thes( (XThesaurus *) this, xPropSet ); - xPropHelper = pPropHelper; + pPropHelper = new PropertyHelper_Thesaurus( (XThesaurus *) this, xPropSet ); pPropHelper->AddAsPropListener(); //! after a reference is established } else diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.hxx b/lingucomponent/source/thesaurus/libnth/nthesimp.hxx index b0595ad4286c..b6cfb534bab5 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.hxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.hxx @@ -85,8 +85,7 @@ class Thesaurus : Sequence< Locale > aSuppLocales; ::cppu::OInterfaceContainerHelper aEvtListeners; - Reference< XPropertyChangeListener > xPropHelper; - linguistic::PropertyHelper_Thes * pPropHelper; + linguistic::PropertyHelper_Thesaurus* pPropHelper; sal_Bool bDisposing; CharClass ** aCharSetInfo; MyThes ** aThes; @@ -104,8 +103,8 @@ class Thesaurus : Thesaurus(const Thesaurus &); Thesaurus & operator = (const Thesaurus &); - linguistic::PropertyHelper_Thes & GetPropHelper_Impl(); - linguistic::PropertyHelper_Thes & GetPropHelper() + linguistic::PropertyHelper_Thesaurus& GetPropHelper_Impl(); + linguistic::PropertyHelper_Thesaurus& GetPropHelper() { return pPropHelper ? *pPropHelper : GetPropHelper_Impl(); } |