diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-09-17 14:29:05 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-09-17 14:29:05 +0000 |
commit | c932a23fb013889e14ce5096966221c22ed8f96a (patch) | |
tree | 7cd1c4ae67b66e507c304dd3ec13c51791f6a02a /scripting | |
parent | ac49eeddaf88a0002901b078ca64a7d6a4068c30 (diff) |
CWS-TOOLING: integrate CWS ab74
2009-09-10 10:13:43 +0200 jsk r276023 : Test Cases for #i103691, #i103697, #i103990
2009-09-03 15:42:36 +0200 ab r275754 : #i103990# Removed warning
2009-09-03 09:02:32 +0200 ab r275744 : CWS-TOOLING: rebase CWS ab74 to trunk@275331 (milestone: DEV300:m56)
2009-09-02 17:14:42 +0200 ab r275724 : #i103697# Applied patch
2009-08-27 15:11:50 +0200 ab r275488 : #i103354# Check Lucene index file to be named _0.cfs, fail otherwise
2009-08-26 08:57:21 +0200 ab r275393 : #i104354# Changed loop variable type to avoid Solaris Intel compiler optimizer bug
2009-08-17 14:17:32 +0200 ab r275053 : #i73263# Adapted breakpoint dialog to longer strings
2009-08-13 17:09:30 +0200 ab r274951 : #i103691# Fix empty comparison behaviour
2009-08-13 13:03:28 +0200 ab r274935 : #i103948# Applied patch
2009-08-13 12:31:15 +0200 ab r274931 : #i103134# Patch: Always set default property
2009-08-13 11:02:50 +0200 ab r274926 : #i103990# Support arrays in user types
2009-07-21 11:16:54 +0200 ab r274171 : #i102816# Make sure LocaleItem is loaded before copying from it
2009-07-20 14:56:35 +0200 ab r274139 : #i102816# Use default language as final fallback in service implementation
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/stringresource/stringresource.cxx | 20 | ||||
-rw-r--r-- | scripting/source/stringresource/stringresource.hxx | 3 |
2 files changed, 19 insertions, 4 deletions
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 4b1a4489a4a4..b011eaccacc8 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -359,8 +359,9 @@ sal_Bool StringResourceImpl::isReadOnly() return m_bReadOnly; } -void StringResourceImpl::setCurrentLocale( const Locale& locale, sal_Bool FindClosestMatch ) - throw (IllegalArgumentException, RuntimeException) +void StringResourceImpl::implSetCurrentLocale( const Locale& locale, + sal_Bool FindClosestMatch, sal_Bool bUseDefaultIfNoMatch ) + throw (IllegalArgumentException, RuntimeException) { ::osl::MutexGuard aGuard( getMutex() ); @@ -370,6 +371,9 @@ void StringResourceImpl::setCurrentLocale( const Locale& locale, sal_Bool FindCl else pLocaleItem = getItemForLocale( locale, true ); + if( pLocaleItem == NULL && bUseDefaultIfNoMatch ) + pLocaleItem = m_pDefaultLocaleItem; + if( pLocaleItem != NULL ) { loadLocale( pLocaleItem ); @@ -380,6 +384,13 @@ void StringResourceImpl::setCurrentLocale( const Locale& locale, sal_Bool FindCl } } +void StringResourceImpl::setCurrentLocale( const Locale& locale, sal_Bool FindClosestMatch ) + throw (IllegalArgumentException, RuntimeException) +{ + sal_Bool bUseDefaultIfNoMatch = false; + implSetCurrentLocale( locale, FindClosestMatch, bUseDefaultIfNoMatch ); +} + void StringResourceImpl::setDefaultLocale( const Locale& locale ) throw (IllegalArgumentException, RuntimeException,NoSupportException) { @@ -500,7 +511,7 @@ void StringResourceImpl::newLocale( const Locale& locale ) LocaleItem* pCopyFromItem = m_pDefaultLocaleItem; if( pCopyFromItem == NULL ) pCopyFromItem = m_pCurrentLocaleItem; - if( pCopyFromItem != NULL ) + if( pCopyFromItem != NULL && loadLocale( pCopyFromItem ) ) { const IdToStringMap& rSourceMap = pCopyFromItem->m_aIdToStringMap; IdToStringMap& rTargetMap = pLocaleItem->m_aIdToStringMap; @@ -863,7 +874,8 @@ void StringResourcePersistenceImpl::implInitializeCommonParameters implScanLocales(); sal_Bool FindClosestMatch = true; - setCurrentLocale( aCurrentLocale, FindClosestMatch ); + sal_Bool bUseDefaultIfNoMatch = true; + implSetCurrentLocale( aCurrentLocale, FindClosestMatch, bUseDefaultIfNoMatch ); } // ----------------------------------------------------------------------------- diff --git a/scripting/source/stringresource/stringresource.hxx b/scripting/source/stringresource/stringresource.hxx index e5e3a7c12a35..71d26f05dec7 100644 --- a/scripting/source/stringresource/stringresource.hxx +++ b/scripting/source/stringresource/stringresource.hxx @@ -169,6 +169,9 @@ protected: // Returns the LocalItem for a given locale, if it exists, otherwise NULL // This method performes a closest match search, at least the language must match LocaleItem* getClosestMatchItemForLocale( const ::com::sun::star::lang::Locale& locale ); + void implSetCurrentLocale( const ::com::sun::star::lang::Locale& locale, + sal_Bool FindClosestMatch, sal_Bool bUseDefaultIfNoMatch ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); void implModified( void ); void implNotifyListeners( void ); |