diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-01-29 15:36:08 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2010-01-29 15:36:08 +0000 |
commit | 5ff0af86b0eddbbf00e1a5c9f26e27e35707929e (patch) | |
tree | cce17c293e90a51c9210b8e77ce7c19c21f16c43 /scripting | |
parent | c8899cb7ced91b9c12d17057495c6f35ab8424b3 (diff) | |
parent | 7ac3cbc92e93eabfbbbf65b8ac429afc28f84b2e (diff) |
ab71: merge with DEV300_m63
Diffstat (limited to 'scripting')
-rwxr-xr-x | scripting/examples/java/makefile.mk | 2 | ||||
-rwxr-xr-x | scripting/examples/makefile.mk | 4 | ||||
-rwxr-xr-x | scripting/java/makefile.mk | 2 | ||||
-rw-r--r-- | scripting/source/stringresource/stringresource.cxx | 20 | ||||
-rw-r--r-- | scripting/source/stringresource/stringresource.hxx | 3 |
5 files changed, 25 insertions, 6 deletions
diff --git a/scripting/examples/java/makefile.mk b/scripting/examples/java/makefile.mk index c4a4c2a081..b8138c755a 100755 --- a/scripting/examples/java/makefile.mk +++ b/scripting/examples/java/makefile.mk @@ -36,5 +36,7 @@ TARGET=javaexamples .INCLUDE : ant.mk .IF "$(SOLAR_JAVA)"!="" +.IF "$(L10N_framework)"=="" ALLTAR : ANTBUILD .ENDIF +.ENDIF diff --git a/scripting/examples/makefile.mk b/scripting/examples/makefile.mk index 5366059553..f071060f02 100755 --- a/scripting/examples/makefile.mk +++ b/scripting/examples/makefile.mk @@ -34,7 +34,7 @@ TARGET=scriptinginstaller no_common_build_zip=true .INCLUDE : settings.mk - +.IF "$(L10N_framework)"=="" .IF "$(SOLAR_JAVA)"!="" ZIP1FLAGS=-r ZIP1TARGET=ScriptsJava @@ -58,5 +58,5 @@ ZIP5FLAGS=-r ZIP5TARGET=scriptbindinglib ZIP5DIR=$(PRJ)$/workben$/bindings ZIP5LIST=*.xlb Highlight.xdl - +.ENDIF .INCLUDE : target.mk diff --git a/scripting/java/makefile.mk b/scripting/java/makefile.mk index bb87b9da21..9b3255e6be 100755 --- a/scripting/java/makefile.mk +++ b/scripting/java/makefile.mk @@ -35,6 +35,8 @@ TARGET=scriptruntimeforjava .INCLUDE : ant.mk +.IF "$(L10N_framework)"=="" .IF "$(SOLAR_JAVA)"!="" ALLTAR : ANTBUILD .ENDIF +.ENDIF diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 55fbed2ab6..82f63b0fe9 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 2d21c46b75..62756e48aa 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 ); |