summaryrefslogtreecommitdiff
path: root/linguistic/source/dlistimp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'linguistic/source/dlistimp.cxx')
-rw-r--r--linguistic/source/dlistimp.cxx118
1 files changed, 59 insertions, 59 deletions
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 27ad955ca886..98ed47202f55 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -522,46 +522,46 @@ void SAL_CALL
{
osl::MutexGuard aGuard( GetLinguMutex() );
- if (!bDisposing)
- {
- bDisposing = true;
- EventObject aEvtObj( static_cast<XDictionaryList *>(this) );
+ if (bDisposing)
+ return;
+
+ bDisposing = true;
+ EventObject aEvtObj( static_cast<XDictionaryList *>(this) );
- aEvtListeners.disposeAndClear( aEvtObj );
- if (mxDicEvtLstnrHelper.is())
- mxDicEvtLstnrHelper->DisposeAndClear( aEvtObj );
+ aEvtListeners.disposeAndClear( aEvtObj );
+ if (mxDicEvtLstnrHelper.is())
+ mxDicEvtLstnrHelper->DisposeAndClear( aEvtObj );
- //! avoid creation of dictionaries if not already done
- if ( !aDicList.empty() )
+ //! avoid creation of dictionaries if not already done
+ if ( !aDicList.empty() )
+ {
+ DictionaryVec_t& rDicList = GetOrCreateDicList();
+ size_t nCount = rDicList.size();
+ for (size_t i = 0; i < nCount; i++)
{
- DictionaryVec_t& rDicList = GetOrCreateDicList();
- size_t nCount = rDicList.size();
- for (size_t i = 0; i < nCount; i++)
- {
- uno::Reference< XDictionary > xDic( rDicList[i], UNO_QUERY );
+ uno::Reference< XDictionary > xDic( rDicList[i], UNO_QUERY );
- // save (modified) dictionaries
- uno::Reference< frame::XStorable > xStor( xDic , UNO_QUERY );
- if (xStor.is())
+ // save (modified) dictionaries
+ uno::Reference< frame::XStorable > xStor( xDic , UNO_QUERY );
+ if (xStor.is())
+ {
+ try
+ {
+ if (!xStor->isReadonly() && xStor->hasLocation())
+ xStor->store();
+ }
+ catch(Exception &)
{
- try
- {
- if (!xStor->isReadonly() && xStor->hasLocation())
- xStor->store();
- }
- catch(Exception &)
- {
- }
}
-
- // release references to (members of) this object hold by
- // dictionaries
- if (xDic.is())
- xDic->removeDictionaryEventListener( mxDicEvtLstnrHelper.get() );
}
+
+ // release references to (members of) this object hold by
+ // dictionaries
+ if (xDic.is())
+ xDic->removeDictionaryEventListener( mxDicEvtLstnrHelper.get() );
}
- mxDicEvtLstnrHelper.clear();
}
+ mxDicEvtLstnrHelper.clear();
}
void SAL_CALL
@@ -639,25 +639,25 @@ void DicList::SaveDics()
{
// save dics only if they have already been used/created.
//! don't create them just for the purpose of saving them !
- if ( !aDicList.empty() )
+ if ( aDicList.empty() )
+ return;
+
+ // save (modified) dictionaries
+ DictionaryVec_t& rDicList = GetOrCreateDicList();
+ size_t nCount = rDicList.size();
+ for (size_t i = 0; i < nCount; i++)
{
// save (modified) dictionaries
- DictionaryVec_t& rDicList = GetOrCreateDicList();
- size_t nCount = rDicList.size();
- for (size_t i = 0; i < nCount; i++)
+ uno::Reference< frame::XStorable > xStor( rDicList[i], UNO_QUERY );
+ if (xStor.is())
{
- // save (modified) dictionaries
- uno::Reference< frame::XStorable > xStor( rDicList[i], UNO_QUERY );
- if (xStor.is())
+ try
+ {
+ if (!xStor->isReadonly() && xStor->hasLocation())
+ xStor->store();
+ }
+ catch(Exception &)
{
- try
- {
- if (!xStor->isReadonly() && xStor->hasLocation())
- xStor->store();
- }
- catch(Exception &)
- {
- }
}
}
}
@@ -745,21 +745,21 @@ static void AddInternal(
const uno::Reference<XDictionary> &rDic,
const OUString& rNew )
{
- if (rDic.is())
+ if (!rDic.is())
+ return;
+
+ //! TL TODO: word iterator should be used to break up the text
+ OUString aDelim("!\"#$%&'()*+,-/:;<=>?[]\\_^`{|}~\t \n");
+ OSL_ENSURE(aDelim.indexOf(u'.') == -1,
+ "ensure no '.'");
+
+ OUString aToken;
+ sal_Int32 nPos = 0;
+ while (-1 != (nPos = lcl_GetToken( aToken, rNew, nPos, aDelim )))
{
- //! TL TODO: word iterator should be used to break up the text
- OUString aDelim("!\"#$%&'()*+,-/:;<=>?[]\\_^`{|}~\t \n");
- OSL_ENSURE(aDelim.indexOf(u'.') == -1,
- "ensure no '.'");
-
- OUString aToken;
- sal_Int32 nPos = 0;
- while (-1 != (nPos = lcl_GetToken( aToken, rNew, nPos, aDelim )))
+ if( !aToken.isEmpty() && !IsNumeric( aToken ) )
{
- if( !aToken.isEmpty() && !IsNumeric( aToken ) )
- {
- rDic->add( aToken, false, OUString() );
- }
+ rDic->add( aToken, false, OUString() );
}
}
}