708 { |
708 { |
709 LOGGER_ENTERFN( "CCmPluginBaseEng::GetString8AttributeL" ); |
709 LOGGER_ENTERFN( "CCmPluginBaseEng::GetString8AttributeL" ); |
710 |
710 |
711 HBufC8* retVal = NULL; |
711 HBufC8* retVal = NULL; |
712 |
712 |
713 switch ( aAttribute ) |
713 TUint32 attribute = CheckForCommonAttribute( aAttribute ); |
714 { |
714 CMDBField<TDesC8>* field; |
715 default: |
715 |
716 { |
716 FindFieldL( attribute, ECmText8, (CMDBElement*&)field ); |
717 TUint32 attribute = CheckForCommonAttribute( aAttribute ); |
717 |
718 CMDBField<TDesC8>* field; |
718 if ( !field->IsNull() ) |
719 |
719 { |
720 FindFieldL( attribute, ECmText8, (CMDBElement*&)field ); |
720 retVal = field->GetL().AllocL(); |
721 |
721 } |
722 if ( !field->IsNull() ) |
722 else |
723 { |
723 { |
724 retVal = field->GetL().AllocL(); |
724 retVal = KNullDesC8().AllocL(); |
725 } |
|
726 else |
|
727 { |
|
728 retVal = KNullDesC8().AllocL(); |
|
729 } |
|
730 } |
|
731 } |
725 } |
732 |
726 |
733 return retVal; |
727 return retVal; |
734 } |
728 } |
735 |
729 |
948 EXPORT_C void CCmPluginBaseEng::SetString8AttributeL( const TUint32 aAttribute, |
942 EXPORT_C void CCmPluginBaseEng::SetString8AttributeL( const TUint32 aAttribute, |
949 const TDesC8& aValue ) |
943 const TDesC8& aValue ) |
950 { |
944 { |
951 LOGGER_ENTERFN( "CCmPluginBaseEng::SetString8AttributeL" ); |
945 LOGGER_ENTERFN( "CCmPluginBaseEng::SetString8AttributeL" ); |
952 |
946 |
953 switch ( aAttribute ) |
947 TUint32 attribute = CheckForCommonAttribute( aAttribute ); |
954 { |
948 CMDBField<TDesC8>* field; |
955 default: |
949 |
956 { |
950 TValidationFunctionL func = FindFieldL( attribute, ECmText8, (CMDBElement*&)field ); |
957 TUint32 attribute = CheckForCommonAttribute( aAttribute ); |
951 |
958 CMDBField<TDesC8>* field; |
952 if( func ) |
959 |
953 { |
960 TValidationFunctionL func = |
954 func( this, attribute, (const TAny*)&aValue ); |
961 FindFieldL( attribute, ECmText8, (CMDBElement*&)field ); |
955 } |
962 |
956 |
963 if( func ) |
957 field->SetL( aValue ); |
964 { |
|
965 func( this, attribute, (const TAny*)&aValue ); |
|
966 } |
|
967 |
|
968 field->SetL( aValue ); |
|
969 } |
|
970 } |
|
971 } |
958 } |
972 |
959 |
973 // --------------------------------------------------------------------------- |
960 // --------------------------------------------------------------------------- |
974 // CCmPluginBaseEng::RestoreAttributeL |
961 // CCmPluginBaseEng::RestoreAttributeL |
975 // --------------------------------------------------------------------------- |
962 // --------------------------------------------------------------------------- |
2781 |
2770 |
2782 iPriv->iConvTblArray->AppendL( item ); |
2771 iPriv->iConvTblArray->AppendL( item ); |
2783 } |
2772 } |
2784 |
2773 |
2785 // --------------------------------------------------------------------------- |
2774 // --------------------------------------------------------------------------- |
2786 // CCmPluginBaseEng::AddConverstionTableL |
2775 // CCmPluginBaseEng::AddCommonConversionTableL |
2787 // --------------------------------------------------------------------------- |
2776 // --------------------------------------------------------------------------- |
2788 // |
2777 // |
2789 EXPORT_C void CCmPluginBaseEng::AddCommonConversionTableL( |
2778 EXPORT_C void CCmPluginBaseEng::AddCommonConversionTableL( |
2790 const TCmCommonAttrConvArrayItem* aConvTable ) |
2779 const TCmCommonAttrConvArrayItem* aConvTable ) |
2791 { |
2780 { |
2820 EXPORT_C void CCmPluginBaseEng::RemoveCommonConversionTable( |
2809 EXPORT_C void CCmPluginBaseEng::RemoveCommonConversionTable( |
2821 const TCmCommonAttrConvArrayItem* aConvTable ) |
2810 const TCmCommonAttrConvArrayItem* aConvTable ) |
2822 { |
2811 { |
2823 LOGGER_ENTERFN( "CCmPluginBaseEng::RemoveCommonConversionTable" ); |
2812 LOGGER_ENTERFN( "CCmPluginBaseEng::RemoveCommonConversionTable" ); |
2824 |
2813 |
2825 for ( TInt i = 0; i < iPriv->iCommonConvTblArray.Count(); ++i ) |
2814 // When calling Remove(), it's safer to loop starting from end. |
|
2815 for ( TInt i = iPriv->iCommonConvTblArray.Count()-1; i >= 0; i-- ) |
2826 { |
2816 { |
2827 if ( iPriv->iCommonConvTblArray[i] == aConvTable ) |
2817 if ( iPriv->iCommonConvTblArray[i] == aConvTable ) |
2828 { |
2818 { |
2829 iPriv->iCommonConvTblArray.Remove( i ); |
2819 iPriv->iCommonConvTblArray.Remove( i ); |
2830 } |
2820 } |