bool GeoDataDocument::operator==( const GeoDataDocument &other ) const { if (!GeoDataContainer::equals(other)) { return false; } Q_D(const GeoDataDocument); const GeoDataDocumentPrivate* const other_d = other.d_func(); if (!(d->m_styleHash.size() == other_d->m_styleHash.size() && d->m_styleMapHash == other_d->m_styleMapHash && d->m_schemaHash == other_d->m_schemaHash && d->m_filename == other_d->m_filename && d->m_baseUri == other_d->m_baseUri && d->m_networkLinkControl == other_d->m_networkLinkControl && d->m_property == other_d->m_property && d->m_documentRole == other_d->m_documentRole)) { return false; } auto iter = d->m_styleHash.constBegin(); auto const end = d->m_styleHash.constEnd(); for (; iter != end; ++iter) { if (!other_d->m_styleHash.contains(iter.key())) { return false; } if (*iter.value() != *other_d->m_styleHash[iter.key()]) { return false; } } return true; }
GeoDataDocument::GeoDataDocument( const GeoDataDocument& other ) : GeoDocument(), GeoDataContainer(other, new GeoDataDocumentPrivate(*other.d_func())) { }