From be26307116092a844ce97115fe7f5a2f0b2bd53d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 29 Sep 2011 16:16:44 +0100 Subject: Resolves: fdo#41128 hyphenation properties without handle ids not honoured --- linguistic/source/lngprophelp.cxx | 21 ++++++++++++--------- 1 file 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; } -- cgit