homescreenpluginsrv/hspsdom/src/hspsdomattribute.cpp
branchRCL_3
changeset 19 502e5d91ad42
parent 0 79c6a41cd166
--- a/homescreenpluginsrv/hspsdom/src/hspsdomattribute.cpp	Fri Mar 12 15:43:54 2010 +0200
+++ b/homescreenpluginsrv/hspsdom/src/hspsdomattribute.cpp	Mon Mar 15 12:41:53 2010 +0200
@@ -35,7 +35,6 @@
     {
     }
 
-
 // -----------------------------------------------------------------------------
 // ChspsDomAttribute::ConstructL
 // Symbian 2nd phase constructor can leave.
@@ -45,6 +44,17 @@
     {
     iNameRef = iStringPool.AddStringL( aName );
     }
+
+// -----------------------------------------------------------------------------
+// ChspsDomAttribute::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void ChspsDomAttribute::ConstructL( const TInt aName )
+    {
+    iNameRef = aName;
+    }
+
 // -----------------------------------------------------------------------------
 // ChspsDomAttribute::NewL
 // Two-phased constructor.
@@ -63,6 +73,23 @@
     return self;
     }    
 
+// -----------------------------------------------------------------------------
+// ChspsDomAttribute::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C ChspsDomAttribute* ChspsDomAttribute::NewL( 
+        const TInt aName,
+        ChspsDomStringPool& aStringPool )
+    {
+    ChspsDomAttribute* self = new( ELeave ) ChspsDomAttribute( aStringPool );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL( aName );
+    CleanupStack::Pop( self );
+
+    return self;
+    } 
 
 // -----------------------------------------------------------------------------
 // ChspsDomAttribute::NewL
@@ -106,18 +133,38 @@
 // ChspsDomAttribute::CloneL
 // -----------------------------------------------------------------------------
 //
-ChspsDomAttribute* ChspsDomAttribute::CloneL( ChspsDomStringPool& aStringPool )
-    {
-    const TDesC8& name = iStringPool.String( iNameRef );
+ChspsDomAttribute* ChspsDomAttribute::CloneL( ChspsDomStringPool& aStringPool,
+                                              const TBool aFastClone )
+    {        
+    ChspsDomAttribute* clone = NULL;
     
-    ChspsDomAttribute* clone = ChspsDomAttribute::NewL( name, aStringPool );
+    if( aFastClone )
+        {
+        clone = ChspsDomAttribute::NewL( iNameRef, aStringPool );
+        }
+    else
+        {    
+        const TDesC8& name = iStringPool.String( iNameRef );
+        clone = ChspsDomAttribute::NewL( name, aStringPool );
+        }
+    
     CleanupStack::PushL( clone );
+    
     if ( iValueRef > KErrNotFound )
         {
-        const TDesC8& value = iStringPool.String( iValueRef );
-        clone->SetValueL( value );
+        if( aFastClone )
+            {
+            clone->SetValueL( iValueRef );
+            }
+        else
+            {
+            const TDesC8& value = iStringPool.String( iValueRef );
+            clone->SetValueL( value );
+            }
         }
+    
     CleanupStack::Pop( clone );    
+    
     return clone;
     
     }
@@ -169,6 +216,14 @@
     iValueRef = iStringPool.AddStringL( aValue );
     }
 
+// -----------------------------------------------------------------------------
+// ChspsDomAttribute::SetValueL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void ChspsDomAttribute::SetValueL( const TInt aValue )
+    {
+    iValueRef = aValue;
+    }
    
 // -----------------------------------------------------------------------------
 // ChspsDomAttribute::Size