Changeset 2268

Show
Ignore:
Timestamp:
03/04/10 08:42:11 (5 months ago)
Author:
JO94
Message:

stopped recreation of wrapped objects in KML containers

Location:
FalconView/trunk/public/fvw_core/GeodataDataSources
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • FalconView/trunk/public/fvw_core/GeodataDataSources/LibkmlContainerBase.cpp

    r2267 r2268  
    5959      bNeedToFireDataSourceChanged = true; // stops firing once all regions have been loaded 
    6060 
    61       IUnknownPtr unk = CLibkmlDataSource::WrapKMLElement(feature, m_kml_file, m_rootDS); 
    62       if (unk) // may return NULL for unsupported elements 
    63          unk->Release(); // get rid of extra reference 
     61      // if we already have a COM object for this element, use it 
     62 
     63      UINT_TO_UNKNOWN_MAP::iterator it =  m_wrapped_objects.find(i); 
     64      IUnknownPtr unk; 
     65 
     66      if (it == m_wrapped_objects.end()) 
     67      { 
     68         unk = CLibkmlDataSource::WrapKMLElement(feature, m_kml_file, m_rootDS); 
     69         if (unk) // may return NULL for unsupported elements 
     70            unk->Release(); // get rid of extra reference 
     71         m_wrapped_objects[i] = unk; 
     72      } 
     73      else 
     74      { 
     75         unk = it->second; 
     76      } 
     77 
     78      // save the object in the appropriate vector(s) 
    6479 
    6580      IFvDataSourcePtr spDataSource = unk; 
  • FalconView/trunk/public/fvw_core/GeodataDataSources/LibkmlContainerBase.h

    r2267 r2268  
    137137   IFilterPtr m_filter; // the filter that currently applies to the data set 
    138138   kmldom::KmlFactory* m_factory; // NULL if not in an editing session 
     139   UINT_TO_UNKNOWN_MAP m_wrapped_objects; // a map containing objects already wrapped 
    139140 
    140141   void PopulateIndiciesAsNecessary(); 
  • FalconView/trunk/public/fvw_core/GeodataDataSources/stdafx.h

    r2133 r2268  
    6868typedef std::map<std::string, _variant_t, std::less<std::string>> STRING_TO_VARIANT_MAP; 
    6969typedef std::map<ULONG, PCHAR> ULONG_TO_PCHAR_MAP; 
     70typedef std::map<UINT, IUnknownPtr> UINT_TO_UNKNOWN_MAP; 
    7071 
    7172#include <vector>