svgtopt/SVGEngineJI/src/SvgJavaInterfaceImpl.cpp
changeset 19 df65ec4f2d28
parent 17 443d52b01c62
child 26 796196dd6e68
equal deleted inserted replaced
17:443d52b01c62 19:df65ec4f2d28
  1325                 }
  1325                 }
  1326             else
  1326             else
  1327                 {
  1327                 {
  1328                 if(lSvgAttrId == KCSS_ATTR_FONTSIZE)
  1328                 if(lSvgAttrId == KCSS_ATTR_FONTSIZE)
  1329                     {
  1329                     {
  1330                     if(lValue != KErrNotFound)
  1330                    // if(lValue != KErrNotFound)
  1331                         {
  1331                     //    {
  1332                         // font is internally considered to be a float.
  1332                         // font is internally considered to be a float.
  1333                         TReal32 lValue = GetElementFloatAttribute((CSvgElementImpl*)aElementHandle,lSvgAttrId);
  1333                         TReal32 lValue = GetElementFloatAttribute((CSvgElementImpl*)aElementHandle,lSvgAttrId);
  1334                         return short (lValue) ;
  1334                         return short (lValue) ;
  1335                         }
  1335                     //    }
  1336                     return KInvalidEnumAttribute;
  1336                     //return KInvalidEnumAttribute;
  1337                     }
  1337                     }
  1338                 TInt lResult = GetEnumAttribute((CSvgElementImpl*)aElementHandle, lSvgAttrId , lValue);
  1338                 TInt lResult = GetEnumAttribute((CSvgElementImpl*)aElementHandle, lSvgAttrId , lValue);
  1339                 if(lResult == KErrNotFound)
  1339                 if(lResult == KErrNotFound)
  1340                     {
  1340                     {
  1341                     return KInvalidEnumAttribute;
  1341                     return KInvalidEnumAttribute;
  2651 /**
  2651 /**
  2652 * This maps the Enumeration from SVG to JSR. SVG enumerated value here is string type.
  2652 * This maps the Enumeration from SVG to JSR. SVG enumerated value here is string type.
  2653 */
  2653 */
  2654 TInt CSvgJavaInterfaceImpl::SvgStringtoEnumerationMappingSVGtoJSR(const TInt aAttributeId , TPtrC16 aValue)
  2654 TInt CSvgJavaInterfaceImpl::SvgStringtoEnumerationMappingSVGtoJSR(const TInt aAttributeId , TPtrC16 aValue)
  2655 {
  2655 {
       
  2656     TInt attribVal = KErrNotFound;
       
  2657     
  2656     switch(aAttributeId)
  2658     switch(aAttributeId)
  2657     {
  2659     {
  2658     case KCSS_ATTR_FILLRULE:
  2660     case KCSS_ATTR_FILLRULE:
  2659             {
  2661             {
  2660             if(aValue == _L("evenodd"))
  2662             if(aValue == _L("evenodd"))
  2661             return FILL_RULE_EVENODD;
  2663                 attribVal = FILL_RULE_EVENODD;
  2662             if(aValue == _L("nonzero"))
  2664             else if(aValue == _L("nonzero"))
  2663             return FILL_RULE_NONZERO;
  2665                 attribVal = FILL_RULE_NONZERO;
  2664             }
  2666             }
       
  2667             break;
  2665     case KCSS_ATTR_STROKE_LINECAP:
  2668     case KCSS_ATTR_STROKE_LINECAP:
  2666             {
  2669             {
  2667             if(aValue == _L("butt"))
  2670             if(aValue == _L("butt"))
  2668             return STROKE_LINECAP_BUTT;
  2671                 attribVal = STROKE_LINECAP_BUTT;
  2669             if(aValue == _L("round"))
  2672             else if(aValue == _L("round"))
  2670             return STROKE_LINECAP_ROUND;
  2673                 attribVal = STROKE_LINECAP_ROUND;
  2671             if(aValue == _L("square"))
  2674             else if(aValue == _L("square"))
  2672             return STROKE_LINECAP_SQUARE;
  2675                 attribVal = STROKE_LINECAP_SQUARE;
  2673             }
  2676             }
  2674 
  2677             break;
  2675         case KCSS_ATTR_STROKE_LINEJOIN:
  2678     case KCSS_ATTR_STROKE_LINEJOIN:
  2676 
       
  2677             {
  2679             {
  2678             if(aValue == _L("miter"))
  2680             if(aValue == _L("miter"))
  2679             return STROKE_LINEJOIN_MITER;
  2681                 attribVal = STROKE_LINEJOIN_MITER;
  2680             if(aValue == _L("round"))
  2682             else if(aValue == _L("round"))
  2681             return STROKE_LINEJOIN_ROUND;
  2683                 attribVal = STROKE_LINEJOIN_ROUND;
  2682             if(aValue == _L("bevel"))
  2684             else if(aValue == _L("bevel"))
  2683             return STROKE_LINEJOIN_BEVEL;
  2685                 attribVal = STROKE_LINEJOIN_BEVEL;
  2684             }
  2686             }
  2685         default: return KErrNotFound;
  2687             break;
       
  2688     default: 
       
  2689         attribVal = KErrNotFound;
       
  2690     
       
  2691     return attribVal;
  2686     }
  2692     }
  2687 }
  2693 }
  2688 /**
  2694 /**
  2689 * This maps the Enumeration from SVG to JSR.
  2695 * This maps the Enumeration from SVG to JSR.
  2690 */
  2696 */