diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-06-06 23:04:49 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-06-07 12:59:23 +0200 |
commit | 93a41b20538f18344eb1b8c23b1eae134212b141 (patch) | |
tree | febaeaa7772bd1dd098365de0944a7300ba25f26 /linguistic | |
parent | 26e7cb5ef4fa0df985214ef98622255cfdfbdd01 (diff) |
tdf#108349: fix LanguageType conversions from UNO "short"
The bugdoc uses LANGUAGE_USER_LATIN_VATICAN LanguageType(0x8076).
The UNO API uses signed "short" for these in various interfaces,
and so the LanguageType constructor complains about
out-of-(short)-range values.
Avoid this by deleting the problematic constructor, so that the places
that currently call it with API parameters can be changed to first
cast the parameter to unsigned.
(Yes, we need to write "template<>" twice in a row. Don't ask me why, i
just work here. sberg says we also need to omit the explict <short>.)
Change-Id: I2443a89bc8d579504fc707ded3d145f9a625597a
Reviewed-on: https://gerrit.libreoffice.org/38473
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/spelldsp.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 404b350a05d7..5958d5980c60 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -757,7 +757,7 @@ sal_Bool SAL_CALL SpellCheckerDispatcher::hasLanguage( sal_Int16 nLanguage ) { MutexGuard aGuard( GetLinguMutex() ); - return hasLocale( LanguageTag::convertToLocale( LanguageType(nLanguage)) ); + return hasLocale( LanguageTag::convertToLocale(LanguageType(static_cast<sal_uInt16>(nLanguage)))); } @@ -767,7 +767,7 @@ sal_Bool SAL_CALL SpellCheckerDispatcher::isValid( const uno::Sequence< beans::PropertyValue >& rProperties ) { MutexGuard aGuard( GetLinguMutex() ); - return isValid( rWord, LanguageTag::convertToLocale( LanguageType(nLanguage) ), rProperties); + return isValid( rWord, LanguageTag::convertToLocale(LanguageType(static_cast<sal_uInt16>(nLanguage))), rProperties); } @@ -777,7 +777,7 @@ uno::Reference< linguistic2::XSpellAlternatives > SAL_CALL SpellCheckerDispatche const uno::Sequence< beans::PropertyValue >& rProperties ) { MutexGuard aGuard( GetLinguMutex() ); - return spell( rWord, LanguageTag::convertToLocale( LanguageType(nLanguage) ), rProperties); + return spell(rWord, LanguageTag::convertToLocale(LanguageType(static_cast<sal_uInt16>(nLanguage))), rProperties); } |