diff options
author | Eike Rathke <erack@redhat.com> | 2013-07-13 02:54:05 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-07-13 11:55:16 +0200 |
commit | 358d1a99484bcc02900bd200a7606a7bf3298cac (patch) | |
tree | 031f808141dbc712553b8a4a029a354a2699a622 /sw/source/ui/shells | |
parent | 5d1a8e0d47b6d6e9e3e5735d0ee52fa0b4782202 (diff) |
use static LanguageTag::convertTo...() for standalone conversions
If no LanguageTag instance is at hand use the static methods to convert
between BCP 47 string, Locale and MS-LangID instead of creating
temporary instances.
Change-Id: I9597f768078eb81c840e84a5db5617f26bb7dc09
Diffstat (limited to 'sw/source/ui/shells')
-rw-r--r-- | sw/source/ui/shells/annotsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/shells/drwtxtex.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index ab95b129dbb7..f1c54f1870ca 100644 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -1324,7 +1324,7 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet) // disable "Thesaurus" context menu entry if there is nothing to look up uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); if (!bIsLookUpWord || - !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) + !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) )) rSet.DisableItem( SID_THES ); break; } @@ -1339,7 +1339,7 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet) rItem).GetLanguage(); uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); if (!xThes.is() || nLang == LANGUAGE_NONE || - !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) + !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) )) rSet.DisableItem( SID_THESAURUS ); } break; diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx index b533ea1b5fa4..547ba2e2f1fb 100644 --- a/sw/source/ui/shells/drwtxtex.cxx +++ b/sw/source/ui/shells/drwtxtex.cxx @@ -604,7 +604,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) // disable "Thesaurus" context menu entry if there is nothing to look up uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); if (!bIsLookUpWord || - !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) + !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) )) rSet.DisableItem( SID_THES ); //! avoid putting the same item as SfxBoolItem at the end of this function @@ -714,7 +714,7 @@ ASK_ESCAPE: LanguageType nLang = ((const SvxLanguageItem &) rItem).GetLanguage(); uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); - if (!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) + if (!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) )) rSet.DisableItem( SID_THESAURUS ); nSlotId = 0; } |