[Libreoffice-commits] .: linguistic/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Sep 29 08:19:55 PDT 2011


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

New commits:
commit be26307116092a844ce97115fe7f5a2f0b2bd53d
Author: Caolán McNamara <caolanm at redhat.com>
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;
         }


More information about the Libreoffice-commits mailing list