linguistic/source/lngprophelp.cxx |   21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

New commits:
commit be26307116092a844ce97115fe7f5a2f0b2bd53d
Author: Caolán McNamara <[email protected]>
Date:   Thu Sep 29 16:16:44 2011 +0100

    Resolves: fdo#41128 hyphenation properties without handle ids not honoured

diff --git a/linguistic/source/lngprophelp.cxx 
b/linguistic/source/lngprophelp.cxx
index 41565a3..8ce7b74 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;
         }
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to