// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//
void PosLmLandmarkHandler::ReadPositionL(
    RDbRowSet& aView,
    CPosLandmark& aLandmark)
    {
    if (!aView.IsColNull(EPosLmLcLatitudeCol) &&
        !aView.IsColNull(EPosLmLcLongitudeCol))
        {
        TLocality position;

        if (!aView.IsColNull(EPosLmLcAltitudeCol))
            {
            position.SetCoordinate(aView.ColReal64(EPosLmLcLatitudeCol),
                aView.ColReal64(EPosLmLcLongitudeCol),
                aView.ColReal32(EPosLmLcAltitudeCol));
            }
        else
            {
            position.SetCoordinate(aView.ColReal64(EPosLmLcLatitudeCol),
                aView.ColReal64(EPosLmLcLongitudeCol));
            }

        if (!aView.IsColNull(EPosLmLcHorizAccCol))
            {
            position.SetHorizontalAccuracy(
                aView.ColReal32(EPosLmLcHorizAccCol));
            }

        if (!aView.IsColNull(EPosLmLcVertAccCol))
            {
            position.SetVerticalAccuracy(aView.ColReal32(EPosLmLcVertAccCol));
            }

        aLandmark.SetPositionL(position);
        }
    }
// ---------------------------------------------------------------------------
// CLbtCellIdDatabase::GetLocationForCid
//
// ---------------------------------------------------------------------------
//
TInt CLbtCellIdDatabase::GetLocationForCid( TInt32 aCountryCode,
        TInt32 aNetworkID,
        TInt32 aLac,
        TInt32 aCellId,
        TLocality& aLocality )
{
    for( TInt i=0; i<iCellIdDbArray.Count(); i++ )
    {
        if( iCellIdDbArray[i].iCountryCode == aCountryCode &&
                iCellIdDbArray[i].iNetworkID == aNetworkID &&
                iCellIdDbArray[i].iLac == aLac &&
                iCellIdDbArray[i].iCellId == aCellId )
        {
            aLocality.SetCoordinate( iCellIdDbArray[i].iLocality.Latitude(),
                                     iCellIdDbArray[i].iLocality.Longitude(),
                                     iCellIdDbArray[i].iLocality.Altitude() );
            aLocality.SetHorizontalAccuracy( iCellIdDbArray[i].iLocality.HorizontalAccuracy() );

            // This entry has been used and should be deleted last compared to
            // unused entry. This is pushed to the end because we delete
            // entry from first when max cap is reached.Remove operation should be
            // performed only if append succeeds
            TInt error = iCellIdDbArray.Append( iCellIdDbArray[i] );
            if( error == KErrNone )
            {
                iCellIdDbArray.Remove( i );
            }

            return KErrNone;
        }
    }
    return KErrNotFound;
}