diff options
author | Eike Rathke <erack@redhat.com> | 2012-11-19 15:49:09 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-11-19 15:52:52 +0100 |
commit | 8ac150eb163b4ce200068313db26121a8b808d46 (patch) | |
tree | 325ef4441610197f3a8ba4cec128ee35b1db8411 /sw | |
parent | ce1d0822d0a0fdb4ed3f2583cc1f63ef98381097 (diff) |
use LanguageTag
Change-Id: I4ffa1aa2dce0bf1d0c87d56f72589112ec1222a1
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/findattr.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/EnhancedPDFExportHelper.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/basflt/fltini.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/css1atr.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlcss1.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/svxcss1.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/app/appopt.cxx | 7 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbmgr.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/lingu/olmenu.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh1.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxdoc.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/vba/vbastyle.cxx | 6 |
17 files changed, 39 insertions, 37 deletions
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 9490c410d6fb..451c2a57cfdc 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/util/SearchFlags.hpp> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <hintids.hxx> #include <vcl/svapp.hxx> #include <svl/itemiter.hxx> @@ -1107,7 +1107,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, aTmp.searchFlag |= (SearchFlags::REG_NOT_BEGINOFLINE | SearchFlags::REG_NOT_ENDOFLINE); - MsLangId::convertLanguageToLocale( LANGUAGE_SYSTEM, aTmp.Locale ); + aTmp.Locale = LanguageTag( LANGUAGE_SYSTEM ).getLocale(); pSTxt = new utl::TextSearch( aTmp ); } diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 324eb742977b..6f3186cdfd73 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -77,7 +77,7 @@ #include <porfld.hxx> #include <SwStyleNameMapper.hxx> #include <itrpaint.hxx> -#include "i18npool/mslangid.hxx" +#include "i18npool/languagetag.hxx" #include <IMark.hxx> #include <SwNodeNum.hxx> #include <switerator.hxx> @@ -1580,7 +1580,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() // // set the document locale // - com::sun::star::lang::Locale aDocLocale = MsLangId::convertLanguageToLocale( SwEnhancedPDFExportHelper::GetDefaultLanguage() ); + com::sun::star::lang::Locale aDocLocale( LanguageTag( SwEnhancedPDFExportHelper::GetDefaultLanguage() ).getLocale() ); pPDFExtOutDevData->SetDocumentLocale( aDocLocale ); // diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 7c2fa60f4632..cee3d0c40359 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -30,7 +30,7 @@ #include <stdio.h> // sscanf #include <hintids.hxx> #include <i18npool/lang.h> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <vcl/msgbox.hxx> #include <svtools/parhtml.hxx> #include <sot/storage.hxx> @@ -784,7 +784,7 @@ void SwAsciiOptions::ReadUserData( const String& rStr ) sFont = sToken; break; case 3: // Language - nLanguage = MsLangId::convertIsoStringToLanguage( sToken ); + nLanguage = LanguageTag( sToken ).getLanguageType(); break; } } @@ -820,7 +820,7 @@ void SwAsciiOptions::WriteUserData( String& rStr ) // 4. Language if (nLanguage) { - rtl::OUString sTmp = MsLangId::convertLanguageToIsoString( nLanguage ); + rtl::OUString sTmp = LanguageTag( nLanguage ).getBcp47(); rStr += (String)sTmp; } rStr += ','; diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index fd3f51151a57..e973a647c461 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -63,7 +63,7 @@ #include <tools/urlobj.hxx> #include <tools/bigint.hxx> #include <unotools/charclass.hxx> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <charfmt.hxx> #include <fmtcol.hxx> #include <fmtfsize.hxx> @@ -2797,7 +2797,7 @@ static Writer& OutCSS1_SvxLanguage( Writer& rWrt, const SfxPoolItem& rHt ) if( LANGUAGE_DONTKNOW == eLang ) return rWrt; - String sOut = MsLangId::convertLanguageToIsoString( eLang ); + String sOut = LanguageTag( eLang ).getBcp47(); rHTMLWrt.OutCSS1_Property( sCSS1_P_so_language, sOut ); diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index 9ff6576a85a1..df4d50f13d8e 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -30,7 +30,7 @@ #include <svl/itemiter.hxx> #include <svl/whiter.hxx> #include <svl/urihelper.hxx> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <sfx2/docfile.hxx> #include <vcl/svapp.hxx> #include <editeng/fhgtitem.hxx> @@ -1952,7 +1952,7 @@ sal_Bool SwHTMLParser::ParseStyleOptions( const String &rStyle, if( pLang && pLang->Len() ) { - LanguageType eLang = MsLangId::convertIsoStringToLanguage( *pLang ); + LanguageType eLang = LanguageTag( *pLang ).getLanguageType(); if( LANGUAGE_DONTKNOW != eLang ) { SvxLanguageItem aLang( eLang, RES_CHRATR_LANGUAGE ); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index c6d8554005e6..985ab2648e62 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -33,7 +33,7 @@ #include <vcl/wrkwin.hxx> #include <svx/svxids.hrc> #include <sfx2/sfx.hrc> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <svl/stritem.hxx> #include <svl/urihelper.hxx> #include <editeng/fhgtitem.hxx> @@ -996,7 +996,7 @@ void SwHTMLParser::InsertBodyOptions() } if( aLang.Len() ) { - LanguageType eLang = MsLangId::convertIsoStringToLanguage( aLang ); + LanguageType eLang = LanguageTag( aLang ).getLanguageType(); if( LANGUAGE_DONTKNOW != eLang ) { sal_uInt16 nWhich = 0; diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index 91fb3d86498d..c9925b49c0eb 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -29,7 +29,7 @@ #include <stdlib.h> #include <svx/svxids.hrc> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <svtools/ctrltool.hxx> #include <svl/urihelper.hxx> #include <editeng/udlnitem.hxx> @@ -3078,7 +3078,7 @@ static void ParseCSS1_so_language( const CSS1Expression *pExpr, if( CSS1_IDENT == pExpr->GetType() || CSS1_STRING == pExpr->GetType() ) { - LanguageType eLang = MsLangId::convertIsoStringToLanguage( pExpr->GetString() ); + LanguageType eLang = LanguageTag( pExpr->GetString() ).getLanguageType(); if( LANGUAGE_DONTKNOW != eLang ) { SvxLanguageItem aLang( eLang, aItemIds.nLanguage ); diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 57045f91ec56..67c6a568e5a7 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -36,7 +36,7 @@ #include <svtools/htmlcfg.hxx> #include <vcl/svapp.hxx> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <sfx2/frmhtmlw.hxx> #include <svx/xoutbmp.hxx> #include <svx/htmlmode.hxx> @@ -1234,7 +1234,7 @@ void SwHTMLWriter::OutLanguage( LanguageType nLang ) sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_lang) .append("=\""); Strm() << sOut.makeStringAndClear().getStr(); - HTMLOutFuncs::Out_String( Strm(), MsLangId::convertLanguageToIsoString(nLang), + HTMLOutFuncs::Out_String( Strm(), LanguageTag(nLang).getBcp47(), eDestEnc, &aNonConvertableCharacters ) << '"'; } } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index d69e2ccbb776..87425bdde0f1 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -33,7 +33,7 @@ #include <oox/export/utils.hxx> #include <oox/mathml/export.hxx> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <editeng/fontitem.hxx> #include <editeng/tstpitem.hxx> @@ -3283,7 +3283,7 @@ void DocxAttributeOutput::CharLanguage( const SvxLanguageItem& rLanguage ) if (!m_pCharLangAttrList) m_pCharLangAttrList = m_pSerializer->createAttrList(); - ::com::sun::star::lang::Locale xLocale= MsLangId::convertLanguageToLocale( rLanguage.GetLanguage( ) ); + ::com::sun::star::lang::Locale xLocale= LanguageTag( rLanguage.GetLanguage( ) ).getLocale(); OString sLanguage = OUStringToOString(xLocale.Language, RTL_TEXTENCODING_UTF8); OString sCountry = OUStringToOString(xLocale.Country, RTL_TEXTENCODING_UTF8); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index fe875092398d..1c520aaf5185 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -132,7 +132,7 @@ #include "ww8attributeoutput.hxx" #include "fields.hxx" #include <vcl/outdev.hxx> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> using ::editeng::SvxBorderLine; using namespace ::com::sun::star; @@ -2343,7 +2343,7 @@ bool MSWordExportBase::GetNumberFmt(const SwField& rFld, String& rStr) { sal_uInt16 nLng = rFld.GetLanguage(); LocaleDataWrapper aLocDat(comphelper::getComponentContext(pNFmtr->GetServiceManager()), - MsLangId::convertLanguageToLocale(nLng)); + LanguageTag(nLng).getLocale()); String sFmt(pNumFmt->GetMappedFormatstring(GetNfKeywordTable(), aLocDat)); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index b04597e175d5..937c21706b7c 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/embed/ElementModes.hpp> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <unotools/ucbstreamhelper.hxx> #include <rtl/random.h> @@ -2347,7 +2347,7 @@ CharSet SwWW8ImplReader::GetCurrentCharSet() */ const SvxLanguageItem *pLang = (const SvxLanguageItem*)GetFmtAttr(RES_CHRATR_LANGUAGE); LanguageType eLang = pLang ? pLang->GetLanguage() : LANGUAGE_SYSTEM; - ::com::sun::star::lang::Locale aLocale(MsLangId::convertLanguageToLocale(eLang)); + ::com::sun::star::lang::Locale aLocale(LanguageTag(eLang).getLocale()); eSrcCharSet = msfilter::util::getBestTextEncodingFromLocale(aLocale); } } diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index 158cd1d67061..a93273a2367e 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -46,6 +46,7 @@ #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> #include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <fontcfg.hxx> #include <optload.hxx> #include <optcomp.hxx> @@ -164,17 +165,17 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) Any aLang = aLinguCfg.GetProperty(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale"))); aLang >>= aLocale; - nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), LATIN); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag(aLocale).getLanguageType(false), LATIN); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE)); aLang = aLinguCfg.GetProperty(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale_CJK"))); aLang >>= aLocale; - nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), ASIAN); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag(aLocale).getLanguageType(false), ASIAN); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE)); aLang = aLinguCfg.GetProperty(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale_CTL"))); aLang >>= aLocale; - nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), COMPLEX); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag(aLocale).getLanguageType(false), COMPLEX); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE)); } if(bTextDialog) diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 8a9e6dc5d49e..88632385262e 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -110,7 +110,7 @@ #include <mailmergehelper.hxx> #include <maildispatcher.hxx> #include <svtools/htmlcfg.hxx> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <com/sun/star/util/XNumberFormatTypes.hpp> #include <editeng/langitem.hxx> #include <svl/numuno.hxx> @@ -311,7 +311,7 @@ static sal_Bool lcl_GetColumnCnt(SwDSParam* pParam, aFormatData.aNullDate = pParam->aNullDate; aFormatData.xFormatter = pParam->xFormatter; - MsLangId::convertLanguageToLocale( (LanguageType)nLanguage, aFormatData.aLocale ); + aFormatData.aLocale = LanguageTag( (LanguageType)nLanguage ).getLocale(); rResult = SwNewDBMgr::GetDBField( xColumnProps, aFormatData, pNumber); return sal_True; @@ -1464,7 +1464,7 @@ sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource, uno::Reference< XNumberFormats > xDocNumberFormats = xDocNumFmtsSupplier->getNumberFormats(); uno::Reference< XNumberFormatTypes > xDocNumberFormatTypes(xDocNumberFormats, UNO_QUERY); - com::sun::star::lang::Locale aLocale( MsLangId::convertLanguageToLocale( (LanguageType)nLanguage )); + com::sun::star::lang::Locale aLocale( LanguageTag( (LanguageType)nLanguage ).getLocale()); //get the number formatter of the data source uno::Reference<XPropertySet> xSourceProps(xSource, UNO_QUERY); diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 1617d63bd720..a7013114da55 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -52,6 +52,7 @@ #include <editeng/brshitem.hxx> #include <editeng/unolingu.hxx> #include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <linguistic/lngprops.hxx> #include <linguistic/misc.hxx> #include <osl/file.hxx> @@ -128,7 +129,7 @@ static LanguageType lcl_CheckLanguage( nLang = nTmpLang; } if (nLang == LANGUAGE_NONE) // language not found by looking up the system language... - nLang = MsLangId::convertLocaleToLanguageWithFallback( aLocale ); + nLang = LanguageTag( aLocale ).makeFallback().getLanguageType(); if (nLang == LANGUAGE_SYSTEM) nLang = nTmpLang; if (nLang == LANGUAGE_DONTKNOW) diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 067568930035..1a6f28d07daf 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -35,7 +35,7 @@ #include <cmdid.h> #include <helpid.h> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <svl/languageoptions.hxx> #include <editeng/langitem.hxx> #include <svtools/langtab.hxx> @@ -1365,7 +1365,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) LanguageType nLang = rSh.GetCurLang(); lang::Locale aLocale = SvxCreateLocale( nLang ); - String aLangText( MsLangId::convertLanguageToIsoString( nLang ) ); + String aLangText( LanguageTag( nLang ).getBcp47() ); // set word and locale to look up as status value String aStatusVal( aText ); diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 72b464749227..da4f1902fc69 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -116,7 +116,7 @@ #include <editeng/langitem.hxx> #include <docary.hxx> //SwCharFmts -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <format.hxx> #include <charfmt.hxx> //SwCharFmt @@ -3259,7 +3259,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages( break; if (LANGUAGE_NONE != *it) { - MsLangId::convertLanguageToLocale( *it, pLanguage[nCount] ); + pLanguage[nCount] = LanguageTag( *it ).getLocale(); pLanguage[nCount].Language = aLangTab.GetString( *it ); nCount += 1; } diff --git a/sw/source/ui/vba/vbastyle.cxx b/sw/source/ui/vba/vbastyle.cxx index a951e4ca707b..d39328dc6490 100644 --- a/sw/source/ui/vba/vbastyle.cxx +++ b/sw/source/ui/vba/vbastyle.cxx @@ -30,7 +30,7 @@ #include <ooo/vba/word/WdStyleType.hpp> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/text/XTextDocument.hpp> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include "vbafont.hxx" #include "vbapalette.hxx" #include "vbaparagraphformat.hxx" @@ -61,12 +61,12 @@ sal_Int32 SwVbaStyle::getLanguageID( const uno::Reference< beans::XPropertySet > { lang::Locale aLocale; xTCProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CharLocale") ) ) >>= aLocale; - return MsLangId::convertLocaleToLanguage( aLocale ); + return LanguageTag( aLocale ).getLanguageType( false); } void SwVbaStyle::setLanguageID( const uno::Reference< beans::XPropertySet >& xTCProps, sal_Int32 _languageid ) throw (uno::RuntimeException) { - lang::Locale aLocale = MsLangId::convertLanguageToLocale( static_cast<LanguageType>(_languageid) ); + lang::Locale aLocale = LanguageTag( static_cast<LanguageType>(_languageid) ).getLocale(); xTCProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CharLocale") ), uno::makeAny( aLocale ) ) ; } |