void FloatingObjects::remove(FloatingObject* toBeRemoved) { decreaseObjectsCount(toBeRemoved->getType()); std::unique_ptr<FloatingObject> floatingObject = m_set.take(toBeRemoved); ASSERT(floatingObject->isPlaced() || !floatingObject->isInPlacedTree()); if (floatingObject->isPlaced()) removePlacedObject(*floatingObject); markLowestFloatLogicalBottomCacheAsDirty(); ASSERT(!floatingObject->originatingLine()); }
void FloatingObjects::remove(FloatingObject* floatingObject) { ASSERT((m_set.contains<FloatingObject&, FloatingObjectHashTranslator>(*floatingObject))); decreaseObjectsCount(floatingObject->type()); ASSERT(floatingObject->isPlaced() || !floatingObject->isInPlacedTree()); if (floatingObject->isPlaced()) removePlacedObject(floatingObject); ASSERT(!floatingObject->originatingLine()); auto it = m_set.find<FloatingObject&, FloatingObjectHashTranslator>(*floatingObject); if (it == m_set.end()) return; m_set.remove(it); }