contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp
changeset 107 b34d53f6acdf
parent 102 8b8b34fa9751
child 119 50e220be30d1
equal deleted inserted replaced
106:e78d6e055a5b 107:b34d53f6acdf
   135     for( TInt i = 0; i < locCount; i++ )
   135     for( TInt i = 0; i < locCount; i++ )
   136         {
   136         {
   137         localizedName = GetLocalizedNameLC( locals[i] );
   137         localizedName = GetLocalizedNameLC( locals[i] );
   138         
   138         
   139         if( locals[i]->GetAttributeName().Compare( KColumnEnText) == 0
   139         if( locals[i]->GetAttributeName().Compare( KColumnEnText) == 0
   140                 && !localizedName->Compare(
   140                 && localizedName->Compare(
   141                     GetEntryText( entries, locals[i]->GetRowId() ) ) == 0 
   141                     GetEntryText( entries, locals[i]->GetRowId() ) ) != 0 
   142                 ||
   142                 ||
   143             locals[i]->GetAttributeName().Compare( KColumnEnDescription) == 0
   143             locals[i]->GetAttributeName().Compare( KColumnEnDescription) == 0
   144                 && !localizedName->Compare(
   144                 && localizedName->Compare(
   145                     GetEntryDescription( entries, locals[i]->GetRowId() ) ) == 0 )
   145                     GetEntryDescription( entries, locals[i]->GetRowId() ) ) != 0
       
   146                 ||
       
   147             ( locals[i]->GetAttributeName().Compare( KShortName ) == 0
       
   148                 || locals[i]->GetAttributeName().Compare( KTitleName ) == 0 )
       
   149                 && localizedName->Compare(
       
   150                     GetAttributeName( entries,
       
   151                         locals[i]->GetRowId(),
       
   152                         locals[i]->GetAttributeName() ) ) != 0 )
   146             // translations different than text
   153             // translations different than text
   147             {
   154             {
   148             locals[i]->SetLocalizedStringL( *localizedName );
   155             locals[i]->SetLocalizedStringL( *localizedName );
   149             iStorageProxy->LocalizeEntryL( *( locals[i] ) );
   156             iStorageProxy->LocalizeEntryL( *( locals[i] ) );
   150             }
   157             }
   244             return aEntries[i]->GetDescription();
   251             return aEntries[i]->GetDescription();
   245             }
   252             }
   246         }
   253         }
   247     return KNullDesC();
   254     return KNullDesC();
   248     }
   255     }
       
   256 
       
   257 // ---------------------------------------------------------------------------
       
   258 //  
       
   259 // ---------------------------------------------------------------------------
       
   260 //
       
   261 const TPtrC CCaLocalizerScannerProxy::GetAttributeName(
       
   262         const RPointerArray<CCaInnerEntry>& aEntries,
       
   263         TInt aId,
       
   264         const TDesC& aAttrName )
       
   265     {
       
   266     TBool notFound( ETrue );
       
   267     TPtrC attrValue;
       
   268     TInt entriesCount = aEntries.Count();
       
   269     for( TInt i=0; i < entriesCount && notFound; i++ )
       
   270         {
       
   271         if( aEntries[i]->GetId() == aId &&
       
   272             aEntries[i]->GetAttributes().Find(aAttrName, attrValue) )
       
   273             {
       
   274             notFound = EFalse;
       
   275             }
       
   276         }
       
   277     return attrValue;
       
   278     }