webengine/osswebengine/WebCore/dom/StyledElement.cpp
changeset 10 a359256acfc6
parent 5 10e98eab6f85
child 48 79859ed3eea9
equal deleted inserted replaced
5:10e98eab6f85 10:a359256acfc6
    69 typedef HashMap<MappedAttributeKeyPtr, CSSMappedAttributeDeclaration*, MappedAttributeHash, MappedAttributeKeyTraits> MappedAttributeDecls;
    69 typedef HashMap<MappedAttributeKeyPtr, CSSMappedAttributeDeclaration*, MappedAttributeHash, MappedAttributeKeyTraits> MappedAttributeDecls;
    70 typedef HashMap<MappedAttributeKeyPtr, CSSMappedAttributeDeclaration*, MappedAttributeHash, MappedAttributeKeyTraits>::iterator MappedAttributeDeclsIterator;
    70 typedef HashMap<MappedAttributeKeyPtr, CSSMappedAttributeDeclaration*, MappedAttributeHash, MappedAttributeKeyTraits>::iterator MappedAttributeDeclsIterator;
    71 
    71 
    72 static MappedAttributeDecls* mappedAttributeDecls = 0;
    72 static MappedAttributeDecls* mappedAttributeDecls = 0;
    73 
    73 
    74 struct mappedAttributeCleaner {
    74 void mappedAttributeCleaner() 
    75     ~mappedAttributeCleaner() {
    75 {
    76         if( mappedAttributeDecls ) {
    76     if( mappedAttributeDecls ) {
    77         	MappedAttributeDeclsIterator end = mappedAttributeDecls->end();
    77         MappedAttributeDeclsIterator end = mappedAttributeDecls->end();
    78 	        for (MappedAttributeDeclsIterator it = mappedAttributeDecls->begin(); it != end; ++it) 
    78 	    for (MappedAttributeDeclsIterator it = mappedAttributeDecls->begin(); it != end; ++it) 
    79 	        	{
    79 	        {
    80 	        	MappedAttributeKey* obj = (*it).first;
    80 	        MappedAttributeKey* obj = (*it).first;
    81 	        	delete obj;
    81 	        delete obj;
    82 	        	}
    82 	        }
    83 	        mappedAttributeDecls->clear();
    83 	    mappedAttributeDecls->clear();
    84             delete mappedAttributeDecls;
    84         delete mappedAttributeDecls;
    85             mappedAttributeDecls = 0;
    85         mappedAttributeDecls = 0;
    86         }
    86     }
    87     }
    87 }
    88 };
       
    89 struct mappedAttributeCleaner mappedAttribute;
       
    90 
    88 
    91 CSSMappedAttributeDeclaration* StyledElement::getMappedAttributeDecl(MappedAttributeEntry entryType, Attribute* attr)
    89 CSSMappedAttributeDeclaration* StyledElement::getMappedAttributeDecl(MappedAttributeEntry entryType, Attribute* attr)
    92 {
    90 {
    93     if (!mappedAttributeDecls)
    91     if (!mappedAttributeDecls)
    94         return 0;
    92         return 0;