Skip to content

Commit

Permalink
fix FS#959 - Trimming two lines which already meet causes both to dis…
Browse files Browse the repository at this point in the history
…appear after saving
  • Loading branch information
qcad committed Oct 28, 2013
1 parent 80df3c7 commit 6c8e577
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/RMemoryStorage.cpp
Expand Up @@ -891,6 +891,7 @@ bool RMemoryStorage::deleteObject(RObject::Id objectId) {
QSharedPointer<REntity> entity = queryEntityDirect(objectId);
if (!entity.isNull()) {
blockEntityMap.remove(entity->getBlockId(), entity);
//qDebug() << "deleteObject: removed " << entity->getId() << " from block " << entity->getBlockId();
}

return true;
Expand Down
1 change: 1 addition & 0 deletions src/core/RStorage.cpp
Expand Up @@ -220,6 +220,7 @@ QDebug operator<<(QDebug dbg, RStorage& s) {
continue;
}
dbg.nospace() << *b.data() << "\n";
dbg.nospace() << "block entities: " << s.queryBlockEntities(id) << "\n";
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/core/RTransaction.cpp
Expand Up @@ -583,8 +583,6 @@ bool RTransaction::addObject(QSharedPointer<RObject> object,
return false;
}

storage->removeObject(oldObject);

// iterate through all properties of the original object
// and store the property changes (if any) in this transaction:
QSet<RPropertyTypeId> propertyTypeIds;
Expand Down Expand Up @@ -644,6 +642,9 @@ bool RTransaction::addObject(QSharedPointer<RObject> object,
}

if (objectHasChanged) {
// remove old entity from storage (only if it has actually changed):
storage->removeObject(oldObject);

if (object->getDocument()!=NULL) {
// only remove from si, if not linked storage / preview
if (!storage->isInBackStorage(oldObject->getId())) {
Expand Down
3 changes: 3 additions & 0 deletions src/io/dxf/RDxfExporter.cpp
Expand Up @@ -286,7 +286,9 @@ bool RDxfExporter::exportFile(const QString& fileName, const QString& nameFilter
dw->sectionEntities();

QSet<REntity::Id> blockEntityIds = document->queryBlockEntities(document->getModelSpaceBlockId());
//qDebug() << "writing model space entities with IDs: " << blockEntityIds;
QList<REntity::Id> list = document->getStorage().orderBackToFront(blockEntityIds);
//qDebug() << "writing ordered entities with IDs: " << list;

for (int i=0; i<list.size(); i++) {
writeEntity(list[i]);
Expand Down Expand Up @@ -573,6 +575,7 @@ void RDxfExporter::writeEntity(REntity::Id id) {
*/
void RDxfExporter::writeEntity(const REntity& e) {
if (e.isUndone()) {
qDebug() << "RDxfExporter::writeEntity: entity undone...";
// never reached:
return;
}
Expand Down

0 comments on commit 6c8e577

Please sign in to comment.