include/linguistic/lngprophelp.hxx | 3 include/unotools/linguprops.hxx | 62 ++++------ lingucomponent/source/spellcheck/macosxspell/macspellimp.mm | 2 lingucomponent/source/spellcheck/spell/sspellimp.cxx | 3 linguistic/source/iprcache.cxx | 1 linguistic/source/lngopt.cxx | 3 linguistic/source/lngopt.hxx | 6 linguistic/source/lngprophelp.cxx | 21 --- odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java | 5 odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java | 5 qadevOOo/objdsc/lng/com.sun.star.lingu2.LinguProps.csv | 1 qadevOOo/tests/java/ifc/linguistic2/_LinguProperties.java | 1 12 files changed, 34 insertions(+), 79 deletions(-)
New commits: commit ea4dfeb83889d5dc955646999e4b2b06693e631b Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Mar 1 11:43:54 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Mar 4 08:01:05 2024 +0100 finish removing IsSpellCapitalisation property which was partially removed in commit 9bb9ba6ae02692e65498bae4598e3b63bb65c02e Author: Samuel Mehrbrodt <samuel.mehrbr...@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.mehrbr...@allotropia.de> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/linguistic/lngprophelp.hxx b/include/linguistic/lngprophelp.hxx index a3ad3d2665ac..6b06d5cd9628 100644 --- a/include/linguistic/lngprophelp.hxx +++ b/include/linguistic/lngprophelp.hxx @@ -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; } }; diff --git a/include/unotools/linguprops.hxx b/include/unotools/linguprops.hxx index b14376f5c43f..1f182cd3d487 100644 --- a/include/unotools/linguprops.hxx +++ b/include/unotools/linguprops.hxx @@ -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 diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm index 448870e9125c..c6a1fcd47c4c 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm +++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm @@ -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; } diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 89db2c613af2..075667f05bcb 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -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; } diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx index 5dc0031cb139..22c73e6ab49f 100644 --- a/linguistic/source/iprcache.cxx +++ b/linguistic/source/iprcache.cxx @@ -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 } }; diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index 88264126f377..c33a05ab3a6f 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -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, diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx index d466acd32004..62886e587d92 100644 --- a/linguistic/source/lngopt.hxx +++ b/linguistic/source/lngopt.hxx @@ -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 diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx index b577a86baf1d..1305651dccbe 100644 --- a/linguistic/source/lngprophelp.cxx +++ b/linguistic/source/lngprophelp.cxx @@ -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(); diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java index edd0498db78d..a2df6db5f4fb 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java @@ -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; diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java index dc7ddfdddf55..ab4f565b30df 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java @@ -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; } diff --git a/qadevOOo/objdsc/lng/com.sun.star.lingu2.LinguProps.csv b/qadevOOo/objdsc/lng/com.sun.star.lingu2.LinguProps.csv index eea62d32cead..b2b6b1d16bfa 100644 --- a/qadevOOo/objdsc/lng/com.sun.star.lingu2.LinguProps.csv +++ b/qadevOOo/objdsc/lng/com.sun.star.lingu2.LinguProps.csv @@ -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" diff --git a/qadevOOo/tests/java/ifc/linguistic2/_LinguProperties.java b/qadevOOo/tests/java/ifc/linguistic2/_LinguProperties.java index 930986d564fc..f81b496311fa 100644 --- a/qadevOOo/tests/java/ifc/linguistic2/_LinguProperties.java +++ b/qadevOOo/tests/java/ifc/linguistic2/_LinguProperties.java @@ -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>