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