finish removing IsSpellCapitalisation property
which was partially removed in
commit 9bb9ba6ae0
Author: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Date: Mon Oct 2 12:33:34 2023 +0200
[API CHANGE] Remove deprecated IsSpellCapitalization
Change-Id: I861c8c484b77a041d91cb25ddeecb7027a2fd96c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164183
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
88c6e127b3
commit
ea4dfeb838
12 changed files with 34 additions and 79 deletions
|
@ -165,14 +165,12 @@ class UNLESS_MERGELIBS(LNG_DLLPUBLIC) PropertyHelper_Spell final :
|
|||
// default values
|
||||
bool bIsSpellUpperCase;
|
||||
bool bIsSpellWithDigits;
|
||||
bool bIsSpellCapitalization;
|
||||
bool bIsSpellClosedCompound;
|
||||
bool bIsSpellHyphenatedCompound;
|
||||
|
||||
// return values, will be set to default value or current temporary value
|
||||
bool bResIsSpellUpperCase;
|
||||
bool bResIsSpellWithDigits;
|
||||
bool bResIsSpellCapitalization;
|
||||
bool bResIsSpellClosedCompound;
|
||||
bool bResIsSpellHyphenatedCompound;
|
||||
|
||||
|
@ -199,7 +197,6 @@ public:
|
|||
|
||||
bool IsSpellUpperCase() const { return bResIsSpellUpperCase; }
|
||||
bool IsSpellWithDigits() const { return bResIsSpellWithDigits; }
|
||||
bool IsSpellCapitalization() const { return bResIsSpellCapitalization; }
|
||||
bool IsSpellClosedCompound() const { return bResIsSpellClosedCompound; }
|
||||
bool IsSpellHyphenatedCompound() const { return bResIsSpellHyphenatedCompound; }
|
||||
};
|
||||
|
|
|
@ -34,7 +34,6 @@ inline constexpr OUString UPN_ACTIVE_DICTIONARIES = u"ActiveDictiona
|
|||
// UNO property names for SpellChecker
|
||||
inline constexpr OUString UPN_IS_SPELL_UPPER_CASE = u"IsSpellUpperCase"_ustr;
|
||||
inline constexpr OUString UPN_IS_SPELL_WITH_DIGITS = u"IsSpellWithDigits"_ustr;
|
||||
inline constexpr OUString UPN_IS_SPELL_CAPITALIZATION = u"IsSpellCapitalization"_ustr;
|
||||
|
||||
// UNO property names for Hyphenator
|
||||
inline constexpr OUString UPN_HYPH_MIN_LEADING = u"HyphMinLeading"_ustr;
|
||||
|
@ -80,37 +79,36 @@ inline constexpr OUString UPN_IS_GRAMMAR_INTERACTIVE = u"IsInteractiveG
|
|||
#define UPH_IS_IGNORE_CONTROL_CHARACTERS 2
|
||||
#define UPH_IS_SPELL_UPPER_CASE 3
|
||||
#define UPH_IS_SPELL_WITH_DIGITS 4
|
||||
#define UPH_IS_SPELL_CAPITALIZATION 5
|
||||
#define UPH_HYPH_MIN_LEADING 6
|
||||
#define UPH_HYPH_MIN_TRAILING 7
|
||||
#define UPH_HYPH_MIN_WORD_LENGTH 8
|
||||
#define UPH_DEFAULT_LOCALE 9
|
||||
#define UPH_IS_SPELL_AUTO 10
|
||||
#define UPH_IS_SPELL_CLOSED_COMPOUND 11
|
||||
#define UPH_IS_SPELL_HYPHENATED_COMPOUND 12
|
||||
#define UPH_IS_SPELL_SPECIAL 13
|
||||
#define UPH_IS_HYPH_AUTO 14
|
||||
#define UPH_IS_HYPH_SPECIAL 15
|
||||
#define UPH_IS_WRAP_REVERSE 16
|
||||
#define UPH_DATA_FILES_CHANGED_CHECK_VALUE 17
|
||||
#define UPH_DEFAULT_LANGUAGE 21
|
||||
#define UPH_DEFAULT_LOCALE_CJK 22
|
||||
#define UPH_DEFAULT_LOCALE_CTL 23
|
||||
#define UPH_ACTIVE_DICTIONARIES 24
|
||||
#define UPH_ACTIVE_CONVERSION_DICTIONARIES 25
|
||||
#define UPH_IS_IGNORE_POST_POSITIONAL_WORD 26
|
||||
#define UPH_IS_AUTO_CLOSE_DIALOG 27
|
||||
#define UPH_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST 28
|
||||
#define UPH_IS_AUTO_REPLACE_UNIQUE_ENTRIES 29
|
||||
#define UPH_IS_DIRECTION_TO_SIMPLIFIED 30
|
||||
#define UPH_IS_USE_CHARACTER_VARIANTS 31
|
||||
#define UPH_IS_TRANSLATE_COMMON_TERMS 32
|
||||
#define UPH_IS_REVERSE_MAPPING 33
|
||||
#define UPH_IS_GRAMMAR_AUTO 34
|
||||
#define UPH_IS_GRAMMAR_INTERACTIVE 35
|
||||
#define UPH_HYPH_NO_CAPS 36
|
||||
#define UPH_HYPH_NO_LAST_WORD 37
|
||||
#define UPH_HYPH_ZONE 38
|
||||
#define UPH_HYPH_MIN_LEADING 5
|
||||
#define UPH_HYPH_MIN_TRAILING 6
|
||||
#define UPH_HYPH_MIN_WORD_LENGTH 7
|
||||
#define UPH_DEFAULT_LOCALE 8
|
||||
#define UPH_IS_SPELL_AUTO 9
|
||||
#define UPH_IS_SPELL_CLOSED_COMPOUND 10
|
||||
#define UPH_IS_SPELL_HYPHENATED_COMPOUND 11
|
||||
#define UPH_IS_SPELL_SPECIAL 12
|
||||
#define UPH_IS_HYPH_AUTO 13
|
||||
#define UPH_IS_HYPH_SPECIAL 14
|
||||
#define UPH_IS_WRAP_REVERSE 15
|
||||
#define UPH_DATA_FILES_CHANGED_CHECK_VALUE 16
|
||||
#define UPH_DEFAULT_LANGUAGE 17
|
||||
#define UPH_DEFAULT_LOCALE_CJK 18
|
||||
#define UPH_DEFAULT_LOCALE_CTL 19
|
||||
#define UPH_ACTIVE_DICTIONARIES 20
|
||||
#define UPH_ACTIVE_CONVERSION_DICTIONARIES 21
|
||||
#define UPH_IS_IGNORE_POST_POSITIONAL_WORD 22
|
||||
#define UPH_IS_AUTO_CLOSE_DIALOG 23
|
||||
#define UPH_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST 24
|
||||
#define UPH_IS_AUTO_REPLACE_UNIQUE_ENTRIES 25
|
||||
#define UPH_IS_DIRECTION_TO_SIMPLIFIED 26
|
||||
#define UPH_IS_USE_CHARACTER_VARIANTS 27
|
||||
#define UPH_IS_TRANSLATE_COMMON_TERMS 28
|
||||
#define UPH_IS_REVERSE_MAPPING 29
|
||||
#define UPH_IS_GRAMMAR_AUTO 30
|
||||
#define UPH_IS_GRAMMAR_INTERACTIVE 31
|
||||
#define UPH_HYPH_NO_CAPS 32
|
||||
#define UPH_HYPH_NO_LAST_WORD 33
|
||||
#define UPH_HYPH_ZONE 34
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
|
|
|
@ -454,8 +454,6 @@ sal_Bool SAL_CALL
|
|||
// postprocess result for errors that should be ignored
|
||||
if ( (!rHelper.IsSpellUpperCase() && IsUpper( rWord, nLang ))
|
||||
|| (!rHelper.IsSpellWithDigits() && HasDigits( rWord ))
|
||||
|| (!rHelper.IsSpellCapitalization()
|
||||
&& nFailure == SpellFailure::CAPTION_ERROR)
|
||||
)
|
||||
nFailure = -1;
|
||||
}
|
||||
|
|
|
@ -404,8 +404,7 @@ sal_Bool SAL_CALL SpellChecker::isValid( const OUString& rWord, const Locale& rL
|
|||
// postprocess result for errors that should be ignored
|
||||
const bool bIgnoreError =
|
||||
(!rHelper.IsSpellUpperCase() && IsUpper( rWord, nLang )) ||
|
||||
(!rHelper.IsSpellWithDigits() && HasDigits( rWord )) ||
|
||||
(!rHelper.IsSpellCapitalization() && nFailure == SpellFailure::CAPTION_ERROR);
|
||||
(!rHelper.IsSpellWithDigits() && HasDigits( rWord ));
|
||||
if (bIgnoreError)
|
||||
nFailure = -1;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ const struct
|
|||
{ UPN_IS_IGNORE_CONTROL_CHARACTERS, UPH_IS_IGNORE_CONTROL_CHARACTERS },
|
||||
{ UPN_IS_SPELL_UPPER_CASE, UPH_IS_SPELL_UPPER_CASE },
|
||||
{ UPN_IS_SPELL_WITH_DIGITS, UPH_IS_SPELL_WITH_DIGITS },
|
||||
{ UPN_IS_SPELL_CAPITALIZATION, UPH_IS_SPELL_CAPITALIZATION },
|
||||
{ UPN_IS_SPELL_CLOSED_COMPOUND, UPH_IS_SPELL_CLOSED_COMPOUND },
|
||||
{ UPN_IS_SPELL_HYPHENATED_COMPOUND, UPH_IS_SPELL_HYPHENATED_COMPOUND }
|
||||
};
|
||||
|
|
|
@ -97,7 +97,6 @@ WID_Name const aWID_Name[] =
|
|||
{ UPH_IS_IGNORE_CONTROL_CHARACTERS, UPN_IS_IGNORE_CONTROL_CHARACTERS },
|
||||
{ UPH_IS_SPELL_UPPER_CASE, UPN_IS_SPELL_UPPER_CASE },
|
||||
{ UPH_IS_SPELL_WITH_DIGITS, UPN_IS_SPELL_WITH_DIGITS },
|
||||
{ UPH_IS_SPELL_CAPITALIZATION, UPN_IS_SPELL_CAPITALIZATION },
|
||||
{ UPH_HYPH_MIN_LEADING, UPN_HYPH_MIN_LEADING },
|
||||
{ UPH_HYPH_MIN_TRAILING, UPN_HYPH_MIN_TRAILING },
|
||||
{ UPH_HYPH_MIN_WORD_LENGTH, UPN_HYPH_MIN_WORD_LENGTH },
|
||||
|
@ -166,8 +165,6 @@ static std::span<const SfxItemPropertyMapEntry> lcl_GetLinguProps()
|
|||
cppu::UnoType<bool>::get(), 0, 0 },
|
||||
{ UPN_IS_SPELL_AUTO, UPH_IS_SPELL_AUTO,
|
||||
cppu::UnoType<bool>::get(), 0, 0 },
|
||||
{ UPN_IS_SPELL_CAPITALIZATION, UPH_IS_SPELL_CAPITALIZATION,
|
||||
cppu::UnoType<bool>::get(), 0, 0 },
|
||||
{ UPN_IS_SPELL_CLOSED_COMPOUND, UPH_IS_SPELL_CLOSED_COMPOUND,
|
||||
cppu::UnoType<bool>::get(), 0, 0 },
|
||||
{ UPN_IS_SPELL_HYPHENATED_COMPOUND, UPH_IS_SPELL_HYPHENATED_COMPOUND,
|
||||
|
|
|
@ -120,9 +120,9 @@ public:
|
|||
virtual void SAL_CALL setIsSpellWithDigits(sal_Bool p1) override
|
||||
{ setProperty(UPN_IS_SPELL_WITH_DIGITS, static_cast<bool>(p1)); }
|
||||
virtual sal_Bool SAL_CALL getIsSpellCapitalization() override
|
||||
{ return getPropertyBool(UPN_IS_SPELL_CAPITALIZATION); }
|
||||
virtual void SAL_CALL setIsSpellCapitalization(sal_Bool p1) override
|
||||
{ setProperty(UPN_IS_SPELL_CAPITALIZATION, static_cast<bool>(p1)); }
|
||||
{ return false; }
|
||||
virtual void SAL_CALL setIsSpellCapitalization(sal_Bool /*p1*/) override
|
||||
{ throw new css::beans::UnknownPropertyException( "this deprecated property has been removed"); }
|
||||
virtual sal_Int16 SAL_CALL getHyphMinLeading() override
|
||||
{ return getPropertyInt16(UPN_HYPH_MIN_LEADING); }
|
||||
virtual void SAL_CALL setHyphMinLeading(sal_Int16 p1) override
|
||||
|
|
|
@ -291,7 +291,6 @@ PropertyHelper_Spell::PropertyHelper_Spell(
|
|||
auto& rPropNames = GetPropNames();
|
||||
rPropNames.push_back(UPN_IS_SPELL_UPPER_CASE);
|
||||
rPropNames.push_back(UPN_IS_SPELL_WITH_DIGITS);
|
||||
rPropNames.push_back(UPN_IS_SPELL_CAPITALIZATION);
|
||||
rPropNames.push_back(UPN_IS_SPELL_CLOSED_COMPOUND);
|
||||
rPropNames.push_back(UPN_IS_SPELL_HYPHENATED_COMPOUND);
|
||||
SetDefaultValues();
|
||||
|
@ -310,7 +309,6 @@ void PropertyHelper_Spell::SetDefaultValues()
|
|||
|
||||
bResIsSpellUpperCase = bIsSpellUpperCase = false;
|
||||
bResIsSpellWithDigits = bIsSpellWithDigits = false;
|
||||
bResIsSpellCapitalization = bIsSpellCapitalization = true;
|
||||
bResIsSpellClosedCompound = bIsSpellClosedCompound = true;
|
||||
bResIsSpellHyphenatedCompound = bIsSpellHyphenatedCompound = true;
|
||||
}
|
||||
|
@ -339,11 +337,6 @@ void PropertyHelper_Spell::GetCurrentValues()
|
|||
pbVal = &bIsSpellWithDigits;
|
||||
pbResVal = &bResIsSpellWithDigits;
|
||||
}
|
||||
else if ( rPropName == UPN_IS_SPELL_CAPITALIZATION )
|
||||
{
|
||||
pbVal = &bIsSpellCapitalization;
|
||||
pbResVal = &bResIsSpellCapitalization;
|
||||
}
|
||||
else if ( rPropName == UPN_IS_SPELL_CLOSED_COMPOUND )
|
||||
{
|
||||
pbVal = &bIsSpellClosedCompound;
|
||||
|
@ -390,13 +383,6 @@ bool PropertyHelper_Spell::propertyChange_Impl( const PropertyChangeEvent& rEvt
|
|||
bSWWA = !bSCWA; // sal_True->sal_False change?
|
||||
break;
|
||||
}
|
||||
case UPH_IS_SPELL_CAPITALIZATION :
|
||||
{
|
||||
pbVal = &bIsSpellCapitalization;
|
||||
bSCWA = ! *pbVal; // sal_False->sal_True change?
|
||||
bSWWA = !bSCWA; // sal_True->sal_False change?
|
||||
break;
|
||||
}
|
||||
case UPH_IS_SPELL_CLOSED_COMPOUND :
|
||||
{
|
||||
pbVal = &bIsSpellClosedCompound;
|
||||
|
@ -452,7 +438,6 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
|
|||
// return value is default value unless there is an explicitly supplied
|
||||
// temporary value
|
||||
bResIsSpellWithDigits = bIsSpellWithDigits;
|
||||
bResIsSpellCapitalization = bIsSpellCapitalization;
|
||||
bResIsSpellClosedCompound = bIsSpellClosedCompound;
|
||||
bResIsSpellHyphenatedCompound = bIsSpellHyphenatedCompound;
|
||||
bResIsSpellUpperCase = bIsSpellUpperCase;
|
||||
|
@ -470,7 +455,6 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
|
|||
{
|
||||
case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break;
|
||||
case UPH_IS_SPELL_WITH_DIGITS : pbResVal = &bResIsSpellWithDigits; break;
|
||||
case UPH_IS_SPELL_CAPITALIZATION : pbResVal = &bResIsSpellCapitalization; break;
|
||||
case UPH_IS_SPELL_CLOSED_COMPOUND : pbResVal = &bResIsSpellClosedCompound; break;
|
||||
case UPH_IS_SPELL_HYPHENATED_COMPOUND : pbResVal = &bResIsSpellHyphenatedCompound; break;
|
||||
default:
|
||||
|
@ -773,11 +757,6 @@ bool PropertyHelper_Spelling::IsSpellWithDigits() const
|
|||
return mxPropHelper->IsSpellWithDigits();
|
||||
}
|
||||
|
||||
bool PropertyHelper_Spelling::IsSpellCapitalization() const
|
||||
{
|
||||
return mxPropHelper->IsSpellCapitalization();
|
||||
}
|
||||
|
||||
bool PropertyHelper_Spelling::IsSpellClosedCompound() const
|
||||
{
|
||||
return mxPropHelper->IsSpellClosedCompound();
|
||||
|
|
|
@ -83,11 +83,6 @@ public class PropChgHelper_Spell extends PropChgHelper
|
|||
bSCWA = !bVal; // FALSE->TRUE change?
|
||||
bSWWA = !bSCWA; // TRUE->FALSE change?
|
||||
}
|
||||
else if (aEvt.PropertyName.equals( "IsSpellCapitalization" ))
|
||||
{
|
||||
bSCWA = !bVal; // FALSE->TRUE change?
|
||||
bSWWA = !bSCWA; // TRUE->FALSE change?
|
||||
}
|
||||
|
||||
if (bSCWA)
|
||||
nLngSvcFlags |= LinguServiceEventFlags.SPELL_CORRECT_WORDS_AGAIN;
|
||||
|
|
|
@ -82,7 +82,6 @@ public class SampleSpellChecker extends ComponentBase implements
|
|||
"IsGermanPreReform",
|
||||
"IsSpellUpperCase",
|
||||
"IsSpellWithDigits",
|
||||
"IsSpellCapitalization"
|
||||
};
|
||||
aPropChgHelper = new PropChgHelper_Spell( this, aProps );
|
||||
aEvtListeners = new ArrayList<Object>();
|
||||
|
@ -208,7 +207,6 @@ public class SampleSpellChecker extends ComponentBase implements
|
|||
boolean bIsGermanPreReform = GetValueToUse( "IsGermanPreReform", false, aProperties );
|
||||
boolean bIsSpellWithDigits = GetValueToUse( "IsSpellWithDigits", false, aProperties );
|
||||
boolean bIsSpellUpperCase = GetValueToUse( "IsSpellUpperCase", false, aProperties );
|
||||
boolean bIsSpellCapitalization = GetValueToUse( "IsSpellCapitalization", true, aProperties );
|
||||
|
||||
//!! This code needs to be replaced by code calling the actual
|
||||
//!! implementation of your spellchecker
|
||||
|
@ -303,7 +301,6 @@ public class SampleSpellChecker extends ComponentBase implements
|
|||
boolean bIsGermanPreReform = GetValueToUse( "IsGermanPreReform", false, aProperties );
|
||||
boolean bIsSpellWithDigits = GetValueToUse( "IsSpellWithDigits", false, aProperties );
|
||||
boolean bIsSpellUpperCase = GetValueToUse( "IsSpellUpperCase", false, aProperties );
|
||||
boolean bIsSpellCapitalization = GetValueToUse( "IsSpellCapitalization", true, aProperties );
|
||||
|
||||
short nFailure = GetSpellFailure( aWord, aLocale, aProperties );
|
||||
if (nFailure != -1)
|
||||
|
@ -311,8 +308,6 @@ public class SampleSpellChecker extends ComponentBase implements
|
|||
// postprocess result for errors that should be ignored
|
||||
if ( (!bIsSpellUpperCase && IsUpper( aWord, aLocale ))
|
||||
|| (!bIsSpellWithDigits && HasDigits( aWord ))
|
||||
|| (!bIsSpellCapitalization
|
||||
&& nFailure == SpellFailure.CAPTION_ERROR)
|
||||
)
|
||||
nFailure = -1;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"IsIgnoreControlCharacters"
|
||||
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"IsSpellUpperCase"
|
||||
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"IsSpellWithDigits"
|
||||
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"IsSpellCapitalization"
|
||||
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"HyphMinLeading"
|
||||
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"HyphMinTrailing"
|
||||
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"HyphMinWordLength"
|
||||
|
|
|
|
@ -29,7 +29,6 @@ import lib.MultiPropertyTest;
|
|||
* <li><code>'IsIgnoreControlCharacters'</code></li>
|
||||
* <li><code>'IsSpellUpperCase'</code></li>
|
||||
* <li><code>'IsSpellWithDigits'</code></li>
|
||||
* <li><code>'IsSpellCapitalization'</code></li>
|
||||
* <li><code>'HyphMinLeading'</code></li>
|
||||
* <li><code>'HyphMinTrailing'</code></li>
|
||||
* <li><code>'HyphMinWordLength'</code></li>
|
||||
|
|
Loading…
Reference in a new issue