harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp
changeset 23 33ae025ac1e8
parent 21 50bf9db68373
child 25 8e4539ab1889
child 41 2290317b9ec5
--- a/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp	Fri Apr 16 15:23:55 2010 +0300
+++ b/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp	Mon May 03 12:55:01 2010 +0300
@@ -262,6 +262,8 @@
     	{
     	CMdEObjectDef& objectDef = mdeObject.Def();
     	iPropDefs = CHarvesterOmaDrmPluginPropertyDefs::NewL( objectDef );
+    	// Prefetch max text lengt for validity checking
+    	iMaxTextLength = iPropDefs->iGenrePropertyDef->MaxTextLengthL();
     	}
     
     TTimeIntervalSeconds timeOffset = User::UTCOffset();
@@ -299,25 +301,25 @@
     		*iPropDefs->iDrmPropertyDef, &aVHD.iDrmProtected, aIsAdd );
     
     // Title (is set from URI by default)
-    if(aVHD.iTitle.Length() > 0)
+    if( aVHD.iTitle.Length() > 0 && aVHD.iTitle.Length() < iMaxTextLength )
     	{
     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
     			*iPropDefs->iTitlePropertyDef, &aVHD.iTitle, EFalse );
     	}
     // Description
-    if(aVHD.iDescription.Length() > 0)
+    if( aVHD.iDescription.Length() > 0 && aVHD.iDescription.Length() < iMaxTextLength )
     	{
     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
     			*iPropDefs->iDescriptionPropertyDef, &aVHD.iDescription, aIsAdd );
     	}   
     // Author
-    if(aVHD.iAuthor.Length() > 0)
+    if( aVHD.iAuthor.Length() > 0 && aVHD.iAuthor.Length() < iMaxTextLength )
     	{
     	CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
     			*iPropDefs->iAuthorPropertyDef, &aVHD.iAuthor, aIsAdd );
     	}
     // Genre
-    if(aVHD.iGenre.Length() > 0)
+    if( aVHD.iGenre.Length() > 0 && aVHD.iGenre.Length() < iMaxTextLength )
         {
         CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, 
                 *iPropDefs->iGenrePropertyDef, &aVHD.iGenre, aIsAdd );