diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-04 14:25:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-06 07:56:50 +0100 |
commit | 7150ce717fb24893d5b527a0587cc166f7c6ec68 (patch) | |
tree | cdc20c9edde800641c19c819fdd178de8a3fb5a0 /odk | |
parent | 7cdcf1bea77190744d381fde8d62582c21d712ef (diff) |
remove deprecated IsGermanPreReform property
deprecated in 2008 (and seemingly never even implemented)
Replace the use of this property in sample code and
in Java unit tests with another property (I arbitrarily
selected "IsIgnoreControlCharacters")
Change-Id: I2cb474f895ac221952b59e98bfdbc01012095519
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164355
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'odk')
6 files changed, 7 insertions, 53 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java index 9cbd481cb4b0..35a1a39e6e3b 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/LinguisticExamples.java @@ -174,7 +174,7 @@ public class LinguisticExamples // in the LinguProperties property set need to be supllied. PropertyValue[] aProps = new PropertyValue[1]; aProps[0] = new PropertyValue(); - aProps[0].Name = "IsGermanPreReform"; + aProps[0].Name = "IsIgnoreControlCharacters"; aProps[0].Value = Boolean.TRUE; @@ -293,7 +293,7 @@ public class LinguisticExamples // set a spellchecker and hyphenator property value to a defined state try { - aLinguProps.setPropertyValue("IsGermanPreReform", Boolean.TRUE); + aLinguProps.setPropertyValue("IsIgnoreControlCharacters", Boolean.TRUE); } catch (Exception e) { } @@ -306,7 +306,7 @@ public class LinguisticExamples // event that eventually results in the listeners // 'processLinguServiceEvent' function being called try { - aLinguProps.setPropertyValue("IsGermanPreReform", Boolean.FALSE); + aLinguProps.setPropertyValue("IsIgnoreControlCharacters", Boolean.FALSE); } catch (Exception e) { } diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Hyph.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Hyph.java index 0945e413f11e..d1a6fb2e9752 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Hyph.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Hyph.java @@ -61,7 +61,6 @@ public class PropChgHelper_Hyph extends PropChgHelper // nothing to be done } else if (aEvt.PropertyName.equals( "IsUseDictionaryList" ) || - aEvt.PropertyName.equals( "IsGermanPreReform" ) || aEvt.PropertyName.equals( "HyphMinLeading" ) || aEvt.PropertyName.equals( "HyphMinTrailing" ) || aEvt.PropertyName.equals( "HyphMinWordLength" )) diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java index a2df6db5f4fb..ff1bd4907fb3 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/PropChgHelper_Spell.java @@ -65,10 +65,6 @@ public class PropChgHelper_Spell extends PropChgHelper { // nothing to be done } - else if (aEvt.PropertyName.equals( "IsGermanPreReform" )) - { - bSCWA = bSWWA = true; - } else if (aEvt.PropertyName.equals( "IsUseDictionaryList" )) { bSCWA = bSWWA = true; diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java index 930d42c320d7..4fcd413a723b 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleHyphenator.java @@ -79,7 +79,6 @@ public class SampleHyphenator extends ComponentBase implements { "IsIgnoreControlCharacters", "IsUseDictionaryList", - "IsGermanPreReform", "HyphMinLeading", "HyphMinTrailing", "HyphMinWordLength" @@ -225,7 +224,6 @@ public class SampleHyphenator extends ComponentBase implements //! them here. boolean bIsIgnoreControlCharacters = GetValueToUse( "IsIgnoreControlCharacters", true, aProperties ); boolean bIsUseDictionaryList = GetValueToUse( "IsUseDictionaryList", true, aProperties ); - boolean bIsGermanPreReform = GetValueToUse( "IsGermanPreReform", false, aProperties ); short nHyphMinLeading = GetValueToUse( "HyphMinLeading", (short)2, aProperties ); short nHyphMinTrailing = GetValueToUse( "HyphMinTrailing", (short)2, aProperties ); short nHyphMinWordLen = GetValueToUse( "HyphMinWordLength", (short)5, aProperties ); @@ -242,16 +240,7 @@ public class SampleHyphenator extends ComponentBase implements //!! implementation of your hyphenator if (IsEqual( aLocale, new Locale( "de", "DE", "" ) ) ) { - if (bIsGermanPreReform && aWord.equals( "Schiffahrt" )) - { - // Note: there is only one position where the word - // can be hyphenated... - - aHyphenatedWord = "Schifffahrt"; - nHyphenationPos = 4; - nHyphenPos = 5; - } - else if (!bIsGermanPreReform && aWord.equals( "Schifffahrt" )) + if (aWord.equals( "Schifffahrt" )) { nHyphenationPos = nHyphenPos = 5; } @@ -306,7 +295,6 @@ public class SampleHyphenator extends ComponentBase implements //! them here. boolean bIsIgnoreControlCharacters = GetValueToUse( "IsIgnoreControlCharacters", true, aProperties ); boolean bIsUseDictionaryList = GetValueToUse( "IsUseDictionaryList", true, aProperties ); - boolean bIsGermanPreReform = GetValueToUse( "IsGermanPreReform", false, aProperties ); short nHyphMinLeading = GetValueToUse( "HyphMinLeading", (short)2, aProperties ); short nHyphMinTrailing = GetValueToUse( "HyphMinTrailing", (short)2, aProperties ); short nHyphMinWordLen = GetValueToUse( "HyphMinWordLength", (short)5, aProperties ); @@ -317,15 +305,6 @@ public class SampleHyphenator extends ComponentBase implements //!! implementation of your hyphenator if ( IsEqual( aLocale, new Locale( "de", "DE", "" ) ) ) { - // there is an alternative spelling only when the - // word is hyphenated between the "ff" and old german spelling - // is set. - if (aWord.equals( "Schiffahrt" ) && - bIsGermanPreReform && nIndex == 4) - { - xRes = new XHyphenatedWord_impl(aWord, aLocale, - (short)4, "Schifffahrt", (short)5 ); - } } else if ( IsEqual( aLocale, new Locale( "en", "US", "" ) ) ) { @@ -355,7 +334,6 @@ public class SampleHyphenator extends ComponentBase implements //! them here. boolean bIsIgnoreControlCharacters = GetValueToUse( "IsIgnoreControlCharacters", true, aProperties ); boolean bIsUseDictionaryList = GetValueToUse( "IsUseDictionaryList", true, aProperties ); - boolean bIsGermanPreReform = GetValueToUse( "IsGermanPreReform", false, aProperties ); short nHyphMinLeading = GetValueToUse( "HyphMinLeading", (short)2, aProperties ); short nHyphMinTrailing = GetValueToUse( "HyphMinTrailing", (short)2, aProperties ); short nHyphMinWordLen = GetValueToUse( "HyphMinWordLength", (short)5, aProperties ); @@ -366,13 +344,7 @@ public class SampleHyphenator extends ComponentBase implements //!! implementation of your hyphenator if ( IsEqual( aLocale, new Locale( "de", "DE", "" ) ) ) { - if (bIsGermanPreReform && aWord.equals( "Schiffahrt" )) - { - short aPos[] = new short[] { (short) 4 }; - xRes = new XPossibleHyphens_impl(aWord, aLocale, - "Schiff=fahrt", aPos); - } - else if (!bIsGermanPreReform && aWord.equals( "Schifffahrt" )) + if (aWord.equals( "Schifffahrt" )) { short aPos[] = new short[] { (short) 5 }; xRes = new XPossibleHyphens_impl(aWord, aLocale, diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java index ab4f565b30df..9608929932fa 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleSpellChecker.java @@ -79,7 +79,6 @@ public class SampleSpellChecker extends ComponentBase implements { "IsIgnoreControlCharacters", "IsUseDictionaryList", - "IsGermanPreReform", "IsSpellUpperCase", "IsSpellWithDigits", }; @@ -161,12 +160,9 @@ public class SampleSpellChecker extends ComponentBase implements //!! This code needs to be replaced by code calling the actual //!! implementation of your spellchecker - boolean bIsGermanPreReform = GetValueToUse( "IsGermanPreReform", false, aProperties ); if (IsEqual( aLocale, new Locale( "de", "DE", "" ) )) { - if (bIsGermanPreReform && aWord.equals( "Schifffahrt" )) - nRes = SpellFailure.SPELLING_ERROR; - else if (!bIsGermanPreReform && aWord.equals( "Schiffahrt" )) + if (aWord.equals( "Schiffahrt" )) nRes = SpellFailure.SPELLING_ERROR; } else if (IsEqual( aLocale, new Locale( "en", "US", "" ) )) @@ -204,7 +200,6 @@ public class SampleSpellChecker extends ComponentBase implements //! The values for 'IsIgnoreControlCharacters' and 'IsUseDictionaryList' //! are handled by the dispatcher! Thus there is no need to access //! them here. - boolean bIsGermanPreReform = GetValueToUse( "IsGermanPreReform", false, aProperties ); boolean bIsSpellWithDigits = GetValueToUse( "IsSpellWithDigits", false, aProperties ); boolean bIsSpellUpperCase = GetValueToUse( "IsSpellUpperCase", false, aProperties ); @@ -212,12 +207,7 @@ public class SampleSpellChecker extends ComponentBase implements //!! implementation of your spellchecker if (IsEqual( aLocale, new Locale( "de", "DE", "" ) )) { - if (bIsGermanPreReform && aWord.equals( "Schifffahrt" )) - { - nType = SpellFailure.SPELLING_ERROR; - aProposals = new String[]{ "Schiffahrt" }; - } - else if (!bIsGermanPreReform && aWord.equals( "Schiffahrt" )) + if (aWord.equals( "Schiffahrt" )) { nType = SpellFailure.SPELLING_ERROR; aProposals = new String[]{ "Schifffahrt" }; @@ -298,7 +288,6 @@ public class SampleSpellChecker extends ComponentBase implements //! The values for 'IsIgnoreControlCharacters' and 'IsUseDictionaryList' //! are handled by the dispatcher! Thus there is no need to access //! them here. - boolean bIsGermanPreReform = GetValueToUse( "IsGermanPreReform", false, aProperties ); boolean bIsSpellWithDigits = GetValueToUse( "IsSpellWithDigits", false, aProperties ); boolean bIsSpellUpperCase = GetValueToUse( "IsSpellUpperCase", false, aProperties ); diff --git a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java index f5c437095ec2..420d85d481aa 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java +++ b/odk/examples/DevelopersGuide/OfficeDev/Linguistic/SampleThesaurus.java @@ -73,7 +73,6 @@ public class SampleThesaurus extends ComponentBase implements { "IsIgnoreControlCharacters", "IsUseDictionaryList", - "IsGermanPreReform", }; // this service has no listeners thus we may use the base class, @@ -179,7 +178,6 @@ public class SampleThesaurus extends ComponentBase implements //! The values for 'IsIgnoreControlCharacters' and 'IsUseDictionaryList' //! are handled by the dispatcher! Thus there is no need to access //! them here. - boolean bIsGermanPreReform = GetValueToUse( "IsGermanPreReform", false, aProperties ); XMeaning[] aRes = null; |