diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-21 18:56:16 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-21 18:56:16 +0200 |
commit | a233dac0653f3f3054f7ad2da114ed989747e89a (patch) | |
tree | bf1e11438321c06125a94308649c496648061ccb /unotools | |
parent | not link cairocanvas against stl anymore (diff) | |
parent | callcatcher: clean up Dir and DirEntry (diff) | |
download | core-a233dac0653f3f3054f7ad2da114ed989747e89a.tar.gz core-a233dac0653f3f3054f7ad2da114ed989747e89a.zip |
resyncing to master
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/Library_utl.mk | 6 | ||||
-rw-r--r-- | unotools/inc/unotools/localedatawrapper.hxx | 2 | ||||
-rw-r--r-- | unotools/inc/unotools/regoptions.hxx | 6 | ||||
-rw-r--r-- | unotools/inc/unotools/tempfile.hxx | 1 | ||||
-rw-r--r-- | unotools/prj/build.lst | 2 | ||||
-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 | ||||
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 42 | ||||
-rw-r--r-- | unotools/source/ucbhelper/tempfile.cxx | 12 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 68 | ||||
-rw-r--r-- | unotools/source/ucbhelper/xtempfile.cxx | 14 | ||||
-rw-r--r-- | unotools/util/utl.component | 2 |
14 files changed, 122 insertions, 181 deletions
diff --git a/unotools/Library_utl.mk b/unotools/Library_utl.mk index 70647da701ca..75c5ab1f5953 100644 --- a/unotools/Library_utl.mk +++ b/unotools/Library_utl.mk @@ -45,7 +45,6 @@ $(eval $(call gb_Library_set_include,utl,\ $$(INCLUDE) \ -I$(realpath $(SRCDIR)/unotools/inc/pch) \ -I$(OUTDIR)/inc \ - -I$(OUTDIR)/inc/offuh \ )) # add any additional definitions to be set for compilation here @@ -54,6 +53,11 @@ $(eval $(call gb_Library_add_defs,utl,\ -DUNOTOOLS_DLLIMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,utl,\ + offapi \ + udkapi \ +)) + # add libraries to be linked to utl; again these names need to be given as # specified in Repository.mk $(eval $(call gb_Library_add_linked_libs,utl,\ diff --git a/unotools/inc/unotools/localedatawrapper.hxx b/unotools/inc/unotools/localedatawrapper.hxx index 306316683b94..8ff4e46da058 100644 --- a/unotools/inc/unotools/localedatawrapper.hxx +++ b/unotools/inc/unotools/localedatawrapper.hxx @@ -346,7 +346,7 @@ public: /** Append locale info to string, used with locale data checking. A string similar to "de_DE requested\n en_US loaded" is appended. */ - String& appendLocaleInfo( String& rDebugMsg ) const; + rtl::OUString appendLocaleInfo(const rtl::OUString& rDebugMsg) const; /** Ouput a message during locale data checking. The (UTF-8) string is written to stderr and in a non-product build or if DBG_UTIL is enabled diff --git a/unotools/inc/unotools/regoptions.hxx b/unotools/inc/unotools/regoptions.hxx index e43d61f9ba6b..0303ca300e91 100644 --- a/unotools/inc/unotools/regoptions.hxx +++ b/unotools/inc/unotools/regoptions.hxx @@ -111,12 +111,6 @@ namespace utl <p>If this method is called, the reminder for the dialog will be removed. */ void removeReminder(); - - /** checks if the reminder date has come - - <p>Returns <true/> if the current date is greater or equal the reminder date. - */ - bool hasReminderDateCome() const; }; //........................................................................ diff --git a/unotools/inc/unotools/tempfile.hxx b/unotools/inc/unotools/tempfile.hxx index 3565396dd612..2030b1ab0791 100644 --- a/unotools/inc/unotools/tempfile.hxx +++ b/unotools/inc/unotools/tempfile.hxx @@ -154,7 +154,6 @@ public: It is not a URL because alle URLs must be "UCB compatible", so there may be no suitable URL at all. */ static String SetTempNameBaseDirectory( const String &rBaseName ); - static String GetTempNameBaseDirectory(); }; } diff --git a/unotools/prj/build.lst b/unotools/prj/build.lst index b7883fa2e3dd..8e182910f277 100644 --- a/unotools/prj/build.lst +++ b/unotools/prj/build.lst @@ -1,3 +1,3 @@ -ut unotools : LIBXSLT:libxslt comphelper cppuhelper offuh tools ucbhelper NULL +ut unotools : LIBXSLT:libxslt comphelper cppuhelper offapi tools ucbhelper NULL ut unotools\prj nmake - all ut_prj NULL 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; diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index 656453dde274..a8e1dccf0727 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -51,6 +51,7 @@ #include <com/sun/star/i18n/NumberFormatIndex.hdl> #include <rtl/instance.hxx> +#include <rtl/ustrbuf.hxx> #include <sal/macros.h> #define LOCALEDATA_LIBRARYNAME "i18npool" @@ -770,7 +771,7 @@ void LocaleDataWrapper::getCurrSymbolsImpl() { if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getCurrSymbolsImpl: no default currency")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -882,7 +883,7 @@ void LocaleDataWrapper::getCurrFormatsImpl() { // bad luck if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getCurrFormatsImpl: no currency formats")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -931,7 +932,7 @@ void LocaleDataWrapper::getCurrFormatsImpl() scanCurrFormatImpl( pFormatArr[nElem].Code, 0, nSign, nPar, nNum, nBlank, nSym ); if (areChecksEnabled() && (nNum == STRING_NOTFOUND || nSym == STRING_NOTFOUND)) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getCurrFormatsImpl: CurrPositiveFormat?")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -962,7 +963,7 @@ void LocaleDataWrapper::getCurrFormatsImpl() nSym == STRING_NOTFOUND || (nPar == STRING_NOTFOUND && nSign == STRING_NOTFOUND))) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getCurrFormatsImpl: CurrNegativeFormat?")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1098,7 +1099,7 @@ DateFormat LocaleDataWrapper::scanDateFormatImpl( const String& rCode ) { if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::scanDateFormat: not all DMY present")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1121,7 +1122,7 @@ DateFormat LocaleDataWrapper::scanDateFormatImpl( const String& rCode ) { if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::scanDateFormat: no magic applyable")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1140,7 +1141,7 @@ void LocaleDataWrapper::getDateFormatsImpl() { // bad luck if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getDateFormatsImpl: no date formats")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1185,7 +1186,7 @@ void LocaleDataWrapper::getDateFormatsImpl() { if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getDateFormatsImpl: no edit")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1193,7 +1194,7 @@ void LocaleDataWrapper::getDateFormatsImpl() { if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getDateFormatsImpl: no default")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1930,20 +1931,21 @@ String LocaleDataWrapper::getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals, } -String& LocaleDataWrapper::appendLocaleInfo( String& rDebugMsg ) const +rtl::OUString LocaleDataWrapper::appendLocaleInfo(const rtl::OUString& rDebugMsg) const { ::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical ); - rDebugMsg += '\n'; - rDebugMsg += String( aLocale.Language); - rDebugMsg += '_'; - rDebugMsg += String( aLocale.Country); - rDebugMsg.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " requested\n" ) ); + rtl::OUStringBuffer aDebugMsg(rDebugMsg); + aDebugMsg.append(static_cast<sal_Unicode>('\n')); + aDebugMsg.append(aLocale.Language); + aDebugMsg.append(static_cast<sal_Unicode>('_')); + aDebugMsg.append(aLocale.Country); + aDebugMsg.appendAscii(RTL_CONSTASCII_STRINGPARAM(" requested\n")); lang::Locale aLoaded = getLoadedLocale(); - rDebugMsg += String( aLoaded.Language); - rDebugMsg += '_'; - rDebugMsg += String( aLoaded.Country); - rDebugMsg.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " loaded" ) ); - return rDebugMsg; + aDebugMsg.append(aLoaded.Language); + aDebugMsg.append(static_cast<sal_Unicode>('_')); + aDebugMsg.append(aLoaded.Country); + aDebugMsg.appendAscii(RTL_CONSTASCII_STRINGPARAM(" loaded")); + return aDebugMsg.makeStringAndClear(); } diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 99f0b85d68b8..33a3ca6fb8f4 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -484,18 +484,6 @@ String TempFile::SetTempNameBaseDirectory( const String &rBaseName ) return aTmp; } - -String TempFile::GetTempNameBaseDirectory() -{ - const ::rtl::OUString &rTempNameBase_Impl = TempNameBase_Impl::get(); - if ( !rTempNameBase_Impl.getLength() ) - return String(); - - rtl::OUString aTmp; - FileBase::getSystemPathFromFileURL( rTempNameBase_Impl, aTmp ); - return aTmp; -} - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index c95608c3faaf..5393cb972813 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -696,7 +696,7 @@ Moderator::Result Moderator::getResult(const sal_uInt32 milliSec) // reset m_aResultType = NORESULT; } - catch(const salhelper::ConditionWaiter::timedout&) + catch (const salhelper::ConditionWaiter::timedout&) { ret.type = TIMEDOUT; } @@ -849,24 +849,24 @@ void SAL_CALL Moderator::run() aResult = m_aContent.executeCommand(m_aArg.Name,m_aArg.Argument); aResultType = RESULT; } - catch ( CommandAbortedException ) + catch (const CommandAbortedException&) { aResultType = COMMANDABORTED; } - catch ( CommandFailedException ) + catch (const CommandFailedException&) { aResultType = COMMANDFAILED; } - catch ( InteractiveIOException& r ) + catch (const InteractiveIOException& r) { nIOErrorCode = r.Code; aResultType = INTERACTIVEIO; } - catch ( UnsupportedDataSinkException& ) + catch (const UnsupportedDataSinkException ) { aResultType = UNSUPPORTED; } - catch ( Exception ) + catch (const Exception&) { aResultType = GENERAL; } @@ -950,10 +950,13 @@ static sal_Bool UCBOpenContentSync( bool bResultAchieved(false); Moderator* pMod = 0; - try { + try + { pMod = new Moderator(xContent,xInteract,xProgress,rArg); pMod->create(); - } catch(const ContentCreationException&) { + } + catch (const ContentCreationException&) + { bResultAchieved = bException = true; xLockBytes->SetError( ERRCODE_IO_GENERAL ); } @@ -1180,17 +1183,17 @@ static sal_Bool _UCBOpenContentSync( { aResult = aContent.executeCommand( rArg.Name, rArg.Argument ); } - catch ( CommandAbortedException ) + catch (const CommandAbortedException&) { bAborted = true; xLockBytes->SetError( ERRCODE_ABORT ); } - catch ( CommandFailedException ) + catch (const CommandFailedException&) { bAborted = true; xLockBytes->SetError( ERRCODE_ABORT ); } - catch ( InteractiveIOException& r ) + catch (const InteractiveIOException& r) { bException = true; if ( r.Code == IOErrorCode_ACCESS_DENIED || r.Code == IOErrorCode_LOCKING_VIOLATION ) @@ -1202,12 +1205,12 @@ static sal_Bool _UCBOpenContentSync( else xLockBytes->SetError( ERRCODE_IO_GENERAL ); } - catch ( UnsupportedDataSinkException& ) + catch (const UnsupportedDataSinkException&) { bException = true; xLockBytes->SetError( ERRCODE_IO_NOTSUPPORTED ); } - catch ( Exception ) + catch (const Exception&) { bException = true; xLockBytes->SetError( ERRCODE_IO_GENERAL ); @@ -1262,10 +1265,12 @@ UcbLockBytes::~UcbLockBytes() { m_xInputStream->closeInput(); } - catch ( RuntimeException const & ) - {} - catch ( IOException const & ) - {} + catch (const RuntimeException&) + { + } + catch (const IOException&) + { + } } } @@ -1275,10 +1280,12 @@ UcbLockBytes::~UcbLockBytes() { m_xOutputStream->closeOutput(); } - catch ( RuntimeException const & ) - {} - catch ( IOException const & ) - {} + catch (const RuntimeException&) + { + } + catch (const IOException&) + { + } } } @@ -1352,8 +1359,9 @@ sal_Bool UcbLockBytes::setInputStream_Impl( const Reference<XInputStream> &rxInp bRet = m_xInputStream.is(); } - catch( Exception& ) - {} + catch (const Exception&) + { + } if ( m_bStreamValid && m_xInputStream.is() ) m_aInitialized.set(); @@ -1420,11 +1428,11 @@ ErrCode UcbLockBytes::ReadAt ( sal_uLong nPos, void *pBuffer, sal_uLong nCount, { xSeekable->seek( nPos ); } - catch ( IOException ) + catch (const IOException&) { return ERRCODE_IO_CANTSEEK; } - catch (com::sun::star::lang::IllegalArgumentException) + catch (const com::sun::star::lang::IllegalArgumentException&) { return ERRCODE_IO_CANTSEEK; } @@ -1444,7 +1452,7 @@ ErrCode UcbLockBytes::ReadAt ( sal_uLong nPos, void *pBuffer, sal_uLong nCount, nSize = xStream->readBytes( aData, sal_Int32(nCount) ); } - catch (IOException) + catch (const IOException&) { return ERRCODE_IO_CANTREAD; } @@ -1474,7 +1482,7 @@ ErrCode UcbLockBytes::WriteAt ( sal_uLong nPos, const void *pBuffer, sal_uLong n { xSeekable->seek( nPos ); } - catch ( IOException ) + catch (const IOException&) { return ERRCODE_IO_CANTSEEK; } @@ -1487,7 +1495,7 @@ ErrCode UcbLockBytes::WriteAt ( sal_uLong nPos, const void *pBuffer, sal_uLong n if ( pWritten ) *pWritten = nCount; } - catch ( Exception ) + catch (const Exception&) { return ERRCODE_IO_CANTWRITE; } @@ -1506,7 +1514,7 @@ ErrCode UcbLockBytes::Flush() const { xOutputStream->flush(); } - catch( Exception ) + catch (const Exception&) { return ERRCODE_IO_CANTWRITE; } @@ -1577,7 +1585,7 @@ ErrCode UcbLockBytes::Stat( SvLockBytesStat *pStat, SvLockBytesStatFlag) const { pStat->nSize = sal_uLong(xSeekable->getLength()); } - catch (IOException) + catch (const IOException&) { return ERRCODE_IO_CANTTELL; } diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index 7883a3e85cb2..55733702039c 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -37,10 +37,6 @@ namespace css = com::sun::star; -// copy define from desktop\source\app\appinit.cxx - -#define DESKTOP_TEMPNAMEBASE_DIR "/temp/soffice.tmp" - OTempFileService::OTempFileService(::css::uno::Reference< ::css::uno::XComponentContext > const & context) : ::cppu::PropertySetMixin< ::css::io::XTempFile >( context @@ -484,14 +480,6 @@ throw ( ::css::uno::RuntimeException ) return ::cppu::createSingleComponentFactory( XTempFile_createInstance, getImplementationName_Static(), getSupportedServiceNames_Static() ); } -// C functions to implement this as a component - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - /** * This function is called to get service factories for an implementation. * @param pImplName name of implementation @@ -499,7 +487,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron * @param pRegistryKey registry data key to read and write component persistent data * @return a component factory (generic uno interface) */ -extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL utl_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/unotools/util/utl.component b/unotools/util/utl.component index 8c8198741f55..ab4b67b61da4 100644 --- a/unotools/util/utl.component +++ b/unotools/util/utl.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="utl" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.io.comp.TempFile"> <service name="com.sun.star.io.TempFile"/> |