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>
This commit is contained in:
Noel Grandin 2024-03-04 14:25:52 +02:00
parent 7cdcf1bea7
commit 7150ce717f
15 changed files with 43 additions and 128 deletions

View file

@ -26,7 +26,6 @@
#endif
// UNO property names for general options
inline constexpr OUString UPN_IS_GERMAN_PRE_REFORM = u"IsGermanPreReform"_ustr; /*! deprecated #i91949 !*/
inline constexpr OUString UPN_IS_USE_DICTIONARY_LIST = u"IsUseDictionaryList"_ustr;
inline constexpr OUString UPN_IS_IGNORE_CONTROL_CHARACTERS = u"IsIgnoreControlCharacters"_ustr;
inline constexpr OUString UPN_ACTIVE_DICTIONARIES = u"ActiveDictionaries"_ustr;
@ -75,42 +74,41 @@ inline constexpr OUString UPN_IS_GRAMMAR_AUTO = u"IsAutoGrammarC
inline constexpr OUString UPN_IS_GRAMMAR_INTERACTIVE = u"IsInteractiveGrammarCheck"_ustr;
// uno property handles
#define UPH_IS_GERMAN_PRE_REFORM 0
#define UPH_IS_USE_DICTIONARY_LIST 1
#define UPH_IS_IGNORE_CONTROL_CHARACTERS 2
#define UPH_IS_SPELL_UPPER_CASE 3
#define UPH_IS_SPELL_WITH_DIGITS 4
#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
#define UPH_HYPH_KEEP 35
#define UPH_IS_USE_DICTIONARY_LIST 0
#define UPH_IS_IGNORE_CONTROL_CHARACTERS 1
#define UPH_IS_SPELL_UPPER_CASE 2
#define UPH_IS_SPELL_WITH_DIGITS 3
#define UPH_HYPH_MIN_LEADING 4
#define UPH_HYPH_MIN_TRAILING 5
#define UPH_HYPH_MIN_WORD_LENGTH 6
#define UPH_DEFAULT_LOCALE 7
#define UPH_IS_SPELL_AUTO 8
#define UPH_IS_SPELL_CLOSED_COMPOUND 9
#define UPH_IS_SPELL_HYPHENATED_COMPOUND 10
#define UPH_IS_SPELL_SPECIAL 11
#define UPH_IS_HYPH_AUTO 12
#define UPH_IS_HYPH_SPECIAL 13
#define UPH_IS_WRAP_REVERSE 14
#define UPH_DATA_FILES_CHANGED_CHECK_VALUE 15
#define UPH_DEFAULT_LANGUAGE 16
#define UPH_DEFAULT_LOCALE_CJK 17
#define UPH_DEFAULT_LOCALE_CTL 18
#define UPH_ACTIVE_DICTIONARIES 19
#define UPH_ACTIVE_CONVERSION_DICTIONARIES 20
#define UPH_IS_IGNORE_POST_POSITIONAL_WORD 21
#define UPH_IS_AUTO_CLOSE_DIALOG 22
#define UPH_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST 23
#define UPH_IS_AUTO_REPLACE_UNIQUE_ENTRIES 24
#define UPH_IS_DIRECTION_TO_SIMPLIFIED 25
#define UPH_IS_USE_CHARACTER_VARIANTS 26
#define UPH_IS_TRANSLATE_COMMON_TERMS 27
#define UPH_IS_REVERSE_MAPPING 28
#define UPH_IS_GRAMMAR_AUTO 29
#define UPH_IS_GRAMMAR_INTERACTIVE 30
#define UPH_HYPH_NO_CAPS 31
#define UPH_HYPH_NO_LAST_WORD 32
#define UPH_HYPH_ZONE 33
#define UPH_HYPH_KEEP 34
#ifdef __GNUC__
#pragma GCC diagnostic pop

View file

@ -37,10 +37,6 @@ Meaning::Meaning(OUString _aTerm) :
aSyn ( Sequence< OUString >(1) ),
aTerm (std::move(_aTerm))
{
#if 0
// this is for future use by a german thesaurus when one exists
bIsGermanPreReform = rHelper.IsGermanPreReform;
#endif
}
Meaning::~Meaning()

View file

@ -32,11 +32,6 @@ class Meaning :
css::uno::Sequence< OUString > aSyn; // list of synonyms, may be empty.
OUString aTerm;
#if 0
// this is for future use by a German thesaurus
sal_Bool bIsGermanPreReform;
#endif
Meaning(const Meaning &) = delete;
Meaning & operator = (const Meaning &) = delete;

View file

@ -155,8 +155,6 @@ static std::span<const SfxItemPropertyMapEntry> lcl_GetLinguProps()
::cppu::UnoType<sal_Int16>::get(), 0, 0 },
{ UPN_HYPH_MIN_WORD_LENGTH, UPH_HYPH_MIN_WORD_LENGTH,
::cppu::UnoType<sal_Int16>::get(), 0, 0 },
{ UPN_IS_GERMAN_PRE_REFORM, UPH_IS_GERMAN_PRE_REFORM, /*! deprecated !*/
cppu::UnoType<bool>::get(), 0, 0 },
{ UPN_IS_HYPH_AUTO, UPH_IS_HYPH_AUTO,
cppu::UnoType<bool>::get(), 0, 0 },
{ UPN_IS_HYPH_SPECIAL, UPH_IS_HYPH_SPECIAL,

View file

@ -162,7 +162,6 @@ sal_Bool SAL_CALL
static const char *aSP[] =
{
UPN_IS_GERMAN_PRE_REFORM,
UPN_IS_IGNORE_CONTROL_CHARACTERS,
UPN_IS_USE_DICTIONARY_LIST,
UPN_IS_SPELL_UPPER_CASE,
@ -188,12 +187,7 @@ PropertyHelper_Spell::PropertyHelper_Spell(
sal_Bool *pbVal = NULL,
*pbResVal = NULL;
if (OUString( UPN_IS_GERMAN_PRE_REFORM ) == pPropName[i])
{
pbVal = &bIsGermanPreReform;
pbResVal = &bResIsGermanPreReform;
}
else if (OUString( UPN_IS_IGNORE_CONTROL_CHARACTERS ) == pPropName[i])
if (OUString( UPN_IS_IGNORE_CONTROL_CHARACTERS ) == pPropName[i])
{
pbVal = &bIsIgnoreControlCharacters;
pbResVal = &bResIsIgnoreControlCharacters;
@ -246,7 +240,6 @@ PropertyHelper_Spell::~PropertyHelper_Spell()
void PropertyHelper_Spell::SetDefault()
{
bResIsGermanPreReform = bIsGermanPreReform = sal_False;
bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters = sal_True;
bResIsUseDictionaryList = bIsUseDictionaryList = sal_True;
bResIsSpellUpperCase = bIsSpellUpperCase = sal_False;
@ -277,12 +270,6 @@ void SAL_CALL
pbVal = &bIsIgnoreControlCharacters;
break;
}
case UPH_IS_GERMAN_PRE_REFORM :
{
pbVal = &bIsGermanPreReform;
bSCWA = bSWWA = sal_True;
break;
}
case UPH_IS_USE_DICTIONARY_LIST :
{
pbVal = &bIsUseDictionaryList;
@ -348,7 +335,6 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
{
// set return value to default value unless there is an
// explicitly supplied temporary value
bResIsGermanPreReform = bIsGermanPreReform;
bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters;
bResIsUseDictionaryList = bIsUseDictionaryList;
bResIsSpellUpperCase = bIsSpellUpperCase;
@ -366,7 +352,6 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals )
sal_Bool *pbResVal = NULL;
switch (pVal[i].Handle)
{
case UPH_IS_GERMAN_PRE_REFORM : pbResVal = &bResIsGermanPreReform; break;
case UPH_IS_IGNORE_CONTROL_CHARACTERS : pbResVal = &bResIsIgnoreControlCharacters; break;
case UPH_IS_USE_DICTIONARY_LIST : pbResVal = &bResIsUseDictionaryList; break;
case UPH_IS_SPELL_UPPER_CASE : pbResVal = &bResIsSpellUpperCase; break;

View file

@ -106,7 +106,6 @@ class PropertyHelper_Spell :
public PropertyChgHelper
{
// default values
sal_Bool bIsGermanPreReform;
sal_Bool bIsIgnoreControlCharacters;
sal_Bool bIsUseDictionaryList;
sal_Bool bIsSpellUpperCase;
@ -114,7 +113,6 @@ class PropertyHelper_Spell :
sal_Bool bIsSpellCapitalization;
// return values, will be set to default value or current temporary value
sal_Bool bResIsGermanPreReform;
sal_Bool bResIsIgnoreControlCharacters;
sal_Bool bResIsUseDictionaryList;
sal_Bool bResIsSpellUpperCase;
@ -141,7 +139,6 @@ public:
void SetTmpPropVals( const PropertyValues &rPropVals );
sal_Bool IsGermanPreReform() const { return bResIsGermanPreReform; }
sal_Bool IsIgnoreControlCharacters() const { return bResIsIgnoreControlCharacters; }
sal_Bool IsUseDictionaryList() const { return bResIsUseDictionaryList; }
sal_Bool IsSpellUpperCase() const { return bResIsSpellUpperCase; }

View file

@ -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) {
}

View file

@ -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" ))

View file

@ -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;

View file

@ -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,

View file

@ -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 );

View file

@ -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;

View file

@ -1,4 +1,3 @@
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"IsGermanPreReform"
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"IsUseDictionaryList"
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"IsIgnoreControlCharacters"
"LinguProps";"com::sun::star::linguistic2::LinguProperties";"IsSpellUpperCase"

1 LinguProps com::sun::star::linguistic2::LinguProperties IsGermanPreReform IsUseDictionaryList
LinguProps com::sun::star::linguistic2::LinguProperties IsGermanPreReform
1 LinguProps com::sun::star::linguistic2::LinguProperties IsUseDictionaryList IsUseDictionaryList
2 LinguProps com::sun::star::linguistic2::LinguProperties IsIgnoreControlCharacters IsIgnoreControlCharacters
3 LinguProps com::sun::star::linguistic2::LinguProperties IsSpellUpperCase IsSpellUpperCase

View file

@ -24,7 +24,6 @@ import lib.MultiPropertyTest;
* Testing <code>com.sun.star.linguistic2.LinguProperties</code>
* service properties:
* <ul>
* <li><code>'IsGermanPreReform'</code></li>
* <li><code>'IsUseDictionaryList'</code></li>
* <li><code>'IsIgnoreControlCharacters'</code></li>
* <li><code>'IsSpellUpperCase'</code></li>

View file

@ -24,9 +24,7 @@ import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
/**
@ -77,10 +75,6 @@ public class Hyphenator extends TestCase {
XMultiServiceFactory xMSF = Param.getMSF();
XInterface oObj = (XInterface)xMSF.createInstance
("com.sun.star.linguistic2.Hyphenator");
Object LP = xMSF.createInstance
("com.sun.star.linguistic2.LinguProperties");
XPropertySet LProps = UnoRuntime.queryInterface(XPropertySet.class,LP);
LProps.setPropertyValue("IsGermanPreReform",Boolean.TRUE);
String Iname = util.utils.getImplName(oObj);
log.println("Implementation Name: "+Iname);