Creating/cloning Cell sets the proper Interior flag

c++11
Stanislav Bas 10 years ago
parent f3bb00e3d9
commit 5761ec428d

@ -8,6 +8,9 @@
#include <QSpinBox>
#include <QLabel>
#include "../../model/world/commands.hpp"
#include "../../model/world/idtree.hpp"
std::string CSVWorld::CellCreator::getId() const
{
if (mType->currentIndex()==0)
@ -20,6 +23,15 @@ std::string CSVWorld::CellCreator::getId() const
return stream.str();
}
void CSVWorld::CellCreator::configureCreateCommand(CSMWorld::CreateCommand& command) const
{
CSMWorld::IdTree *model = dynamic_cast<CSMWorld::IdTree *>(getData().getTableModel(getCollectionId()));
Q_ASSERT(model != NULL);
int parentIndex = model->findColumnIndex(CSMWorld::Columns::ColumnId_Cell);
int index = model->findNestedColumnIndex(parentIndex, CSMWorld::Columns::ColumnId_Interior);
command.addNestedValue(parentIndex, index, mType->currentIndex() == 0);
}
CSVWorld::CellCreator::CellCreator (CSMWorld::Data& data, QUndoStack& undoStack,
const CSMWorld::UniversalId& id)
: GenericCreator (data, undoStack, id)

@ -23,6 +23,9 @@ namespace CSVWorld
virtual std::string getId() const;
/// Allow subclasses to add additional data to \a command.
virtual void configureCreateCommand(CSMWorld::CreateCommand& command) const;
public:
CellCreator (CSMWorld::Data& data, QUndoStack& undoStack, const CSMWorld::UniversalId& id);

Loading…
Cancel
Save