diff options
Diffstat (limited to 'unotools/source/config')
-rw-r--r-- | unotools/source/config/configmgr.cxx | 56 | ||||
-rw-r--r-- | unotools/source/config/fontcfg.cxx | 40 | ||||
-rw-r--r-- | unotools/source/config/regoptions.cxx | 51 | ||||
-rw-r--r-- | unotools/source/config/saveopt.cxx | 1 |
4 files changed, 53 insertions, 95 deletions
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx index 2ddc11340bc7..4f83a861b416 100644 --- a/unotools/source/config/configmgr.cxx +++ b/unotools/source/config/configmgr.cxx @@ -156,21 +156,23 @@ Reference< XMultiServiceFactory > ConfigManager::GetConfigurationProvider() UNO_QUERY); } #if OSL_DEBUG_LEVEL > 1 - catch(Exception& rEx) - { - static sal_Bool bMessage = sal_True; - if(bMessage) - { - bMessage = sal_False; - OString sMsg("CreateInstance with arguments exception: "); - sMsg += OString(rEx.Message.getStr(), - rEx.Message.getLength(), - RTL_TEXTENCODING_ASCII_US); - OSL_FAIL(sMsg.getStr()); - } - } + catch (const Exception& rEx) + { + static sal_Bool bMessage = sal_True; + if(bMessage) + { + bMessage = sal_False; + OString sMsg("CreateInstance with arguments exception: "); + sMsg += OString(rEx.Message.getStr(), + rEx.Message.getLength(), + RTL_TEXTENCODING_ASCII_US); + OSL_FAIL(sMsg.getStr()); + } + } #else - catch(Exception&){} + catch (const Exception&) + { + } #endif } } @@ -282,7 +284,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem& OUString::createFromAscii(pAccessSrvc), aArgs); } - catch(Exception& rEx) + catch (const Exception& rEx) { if (CONFIG_MODE_PROPAGATE_ERRORS & rCfgItem.GetMode()) { @@ -489,7 +491,9 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) aArgs); } - catch(Exception&){} + catch (const Exception&) + { + } Reference<XNameAccess> xDirectAccess(xIFace, UNO_QUERY); if(xDirectAccess.is()) { @@ -514,7 +518,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) { aRet = xDirectAccess->getByName(sProperty); } - catch(Exception&) + catch (const Exception&) { #if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aBuf(256); @@ -619,7 +623,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt aArgs); } #if OSL_DEBUG_LEVEL > 1 - catch(Exception& rEx) + catch (const Exception& rEx) { OString sMsg("CreateInstance exception: "); sMsg += OString(rEx.Message.getStr(), @@ -628,7 +632,9 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt OSL_FAIL(sMsg.getStr()); } #else - catch(Exception&){} + catch (const Exception&) + { + } #endif } return Reference<XHierarchicalNameAccess>(xIFace, UNO_QUERY); @@ -650,7 +656,7 @@ Any ConfigManager::GetLocalProperty(const OUString& rProperty) aRet = xAccess->getByName(sProperty); } #if OSL_DEBUG_LEVEL > 1 - catch(Exception& rEx) + catch (const Exception& rEx) { OString sMsg("GetLocalProperty: "); sMsg += OString(rEx.Message.getStr(), @@ -659,7 +665,9 @@ Any ConfigManager::GetLocalProperty(const OUString& rProperty) OSL_FAIL(sMsg.getStr()); } #else - catch(Exception&){} + catch (const Exception&) + { + } #endif return aRet; } @@ -680,7 +688,7 @@ void ConfigManager::PutLocalProperty(const OUString& rProperty, const Any& rValu xNodeReplace->replaceByName(sProperty, rValue); } #if OSL_DEBUG_LEVEL > 1 - catch(Exception& rEx) + catch (const Exception& rEx) { OString sMsg("PutLocalProperty: "); sMsg += OString(rEx.Message.getStr(), @@ -689,7 +697,9 @@ void ConfigManager::PutLocalProperty(const OUString& rProperty, const Any& rValu OSL_FAIL(sMsg.getStr()); } #else - catch(Exception& ){} + catch (const Exception&) + { + } #endif } } diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index 46d92d121a66..c97f6fd505a0 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -165,7 +165,7 @@ DefaultFontConfiguration::DefaultFontConfiguration() } } } - catch( Exception& ) + catch (const Exception&) { // configuration is awry m_xConfigProvider.clear(); @@ -173,7 +173,7 @@ DefaultFontConfiguration::DefaultFontConfiguration() } } } - catch( WrappedTargetException& ) + catch (const WrappedTargetException&) { } #if OSL_DEBUG_LEVEL > 1 @@ -214,10 +214,10 @@ OUString DefaultFontConfiguration::tryLocale( const Locale& rLocale, const OUStr it->second.xAccess = xNode; } } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } } @@ -231,10 +231,10 @@ OUString DefaultFontConfiguration::tryLocale( const Locale& rLocale, const OUStr aAny >>= aRet; } } - catch( NoSuchElementException& ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException& ) + catch (const WrappedTargetException&) { } } @@ -451,7 +451,7 @@ FontSubstConfiguration::FontSubstConfiguration() : } } } - catch( Exception& ) + catch (const Exception&) { // configuration is awry m_xConfigProvider.clear(); @@ -459,7 +459,7 @@ FontSubstConfiguration::FontSubstConfiguration() : } } } - catch( WrappedTargetException& ) + catch (const WrappedTargetException&) { } #if OSL_DEBUG_LEVEL > 1 @@ -994,10 +994,10 @@ void FontSubstConfiguration::fillSubstVector( const com::sun::star::uno::Referen } } } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } } @@ -1025,10 +1025,10 @@ FontWeight FontSubstConfiguration::getSubstWeight( const com::sun::star::uno::Re #endif } } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } return (FontWeight)( weight >= 0 ? pWeightNames[weight].nEnum : WEIGHT_DONTKNOW ); @@ -1057,10 +1057,10 @@ FontWidth FontSubstConfiguration::getSubstWidth( const com::sun::star::uno::Refe #endif } } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } return (FontWidth)( width >= 0 ? pWidthNames[width].nEnum : WIDTH_DONTKNOW ); @@ -1092,10 +1092,10 @@ unsigned long FontSubstConfiguration::getSubstType( const com::sun::star::uno::R } } } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } @@ -1117,10 +1117,10 @@ void FontSubstConfiguration::readLocaleSubst( const com::sun::star::lang::Locale Any aAny = m_xConfigAccess->getByName( it->second.aConfigLocaleString ); aAny >>= xNode; } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } if( xNode.is() ) @@ -1147,10 +1147,10 @@ void FontSubstConfiguration::readLocaleSubst( const com::sun::star::lang::Locale Any aAny = xNode->getByName( pFontNames[i] ); aAny >>= xFont; } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } if( ! xFont.is() ) diff --git a/unotools/source/config/regoptions.cxx b/unotools/source/config/regoptions.cxx index 9b0550a8cdc5..6207c5544429 100644 --- a/unotools/source/config/regoptions.cxx +++ b/unotools/source/config/regoptions.cxx @@ -189,7 +189,6 @@ namespace utl void markSessionDone( ); void activateReminder( sal_Int32 _nDaysFromNow ); void removeReminder(); - bool hasReminderDateCome() const; }; //-------------------------------------------------------------------- @@ -383,48 +382,6 @@ namespace utl } //-------------------------------------------------------------------- - bool RegOptionsImpl::hasReminderDateCome() const - { - bool bRet = false; - sal_Int32 nDate = 0; - ::rtl::OUString sDate; - m_aRegistrationNode.getNodeValue( lcl_getReminderDateName() ) >>= sDate; - if ( sDate.getLength() ) - { - if ( sDate.indexOf( lcl_getPatchName() ) == 0) - { - if (sDate.equals( lcl_getPatchName() )) - bRet = true; - else if (sDate.getLength() > lcl_getPatchName().getLength() ) - { - // Check the build ID to determine if the registration - // dialog needs to be shown. - sal_Int32 nBuildId = getBuildId(); - ::rtl::OUString aStoredBuildId( sDate.copy(lcl_getPatchName().getLength())); - - // remind if the current build ID is not the same as the stored one - if ( nBuildId != aStoredBuildId.toInt32() ) - bRet = true; - } - } - else - { - nDate = lcl_convertString2Date( sDate ); - if ( nDate > 0 ) - { - Date aReminderDate; - aReminderDate.SetDate( nDate ); - bRet = aReminderDate <= Date(); - } - } - } - else - bRet = true; - - return bRet; - } - - //-------------------------------------------------------------------- void RegOptionsImpl::markSessionDone( ) { OSL_ENSURE( !s_bThisSessionDone, "RegOptionsImpl::markSessionDone: already marked!" ); @@ -533,14 +490,6 @@ namespace utl const_cast< RegOptions* >( this )->ensureImpl( ); m_pImpl->removeReminder(); } - - //-------------------------------------------------------------------- - bool RegOptions::hasReminderDateCome() const - { - const_cast< RegOptions* >( this )->ensureImpl( ); - return m_pImpl->hasReminderDateCome(); - } - //........................................................................ } // namespace utl //........................................................................ diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx index 83aea5d7cc9f..28614e00975c 100644 --- a/unotools/source/config/saveopt.cxx +++ b/unotools/source/config/saveopt.cxx @@ -469,7 +469,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl() { for ( int nProp = 0; nProp < aNames.getLength(); nProp++ ) { - DBG_ASSERT( pValues[nProp].hasValue(), "property value missing" ); if ( pValues[nProp].hasValue() ) { sal_Int32 nTemp = 0; |