diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-09-29 16:16:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-09-29 16:19:33 +0100 |
commit | be26307116092a844ce97115fe7f5a2f0b2bd53d (patch) | |
tree | 5250b9f89fd9426767060eb6956fc5fb77a6129f /linguistic | |
parent | 10f996efb1ab913101e1a635f6cda8087758568e (diff) |
Resolves: fdo#41128 hyphenation properties without handle ids not honoured
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/lngprophelp.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx index 41565a3f1886..8ce7b74425e4 100644 --- a/linguistic/source/lngprophelp.cxx +++ b/linguistic/source/lngprophelp.cxx @@ -687,20 +687,23 @@ void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues &rPropVals ) nResHyphMinWordLength = nHyphMinWordLength; sal_Int32 nLen = rPropVals.getLength(); + if (nLen) { const PropertyValue *pVal = rPropVals.getConstArray(); for (sal_Int32 i = 0; i < nLen; ++i) { - sal_Int16 *pnResVal = NULL; - switch (pVal[i].Handle) - { - case UPH_HYPH_MIN_LEADING : pnResVal = &nResHyphMinLeading; break; - case UPH_HYPH_MIN_TRAILING : pnResVal = &nResHyphMinTrailing; break; - case UPH_HYPH_MIN_WORD_LENGTH : pnResVal = &nResHyphMinWordLength; break; - default: - DBG_ASSERT( 0, "unknown property" ); - } + sal_Int16 *pnResVal = NULL; + + if (pVal[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_LEADING ) )) + pnResVal = &nResHyphMinLeading; + else if (pVal[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_TRAILING ) )) + pnResVal = &nResHyphMinTrailing; + else if (pVal[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UPN_HYPH_MIN_WORD_LENGTH ) )) + pnResVal = &nResHyphMinWordLength; + + DBG_ASSERT( pnResVal, "unknown property" ); + if (pnResVal) pVal[i].Value >>= *pnResVal; } |