fix(HtmlParser): correctly remove an item from the space struct when requested from a callback

while here:
- implement the removing algorithm for the compact_mode
This commit is contained in:
2024-04-16 09:35:47 +02:00
parent 90915a7209
commit f02dd1093a
4 changed files with 60 additions and 16 deletions

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2008-2023, Tomasz Sowa
* Copyright (c) 2008-2024, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -2223,6 +2223,21 @@ void Space::remove(const std::wstring & field)
}
void Space::remove(ObjectType::iterator & iterator)
{
if( type == type_object )
{
if( iterator != value.value_object.end() )
{
delete iterator->second;
iterator->second = nullptr;
value.value_object.erase(iterator);
}
}
}
void Space::remove(size_t table_index)
{
if( type == type_table && table_index < value.value_table.size() )