diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-08 11:05:34 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-08 11:40:15 +0200 |
commit | 704edbf7dc844e52404bf52f9d5dc768cfd024d0 (patch) | |
tree | a5697b9e255707f911a966d67dd1bbd7586b9176 /cui | |
parent | 6bf94344723146d64092b7beba93fe78e7119029 (diff) |
convert DIC_ERR_ constants to scoped enum
Change-Id: I083f1b7f21b18c5067b01c82fa8fec467a3d0c50
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 23 | ||||
-rw-r--r-- | cui/source/options/optdict.cxx | 7 |
2 files changed, 16 insertions, 14 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 38bfb82c4730..1aa1613b286f 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -64,6 +64,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::linguistic2; +using namespace linguistic; // struct SpellDialog_Impl --------------------------------------------- @@ -249,7 +250,7 @@ SpellDialog::~SpellDialog() Reference< XSearchableDictionaryList > xDicList( SvxGetDictionaryList() ); if (xDicList.is()) { - linguistic::SaveDictionaries( xDicList ); + SaveDictionaries( xDicList ); } delete pImpl; @@ -577,11 +578,11 @@ IMPL_LINK_NOARG(SpellDialog, ChangeAllHdl) OUString aOldWord( m_pSentenceED->GetErrorText() ); SvxPrepareAutoCorrect( aOldWord, aString ); Reference<XDictionary> aXDictionary( SvxGetChangeAllList(), UNO_QUERY ); - sal_uInt8 nAdded = linguistic::AddEntryToDic( aXDictionary, + DictionaryError nAdded = AddEntryToDic( aXDictionary, aOldWord, true, aString, eLang ); - if(nAdded == DIC_ERR_NONE) + if(nAdded == DictionaryError::NONE) { SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl( SPELLUNDO_CHANGE_ADD_TO_DICTIONARY, aDialogUndoLink); @@ -626,10 +627,10 @@ IMPL_LINK( SpellDialog, IgnoreAllHdl, Button *, pButton ) else { OUString sErrorText(m_pSentenceED->GetErrorText()); - sal_uInt8 nAdded = linguistic::AddEntryToDic( aXDictionary, + DictionaryError nAdded = AddEntryToDic( aXDictionary, sErrorText, false, OUString(), LANGUAGE_NONE ); - if(nAdded == DIC_ERR_NONE) + if(nAdded == DictionaryError::NONE) { SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl( SPELLUNDO_CHANGE_ADD_TO_DICTIONARY, aDialogUndoLink); @@ -910,16 +911,16 @@ int SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu ) if (xDicList.is()) xDic = xDicList->getDictionaryByName( aDicName ); - sal_Int16 nAddRes = DIC_ERR_UNKNOWN; + DictionaryError nAddRes = DictionaryError::UNKNOWN; if (xDic.is()) { - nAddRes = linguistic::AddEntryToDic( xDic, aNewWord, false, OUString(), LANGUAGE_NONE ); + nAddRes = AddEntryToDic( xDic, aNewWord, false, OUString(), LANGUAGE_NONE ); // save modified user-dictionary if it is persistent uno::Reference< frame::XStorable > xSavDic( xDic, uno::UNO_QUERY ); if (xSavDic.is()) xSavDic->store(); - if (nAddRes == DIC_ERR_NONE) + if (nAddRes == DictionaryError::NONE) { SpellUndoAction_Impl* pAction = new SpellUndoAction_Impl( SPELLUNDO_CHANGE_ADD_TO_DICTIONARY, aDialogUndoLink); @@ -928,10 +929,10 @@ int SpellDialog::AddToDictionaryExecute( sal_uInt16 nItemId, PopupMenu *pMenu ) m_pSentenceED->AddUndoAction( pAction ); } // failed because there is already an entry? - if (DIC_ERR_NONE != nAddRes && xDic->getEntry( aNewWord ).is()) - nAddRes = DIC_ERR_NONE; + if (DictionaryError::NONE != nAddRes && xDic->getEntry( aNewWord ).is()) + nAddRes = DictionaryError::NONE; } - if (DIC_ERR_NONE != nAddRes) + if (DictionaryError::NONE != nAddRes) { SvxDicError( this, nAddRes ); return 0; // don't continue diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index e936a87d98bb..f30171a278d2 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -39,6 +39,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::linguistic2; +using namespace linguistic; // static ---------------------------------------------------------------- @@ -597,7 +598,7 @@ IMPL_LINK(SvxEditDictionaryDialog, NewDelHdl, PushButton*, pBtn) OUString sEntry(aNewWord); OUString aReplaceStr(pReplaceED->GetText()); - sal_Int16 nAddRes = DIC_ERR_UNKNOWN; + DictionaryError nAddRes = DictionaryError::UNKNOWN; sal_Int32 nPos = pAllDictsLB->GetSelectEntryPos(); if ( nPos != LISTBOX_ENTRY_NOTFOUND && !aNewWord.isEmpty()) { @@ -624,10 +625,10 @@ IMPL_LINK(SvxEditDictionaryDialog, NewDelHdl, PushButton*, pBtn) aRplcText, LanguageTag( xDic->getLocale() ).getLanguageType(), false ); } } - if (DIC_ERR_NONE != nAddRes) + if (DictionaryError::NONE != nAddRes) SvxDicError( this, nAddRes ); - if(DIC_ERR_NONE == nAddRes && !sEntry.isEmpty()) + if(DictionaryError::NONE == nAddRes && !sEntry.isEmpty()) { // insert new entry in list-box etc... |