Index: source/app/langselect.cxx =================================================================== RCS file: /cvs/framework/desktop/source/app/langselect.cxx,v retrieving revision 1.14 diff -u -p -r1.14 langselect.cxx --- openoffice.org.orig/desktop/source/app/langselect.cxx 11 Mar 2005 10:47:45 -0000 1.14 +++ openoffice.org/desktop/source/app/langselect.cxx 29 Mar 2005 09:01:28 -0000 @@ -136,7 +136,7 @@ bool LanguageSelection::prepareLanguage( { } // get the selected UI language as string - OUString aLocaleString = getLanguageString(); + OUString aLocaleString = getLanguageString(true); if ( aLocaleString.getLength() > 0 ) { try @@ -178,6 +178,7 @@ bool LanguageSelection::prepareLanguage( OUString usWesternName = OUString::createFromAscii("DefaultLocale"); Reference< XPropertySet > xProp(getConfigAccess( "org.openoffice.Office.Linguistic/General/", sal_True), UNO_QUERY_THROW); + OUString usValue; xProp->getPropertyValue(usWesternName) >>= usValue; if (usValue.getLength() == 0) @@ -224,9 +225,13 @@ void LanguageSelection::setDefaultLocale usName = OUString::createFromAscii("DefaultLocale_CTL"); break; } +#if 0 OUString usValue; xProp->getPropertyValue(usName) >>= usValue; if (usValue.getLength() == 0) +#else + if (1) +#endif { // there is no document language set, for the script type selected // in the UI @@ -245,7 +250,7 @@ void LanguageSelection::setDefaultLocale } } -OUString LanguageSelection::getLanguageString() +OUString LanguageSelection::getLanguageString(bool bAllowUnInstalled) { // did we already find a language? if (bFoundLanguage) @@ -254,7 +259,7 @@ OUString LanguageSelection::getLanguageS OUString aUserLanguage = getUserLanguage(); if (aUserLanguage.getLength() > 0 ) { - if (isInstalledLanguage(aUserLanguage)) + if (bAllowUnInstalled || isInstalledLanguage(aUserLanguage)) { // all is well bFoundLanguage = sal_True; @@ -271,7 +276,7 @@ OUString LanguageSelection::getLanguageS aUserLanguage = getSystemLanguage(); if (aUserLanguage.getLength() > 0 ) { - if (isInstalledLanguage(aUserLanguage, sal_False)) + if (bAllowUnInstalled || isInstalledLanguage(aUserLanguage, sal_False)) { // great, system default language is available bFoundLanguage = sal_True; @@ -281,7 +286,7 @@ OUString LanguageSelection::getLanguageS } // fallback 1: en-US OUString usFB = usFallbackLanguage; - if (isInstalledLanguage(usFB)) + if (bAllowUnInstalled || isInstalledLanguage(usFB)) { bFoundLanguage = sal_True; aFoundLanguage = usFallbackLanguage; Index: source/app/langselect.hxx =================================================================== RCS file: /cvs/framework/desktop/source/app/langselect.hxx,v retrieving revision 1.8 diff -u -p -r1.8 langselect.hxx --- openoffice.org.orig/desktop/source/app/langselect.hxx 11 Mar 2005 10:47:59 -0000 1.8 +++ openoffice.org/desktop/source/app/langselect.hxx 29 Mar 2005 09:01:28 -0000 @@ -96,7 +96,7 @@ private: public: static com::sun::star::lang::Locale IsoStringToLocale(const rtl::OUString& str); - static rtl::OUString getLanguageString(); + static rtl::OUString getLanguageString(bool bAllowUnInstalled=false); static bool prepareLanguage(); }; Index: source/migration/wizard.cxx =================================================================== RCS file: /cvs/framework/desktop/source/migration/wizard.cxx,v retrieving revision 1.3 diff -u -p -r1.3 wizard.cxx --- openoffice.org.orig/desktop/source/migration/wizard.cxx 11 Mar 2005 10:50:09 -0000 1.3 +++ openoffice.org/desktop/source/migration/wizard.cxx 29 Mar 2005 09:01:44 -0000 @@ -590,25 +590,8 @@ OUString FirstStartWizard::getLicensePat // yuck! no license :/ } - // determine the filename of the license to show - OUString aLangString; - ::com::sun::star::lang::Locale aLocale; - OString aMgrName = OString("dkt") + OString::valueOf((sal_Int32)SUPD, 10); - AllSettings aSettings(Application::GetSettings()); - aLocale = aSettings.GetUILocale(); - ResMgr* pResMgr = ResMgr::SearchCreateResMgr(aMgrName, aLocale); + OUString aLangString(OUString::createFromAscii("en-US")); - aLangString = aLocale.Language; - if ( aLocale.Country.getLength() != 0 ) - { - aLangString += OUString::createFromAscii("-"); - aLangString += aLocale.Country; - if ( aLocale.Variant.getLength() != 0 ) - { - aLangString += OUString::createFromAscii("-"); - aLangString += aLocale.Variant; - } - } #ifdef WNT aLicensePath = aBaseInstallPath + OUString::createFromAscii(szLicensePath) Index: source/appl/sfxhelp.cxx =================================================================== RCS file: /cvs/framework/sfx2/source/appl/sfxhelp.cxx,v retrieving revision 1.66 diff -u -r1.68 sfxhelp.cxx --- openoffice.org.orig/sfx2/source/appl/sfxhelp.cxx 7 Feb 2006 10:29:33 -0000 1.68 +++ openoffice.org/sfx2/source/appl/sfxhelp.cxx 28 Mar 2006 13:12:14 -0000 @@ -99,6 +99,9 @@ #ifndef _URLOBJ_HXX #include #endif +#ifndef _ISOLANG_HXX +#include +#endif #ifndef _UTL_CONFIGMGR_HXX_ #include #endif @@ -109,6 +112,11 @@ #include #include #include +#include +#ifndef _UTL_BOOTSTRAP_HXX +#include +#endif + #include #include #include @@ -165,16 +173,53 @@ #define STARTERLIST 0 +rtl::OUString HelpLocaleString() +{ + static rtl::OUString aLocaleStr; + if (!aLocaleStr.getLength()) + { + // detect installed locale + Any aLocale = + ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( + ::utl::ConfigManager::LOCALE ); + bool bOk = (aLocale >>= aLocaleStr); + if ( bOk ) + { + rtl::OUString aBaseInstallPath; + utl::Bootstrap::PathStatus aBaseLocateResult = + utl::Bootstrap::locateBaseInstallation(aBaseInstallPath); + static const char *szHelpPath = "/help/"; + + rtl::OUString sHelpPath = aBaseInstallPath + + rtl::OUString::createFromAscii(szHelpPath) + aLocaleStr; + osl::DirectoryItem aDirItem; + + if (!osl::DirectoryItem::get(sHelpPath, aDirItem) == osl::FileBase::E_None) + { + bOk = false; + String sLang(aLocaleStr); + xub_StrLen nSepPos = sLang.Search( '-' ); + if (nSepPos != STRING_NOTFOUND) + { + bOk = true; + sLang = sLang.Copy( 0, nSepPos ); + sHelpPath = aBaseInstallPath + + rtl::OUString::createFromAscii(szHelpPath) + sLang; + if (!osl::DirectoryItem::get(sHelpPath, aDirItem) == osl::FileBase::E_None) + bOk = false; + } + } + } + if (!bOk) + aLocaleStr = rtl::OUString( DEFINE_CONST_UNICODE("en") ); + } + return aLocaleStr; +} + + void AppendConfigToken_Impl( String& rURL, sal_Bool bQuestionMark ) { - // this completes a help url with the system parameters "Language" and "System" - // detect installed locale - Any aLocale = - ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( ::utl::ConfigManager::LOCALE ); - ::rtl::OUString aLocaleStr; - if ( !( aLocale >>= aLocaleStr ) ) - // fallback is english - aLocaleStr = ::rtl::OUString( DEFINE_CONST_UNICODE("en") ); + ::rtl::OUString aLocaleStr(HelpLocaleString()); // query part exists? if ( bQuestionMark ) @@ -189,6 +234,7 @@ rURL += String( aLocaleStr ); rURL += DEFINE_CONST_UNICODE("&System="); rURL += SvtHelpOptions().GetSystem(); + } // ----------------------------------------------------------------------- @@ -426,11 +472,8 @@ pImp = new SfxHelp_Impl( bIsDebug ); - Any aLocale = - ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( ::utl::ConfigManager::LOCALE ); - ::rtl::OUString aLocaleStr; - if ( !( aLocale >>= aLocaleStr ) ) - aLocaleStr = ::rtl::OUString( DEFINE_CONST_UNICODE("en") ); + ::rtl::OUString aLocaleStr = HelpLocaleString(); + sal_Int32 nSepPos = aLocaleStr.indexOf( '_' ); if ( nSepPos != -1 ) { Index: source/services/substitutepathvars.cxx =================================================================== RCS file: /cvs/framework/framework/source/services/substitutepathvars.cxx,v retrieving revision 1.10 diff -u -p -r1.10 substitutepathvars.cxx --- openoffice.org.orig/framework/source/services/substitutepathvars.cxx 13 Jan 2005 19:14:36 -0000 1.10 +++ openoffice.org/framework/source/services/substitutepathvars.cxx 29 Jun 2005 10:45:59 -0000 @@ -151,6 +151,14 @@ #include #endif +#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ +#include +#endif + +#ifndef _COMPHELPER_PROCESSFACTORY_HXX_ +#include +#endif + //_________________________________________________________________________________________________________________ // Defines //_________________________________________________________________________________________________________________ @@ -1215,6 +1223,88 @@ throw ( NoSuchElementException, RuntimeE return rtl::OUString(); } +using rtl::OUString; +using rtl::OString; + +Reference< XNameAccess > getConfigAccess(const sal_Char* pPath, sal_Bool bUpdate) +{ + Reference< XNameAccess > xNameAccess; + try{ + OUString sConfigSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"); + OUString sAccessSrvc; + if (bUpdate) + sAccessSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"); + else + sAccessSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"); + + OUString sConfigURL = OUString::createFromAscii(pPath); + + // get configuration provider + Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory(); + if (theMSF.is()) { + Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory > ( + theMSF->createInstance( sConfigSrvc ),UNO_QUERY_THROW ); + + // access the provider + Sequence< Any > theArgs(1); + theArgs[ 0 ] <<= sConfigURL; + xNameAccess = Reference< XNameAccess > ( + theConfigProvider->createInstanceWithArguments( + sAccessSrvc, theArgs ), UNO_QUERY_THROW ); + } + } catch (com::sun::star::uno::Exception& e) + { + OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); + OSL_ENSURE(sal_False, aMsg.getStr()); + } + return xNameAccess; +} + +void getInstallMapping(OUString& usLocale) +{ + Sequence< OUString > seqLanguages; + Reference< XNameAccess > xAccess = + getConfigAccess( + "org.openoffice.Setup/Office/InstalledLocales", sal_False); + if (xAccess.is()) + seqLanguages = xAccess->getElementNames(); + + for (sal_Int32 i=0; iGetDirectConfigProperty( utl::ConfigManager::LOCALE ); rtl::OUString aLocaleStr; if ( aLocale >>= aLocaleStr ) + { + getInstallMapping(aLocaleStr); aPreDefPathVariables.m_eLanguageType = ConvertIsoStringToLanguage( aLocaleStr ); + } else { LOG_ERROR( "SubstitutePathVariables::SetPredefinedPathVariables", "Wrong Any type for language!" ); Index: util/makefile.mk =================================================================== RCS file: /cvs/framework/framework/util/makefile.mk,v retrieving revision 1.96 diff -u -p -r1.96 makefile.mk --- openoffice.org.orig/framework/util/makefile.mk 22 Apr 2005 11:36:59 -0000 1.96 +++ openoffice.org/framework/util/makefile.mk 29 Jun 2005 10:45:59 -0000 @@ -212,6 +212,7 @@ SHL3STDLIBS= \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(VOSLIB) \ + $(COMPHELPERLIB) \ $(SALLIB) SHL3DEF= $(MISC)$/$(SHL3TARGET).def Index: source/ui/misc/glosdoc.cxx =================================================================== RCS file: /cvs/sw/sw/source/ui/misc/glosdoc.cxx,v retrieving revision 1.19 diff -u -p -r1.19 glosdoc.cxx --- openoffice.org.orig/sw/source/ui/misc/glosdoc.cxx 11 Jan 2005 12:42:19 -0000 1.19 +++ openoffice.org/sw/source/ui/misc/glosdoc.cxx 29 Jun 2005 11:02:03 -0000 @@ -577,19 +577,7 @@ void SwGlossaries::UpdateGlosPath(sal_Bo } aDirArr.DeleteAndDestroy(0, aDirArr.Count()); - if(!nTokenCount || - sErrPath.Len() && (bPathChanged || sOldErrPath != sErrPath) ) - { - sOldErrPath = sErrPath; - // Falscher Pfad, d.h. AutoText-Verzeichnis existiert nicht - - ErrorHandler::HandleError( *new StringErrorInfo( - ERR_AUTOPATH_ERROR, sErrPath, - ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR )); - bError = sal_True; - } - else - bError = sal_False; + bError = sal_False; if(pGlosArr) { Index: registry/schema/org/openoffice/Office/Common.xcs =================================================================== RCS file: /cvs/util/officecfg/registry/schema/org/openoffice/Office/Common.xcs,v retrieving revision 1.107 diff -u -p -u -r1.107 Common.xcs --- openoffice.org.orig/officecfg/registry/schema/org/openoffice/Office/Common.xcs 2 Feb 2005 16:41:38 -0000 1.107 +++ openoffice.org/officecfg/registry/schema/org/openoffice/Office/Common.xcs 29 Jun 2005 11:08:26 -0000 @@ -1288,7 +1288,7 @@ Dymamic border coloring means that when OS Contains the directory which contains the AutoText modules. - $(insturl)/share/autotext/$(vlang):$(userurl)/autotext + $(insturl)/share/autotext/$(vlang):$(insturl)/share/autotext/en-US:$(userurl)/autotext @@ -1408,7 +1408,7 @@ Dymamic border coloring means that when MBA Specifies the templates originate from these folders and sub-folders. - $(insturl)/share/template/$(vlang):$(userurl)/template + $(insturl)/share/template/$(vlang):$(insturl)/share/template/en-US:$(userurl)/template @@ -1460,7 +1460,7 @@ Dymamic border coloring means that when Specifies the default directory where the AutoText modules are located. - $(insturl)/share/autotext/$(vlang):$(userurl)/autotext + $(insturl)/share/autotext/$(vlang):$(insturl)/share/autotext/en-US:$(userurl)/autotext @@ -1556,7 +1556,7 @@ Dymamic border coloring means that when Specifies the default directory where all provided templates are located in folders and sub-folders. - $(insturl)/share/template/$(vlang):$(userurl)/template + $(insturl)/share/template/$(vlang):$(insturl)/share/template/en-US:$(userurl)/template Index: com/sun/star/wizards/letter/LetterWizardDialogImpl.java =================================================================== RCS file: /cvs/installation/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java,v retrieving revision 1.10 diff -u -p -u -r1.10 LetterWizardDialogImpl.java --- openoffice.org.orig/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java 20 May 2005 15:42:29 -0000 1.10 +++ openoffice.org/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java 13 Jul 2005 11:22:44 -0000 @@ -754,18 +754,38 @@ public class LetterWizardDialogImpl exte } } - private int getOfficeLinguistic() { + private int getOfficeLinguistic() { + boolean bMatch = false; int oL = 0; String OfficeLinguistic = Configuration.getOfficeLinguistic(xMSF); + if ( + OfficeLinguistic.equalsIgnoreCase("en-IE") || + OfficeLinguistic.equalsIgnoreCase("en-CA") || + OfficeLinguistic.equalsIgnoreCase("en-NZ") || + OfficeLinguistic.equalsIgnoreCase("en-AU") + ) + { + OfficeLinguistic = "en-GB"; + } for (int i = 0; i < Norms.length; i++){ if (Norms[i].equalsIgnoreCase(OfficeLinguistic)) { + bMatch = true; oL = i; } } + if (!bMatch) { + String[] portions = OfficeLinguistic.split("-"); + OfficeLinguistic = portions[0]; + for (int i = 0; i < Norms.length; i++){ + if (Norms[i].equalsIgnoreCase(OfficeLinguistic)) { + oL = i; + } + } + } return oL; } - private void setPossibleSenderData(boolean bState) { + private void setPossibleSenderData(boolean bState) { setControlProperty("optSenderDefine", "Enabled", new Boolean(bState)); setControlProperty("optSenderPlaceholder", "Enabled", new Boolean(bState)); setControlProperty("lblSenderAddress", "Enabled", new Boolean(bState)); Index: com/sun/star/wizards/letter/LetterWizardDialogResources.java =================================================================== RCS file: /cvs/installation/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.java,v retrieving revision 1.5 diff -u -p -u -r1.5 LetterWizardDialogResources.java --- openoffice.org.orig/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.java 3 May 2005 14:23:44 -0000 1.5 +++ openoffice.org/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.java 13 Jul 2005 11:22:44 -0000 @@ -14,10 +14,10 @@ public class LetterWizardDialogResources final static int RID_LETTERWIZARDLANGUAGE_START = 3110; final static int RID_RID_COMMON_START = 500; - protected String[] RoadmapLabels = new String[7]; - protected String[] SalutationLabels = new String[3]; - protected String[] GreetingLabels = new String[3]; - protected String[] LanguageLabels = new String[16]; + protected String[] RoadmapLabels = new String[7]; + protected String[] SalutationLabels = new String[3]; + protected String[] GreetingLabels = new String[3]; + protected String[] LanguageLabels = new String[18]; String resOverwriteWarning; String resTemplateDescription; Index: source/formwizard/dbwizres.src =================================================================== RCS file: /cvs/installation/wizards/source/formwizard/dbwizres.src,v retrieving revision 1.68 diff -u -p -u -r1.68 dbwizres.src --- openoffice.org.orig/wizards/source/formwizard/dbwizres.src 3 May 2005 14:24:05 -0000 1.68 +++ openoffice.org/wizards/source/formwizard/dbwizres.src 13 Jul 2005 11:23:24 -0000 @@ -2515,6 +2515,17 @@ String RID_LETTERWIZARDLANGUAGE_START + Text [ en-US] = "Croatian"; }; +String RID_LETTERWIZARDLANGUAGE_START + 17 +{ + Text [ de ] = "International English"; + Text [ en-US] = "International English"; +}; + +String RID_LETTERWIZARDLANGUAGE_START + 18 +{ + Text [ de ] = "Slovak"; + Text [ en-US] = "Slovak"; +}; // ============================================================================ // ============================ ====================== Index: source/treeview/tvread.cxx =================================================================== RCS file: /cvs/util/xmlhelp/source/treeview/tvread.cxx,v retrieving revision 1.16 diff -u -p -u -r1.16 tvread.cxx --- openoffice.org.orig/xmlhelp/source/treeview/tvread.cxx 23 Mar 2005 13:04:52 -0000 1.16 +++ openoffice.org/xmlhelp/source/treeview/tvread.cxx 24 Oct 2005 11:15:48 -0000 @@ -701,7 +701,11 @@ ConfigData TVChildTarget::init( const Re osl::FileBase::E_None == osl::DirectoryItem::get( url + locale.copy( 0,idx ), aDirItem ) ) ret = locale.copy( 0,idx ); - + else + { + locale = rtl::OUString::createFromAscii( "en-US" ); + ret = rtl::OUString::createFromAscii("en"); + } url = url + ret; // first of all, try do determine whether there are any *.tree files present Index: optgdlg.cxx =================================================================== RCS file: /cvs/graphics/svx/source/dialog/optgdlg.cxx,v retrieving revision 1.28 diff -u -r1.28 optgdlg.cxx --- openoffice.org.orig/svx/source/dialog/optgdlg.cxx 5 Jan 2006 17:58:40 -0000 1.28 +++ openoffice.org/svx/source/dialog/optgdlg.cxx 1 Feb 2006 11:04:37 -0000 @@ -1183,8 +1183,6 @@ /* -----------------------------23.11.00 13:06-------------------------------- ---------------------------------------------------------------------------*/ -static sal_Bool bLanguageCurrentDoc_Impl = sal_False; - // some things we'll need... static const OUString sConfigSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"); static const OUString sAccessSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"); @@ -1545,70 +1543,27 @@ BOOL bRet = FALSE; SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current(); Reference< XPropertySet > xLinguProp( LinguMgr::GetLinguPropertySet(), UNO_QUERY ); - BOOL bCurrentDocCBChecked = aCurrentDocCB.IsChecked(); - if(aCurrentDocCB.IsEnabled()) - bLanguageCurrentDoc_Impl = bCurrentDocCBChecked; - BOOL bCurrentDocCBChanged = bCurrentDocCBChecked != aCurrentDocCB.GetSavedValue(); - BOOL bValChanged = aWesternLanguageLB.GetSavedValue() != aWesternLanguageLB.GetSelectEntryPos(); - if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged) + BOOL bValChanged = pCurrentDocShell && (aWesternLanguageLB.GetSavedValue() != aWesternLanguageLB.GetSelectEntryPos()); + if(bValChanged) { LanguageType eSelectLang = aWesternLanguageLB.GetSelectLanguage(); - if(!bCurrentDocCBChecked) - { - Any aValue; - Locale aLocale = SvxCreateLocale( eSelectLang ); - aValue <<= aLocale; - OUString aPropName( C2U("DefaultLocale") ); - pLangConfig->aLinguConfig.SetProperty( aPropName, aValue ); - if (xLinguProp.is()) - xLinguProp->setPropertyValue( aPropName, aValue ); - } - if(pCurrentDocShell) - { - rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_LANGUAGE)); - bRet = TRUE; - } + rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_LANGUAGE)); + bRet = TRUE; } bValChanged = aAsianLanguageLB.GetSavedValue() != aAsianLanguageLB.GetSelectEntryPos(); - if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged) + if(bValChanged) { LanguageType eSelectLang = aAsianLanguageLB.GetSelectLanguage(); - if(!bCurrentDocCBChecked) - { - Any aValue; - Locale aLocale = SvxCreateLocale( eSelectLang ); - aValue <<= aLocale; - OUString aPropName( C2U("DefaultLocale_CJK") ); - pLangConfig->aLinguConfig.SetProperty( aPropName, aValue ); - if (xLinguProp.is()) - xLinguProp->setPropertyValue( aPropName, aValue ); - } - if(pCurrentDocShell) - { - rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CJK_LANGUAGE)); - bRet = TRUE; - } + rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CJK_LANGUAGE)); + bRet = TRUE; } bValChanged = aComplexLanguageLB.GetSavedValue() != aComplexLanguageLB.GetSelectEntryPos(); - if( (bCurrentDocCBChanged && !bCurrentDocCBChecked) || bValChanged) + if(bValChanged) { LanguageType eSelectLang = aComplexLanguageLB.GetSelectLanguage(); - if(!bCurrentDocCBChecked) - { - Any aValue; - Locale aLocale = SvxCreateLocale( eSelectLang ); - aValue <<= aLocale; - OUString aPropName( C2U("DefaultLocale_CTL") ); - pLangConfig->aLinguConfig.SetProperty( aPropName, aValue ); - if (xLinguProp.is()) - xLinguProp->setPropertyValue( aPropName, aValue ); - } - if(pCurrentDocShell) - { - rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CTL_LANGUAGE)); - bRet = TRUE; - } + rSet.Put(SvxLanguageItem(eSelectLang, SID_ATTR_CHAR_CTL_LANGUAGE)); + bRet = TRUE; } if(aAsianSupportCB.GetSavedValue() != aAsianSupportCB.IsChecked() ) @@ -1650,51 +1605,32 @@ return FALSE; } -//----------------------------------------------------------------------------- -void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet ) -{ - OUString sLang = pLangConfig->aSysLocaleOptions.GetLocaleConfigString(); - if ( sLang.getLength() ) - aLocaleSettingLB.SelectLanguage(lcl_LangStringToLangType(sLang)); - else - aLocaleSettingLB.SelectLanguage( LANGUAGE_SYSTEM ); - sal_Bool bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_LOCALE); - aLocaleSettingLB.Enable(!bReadonly); - aLocaleSettingFT.Enable(!bReadonly); - aLocaleSettingFI.Show(bReadonly); - // - aDecimalSeparatorCB.Check( pLangConfig->aSysLocaleOptions.IsDecimalSeparatorAsLocale()); - aDecimalSeparatorCB.SaveValue(); +void OfaLanguagesTabPage::LangToUI(LanguageType eCurLang, LanguageType eCurLangCJK, LanguageType eCurLangCTL) +{ + if(LANGUAGE_NONE == eCurLang || LANGUAGE_DONTKNOW == eCurLang) + aWesternLanguageLB.SelectLanguage(LANGUAGE_NONE); + else + aWesternLanguageLB.SelectLanguage(eCurLang); - // let LocaleSettingHdl enable/disable checkboxes for CJK/CTL support - // #i15812# must be done *before* the configured currency is set - // and update the decimal separator used for the given locale - LocaleSettingHdl(&aLocaleSettingLB); + if(LANGUAGE_NONE == eCurLangCJK || LANGUAGE_DONTKNOW == eCurLangCJK) + aAsianLanguageLB.SelectLanguage(LANGUAGE_NONE); + else + aAsianLanguageLB.SelectLanguage(eCurLangCJK); - // configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default - String aAbbrev; - LanguageType eLang; - const NfCurrencyEntry* pCurr = NULL; - sLang = pLangConfig->aSysLocaleOptions.GetCurrencyConfigString(); - if ( sLang.getLength() ) - { - SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage( aAbbrev, eLang, sLang ); - pCurr = SvNumberFormatter::GetCurrencyEntry( aAbbrev, eLang ); - } - // if pCurr==NULL the SYSTEM entry is selected - USHORT nPos = aCurrencyLB.GetEntryPos( (void*) pCurr ); - aCurrencyLB.SelectEntryPos( nPos ); - bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_CURRENCY); - aCurrencyLB.Enable(!bReadonly); - aCurrencyFT.Enable(!bReadonly); - aCurrencyFI.Show(bReadonly); + if(LANGUAGE_NONE == eCurLangCTL || LANGUAGE_DONTKNOW == eCurLangCTL) + aComplexLanguageLB.SelectLanguage(LANGUAGE_NONE); + else + aComplexLanguageLB.SelectLanguage(eCurLangCTL); +} - //western/CJK/CLK language - LanguageType eCurLang = LANGUAGE_NONE; - LanguageType eCurLangCJK = LANGUAGE_NONE; - LanguageType eCurLangCTL = LANGUAGE_NONE; - SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current(); +void OfaLanguagesTabPage::ResetLang( const SfxItemSet& rSet ) +{ + //western/CJK/CLK language + LanguageType eCurLang = LANGUAGE_NONE; + LanguageType eCurLangCJK = LANGUAGE_NONE; + LanguageType eCurLangCTL = LANGUAGE_NONE; + SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current(); //collect the configuration values first aCurrentDocCB.Enable(FALSE); // @@ -1717,45 +1653,89 @@ catch(Exception&) { } + + LangToUI(eCurLang, eCurLangCJK, eCurLangCTL); + + aWesternLanguageLB.SaveValue(); + aAsianLanguageLB.SaveValue(); + aComplexLanguageLB.SaveValue(); + //overwrite them by the values provided by the DocShell if(pCurrentDocShell) { - aCurrentDocCB.Enable(TRUE); - aCurrentDocCB.Check(bLanguageCurrentDoc_Impl); + Link aLink( LINK( this, OfaLanguagesTabPage, RegisterModify ) ); + aCurrentDocCB.SetClickHdl( aLink ); + sal_Bool bLanguageCurrentDoc_Impl=sal_False; const SfxPoolItem* pLang; if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_LANGUAGE, FALSE, &pLang)) + { eCurLang = ((const SvxLanguageItem*)pLang)->GetValue(); + bLanguageCurrentDoc_Impl = true; + } if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CJK_LANGUAGE, FALSE, &pLang)) + { eCurLangCJK = ((const SvxLanguageItem*)pLang)->GetValue(); + bLanguageCurrentDoc_Impl = true; + } if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_CHAR_CTL_LANGUAGE, FALSE, &pLang)) + { eCurLangCTL = ((const SvxLanguageItem*)pLang)->GetValue(); + bLanguageCurrentDoc_Impl = true; + } + aCurrentDocCB.Check(bLanguageCurrentDoc_Impl); + aCurrentDocCB.Enable(!bLanguageCurrentDoc_Impl); } - if(LANGUAGE_NONE == eCurLang || LANGUAGE_DONTKNOW == eCurLang) - aWesternLanguageLB.SelectLanguage(LANGUAGE_NONE); - else - aWesternLanguageLB.SelectLanguage(eCurLang); - - if(LANGUAGE_NONE == eCurLangCJK || LANGUAGE_DONTKNOW == eCurLangCJK) - aAsianLanguageLB.SelectLanguage(LANGUAGE_NONE); - else - aAsianLanguageLB.SelectLanguage(eCurLangCJK); - if(LANGUAGE_NONE == eCurLangCTL || LANGUAGE_DONTKNOW == eCurLangCTL) - aComplexLanguageLB.SelectLanguage(LANGUAGE_NONE); - else - aComplexLanguageLB.SelectLanguage(eCurLangCTL); + LangToUI(eCurLang, eCurLangCJK, eCurLangCTL); - aWesternLanguageLB.SaveValue(); - aAsianLanguageLB.SaveValue(); - aComplexLanguageLB.SaveValue(); aCurrentDocCB.SaveValue(); +} - sal_Bool bEnable = !pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale") ); - aWesternLanguageFT.Enable( bEnable ); - aWesternLanguageLB.Enable( bEnable ); - aWesternLanguageFI.Show(!bEnable); +//----------------------------------------------------------------------------- +void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet ) +{ + OUString sLang = pLangConfig->aSysLocaleOptions.GetLocaleConfigString(); + if ( sLang.getLength() ) + aLocaleSettingLB.SelectLanguage(lcl_LangStringToLangType(sLang)); + else + aLocaleSettingLB.SelectLanguage( LANGUAGE_SYSTEM ); + sal_Bool bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_LOCALE); + aLocaleSettingLB.Enable(!bReadonly); + aLocaleSettingFT.Enable(!bReadonly); + aLocaleSettingFI.Show(bReadonly); + + // + aDecimalSeparatorCB.Check( pLangConfig->aSysLocaleOptions.IsDecimalSeparatorAsLocale()); + aDecimalSeparatorCB.SaveValue(); + + // let LocaleSettingHdl enable/disable checkboxes for CJK/CTL support + // #i15812# must be done *before* the configured currency is set + // and update the decimal separator used for the given locale + LocaleSettingHdl(&aLocaleSettingLB); + + // configured currency, for example, USD-en-US or EUR-de-DE, or empty for locale default + String aAbbrev; + LanguageType eLang; + const NfCurrencyEntry* pCurr = NULL; + sLang = pLangConfig->aSysLocaleOptions.GetCurrencyConfigString(); + if ( sLang.getLength() ) + { + SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage( aAbbrev, eLang, sLang ); + pCurr = SvNumberFormatter::GetCurrencyEntry( aAbbrev, eLang ); + } + // if pCurr==NULL the SYSTEM entry is selected + USHORT nPos = aCurrencyLB.GetEntryPos( (void*) pCurr ); + aCurrencyLB.SelectEntryPos( nPos ); + bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_CURRENCY); + aCurrencyLB.Enable(!bReadonly); + aCurrencyFT.Enable(!bReadonly); + aCurrencyFI.Show(bReadonly); + + ResetLang( rSet ); + + RegisterModify( &aCurrentDocCB ); // #i15812# controls for CJK/CTL already enabled/disabled from LocaleSettingHdl #if 0 @@ -1771,6 +1751,26 @@ /* -----------------------------20.04.01 15:09-------------------------------- ---------------------------------------------------------------------------*/ +IMPL_LINK( OfaLanguagesTabPage, RegisterModify, CheckBox*, pBox ) +{ + sal_Bool bCheck = pBox->IsChecked(); + + sal_Bool bEnable = sal_False; + if (bCheck) + bEnable = !pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale") ); + else + ResetLang( GetItemSet() ); + + aWesternLanguageFT.Enable( bEnable ); + aWesternLanguageLB.Enable( bEnable ); + aWesternLanguageFI.Show(!bEnable); + + SupportHdl( &aCTLSupportCB ); + SupportHdl( &aAsianSupportCB ); + + return 0; +} + IMPL_LINK( OfaLanguagesTabPage, SupportHdl, CheckBox*, pBox ) { DBG_ASSERT( pBox, "OfaLanguagesTabPage::SupportHdl(): pBox invalid" ); @@ -1778,23 +1778,23 @@ sal_Bool bCheck = pBox->IsChecked(); if ( &aAsianSupportCB == pBox ) { - sal_Bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CJK")); + sal_Bool bReadonly = !aCurrentDocCB.IsChecked(); + if (!bReadonly) + bReadonly = pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CJK")); bCheck = ( bCheck && !bReadonly ); aAsianLanguageFT.Enable( bCheck ); aAsianLanguageLB.Enable( bCheck ); aAsianLanguageFI.Show(bReadonly); - if( pBox->IsEnabled() ) - m_bOldAsian = bCheck; } else if ( &aCTLSupportCB == pBox ) { - sal_Bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CTL")); + sal_Bool bReadonly = !aCurrentDocCB.IsChecked(); + if (!bReadonly) + bReadonly = pLangConfig->aLinguConfig.IsReadOnly( C2U("DefaultLocale_CTL")); bCheck = ( bCheck && !bReadonly ); aComplexLanguageFT.Enable( bCheck ); aComplexLanguageLB.Enable( bCheck ); aComplexLanguageFI.Show(bReadonly); - if( pBox->IsEnabled() ) - m_bOldCtl = bCheck; } else { Index: optgdlg.hxx =================================================================== RCS file: /cvs/graphics/svx/source/dialog/optgdlg.hxx,v retrieving revision 1.16 diff -u -r1.16 optgdlg.hxx --- openoffice.org.orig/svx/source/dialog/optgdlg.hxx 5 Jan 2006 17:59:05 -0000 1.16 +++ openoffice.org/svx/source/dialog/optgdlg.hxx 1 Feb 2006 11:04:41 -0000 @@ -212,6 +212,10 @@ DECL_LINK( SupportHdl, CheckBox* ) ; DECL_LINK( LocaleSettingHdl, SvxLanguageBox* ) ; + DECL_LINK( RegisterModify, CheckBox* ); + + void ResetLang( const SfxItemSet& rSet ); + void LangToUI(LanguageType eCurLang, LanguageType eCurLangCJK, LanguageType eCurLangCTL); public: OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSet ); Index: source/rc/resmgr.cxx =================================================================== RCS file: /cvs/util/tools/source/rc/resmgr.cxx,v retrieving revision 1.37 diff -u -p -r1.37 resmgr.cxx --- openoffice.org.orig/tools/source/rc/resmgr.cxx 18 Mar 2005 17:45:56 -0000 1.37 +++ openoffice.org/tools/source/rc/resmgr.cxx 29 Mar 2005 14:56:58 -0000 @@ -372,6 +372,21 @@ void ResMgrContainer::init() #endif } +namespace +{ + bool IsAmericanEnglish(const com::sun::star::lang::Locale &rLocale) + { + if ( + rLocale.Language.equalsIgnoreAsciiCaseAscii("en") && + rLocale.Country.equalsIgnoreAsciiCaseAscii("US") + ) + { + return true; + } + return false; + } +} + InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix, com::sun::star::lang::Locale& rLocale, bool bForceNewInstance @@ -414,7 +429,7 @@ InternalResMgr* ResMgrContainer::getResM } break; } - if( nTries == 0 && !aLocale.Language.equalsIgnoreAsciiCaseAscii( "en" ) ) + if( nTries == 0 && !IsAmericanEnglish(aLocale) ) { // locale fallback failed // fallback to en-US locale @@ -503,7 +518,7 @@ InternalResMgr* ResMgrContainer::getNext aLocale.Variant = OUString(); else if( aLocale.Country.getLength() ) aLocale.Country = OUString(); - else if( ! aLocale.Language.equalsIgnoreAsciiCaseAscii( "en" ) ) + else if( !IsAmericanEnglish(aLocale) ) { aLocale.Language = OUString( RTL_CONSTASCII_USTRINGPARAM( "en" ) ); aLocale.Country = OUString( RTL_CONSTASCII_USTRINGPARAM( "US" ) ); Index: bin/modules/installer/scriptitems.pm =================================================================== RCS file: /cvs/tools/solenv/bin/modules/installer/scriptitems.pm,v retrieving revision 1.17 diff -u -p -r1.17 scriptitems.pm --- openoffice.org.orig/solenv/bin/modules/installer/scriptitems.pm 24 Feb 2005 16:21:15 -0000 1.17 +++ openoffice.org/solenv/bin/modules/installer/scriptitems.pm 18 Mar 2005 22:39:42 -0000 @@ -930,8 +930,7 @@ sub remove_Files_Without_Sourcedirectory $infoline = "ERROR: Removing file $filename from file list.\n"; push( @installer::globals::logfileinfo, $infoline); - push(@missingfiles, "ERROR: File not found: $filename\n"); - $error_occured = 1; + push(@missingfiles, "Warning: File not found: $filename\n"); next; # removing this file from list, if sourcepath is empty }