Remove gcc/clang warnings.

test
cc9cii 10 years ago
parent 7561b195ab
commit dd1e4e8b69

@ -10,7 +10,7 @@ namespace CSMWorld
{ {
PathgridPointListAdapter::PathgridPointListAdapter () {} PathgridPointListAdapter::PathgridPointListAdapter () {}
void PathgridPointListAdapter::addNestedRow(Record<Pathgrid>& record, int position) const void PathgridPointListAdapter::addRow(Record<Pathgrid>& record, int position) const
{ {
Pathgrid pathgrid = record.get(); Pathgrid pathgrid = record.get();
@ -43,7 +43,7 @@ namespace CSMWorld
record.setModified (pathgrid); record.setModified (pathgrid);
} }
void PathgridPointListAdapter::removeNestedRow(Record<Pathgrid>& record, int rowToRemove) const void PathgridPointListAdapter::removeRow(Record<Pathgrid>& record, int rowToRemove) const
{ {
Pathgrid pathgrid = record.get(); Pathgrid pathgrid = record.get();
@ -78,7 +78,7 @@ namespace CSMWorld
record.setModified (pathgrid); record.setModified (pathgrid);
} }
void PathgridPointListAdapter::setNestedTable(Record<Pathgrid>& record, void PathgridPointListAdapter::setTable(Record<Pathgrid>& record,
const NestedTableWrapperBase& nestedTable) const const NestedTableWrapperBase& nestedTable) const
{ {
Pathgrid pathgrid = record.get(); Pathgrid pathgrid = record.get();
@ -100,7 +100,7 @@ namespace CSMWorld
return new PathgridPointsWrap(record.get()); return new PathgridPointsWrap(record.get());
} }
QVariant PathgridPointListAdapter::getNestedData(const Record<Pathgrid>& record, QVariant PathgridPointListAdapter::getData(const Record<Pathgrid>& record,
int subRowIndex, int subColIndex) const int subRowIndex, int subColIndex) const
{ {
ESM::Pathgrid::Point point = record.get().mPoints[subRowIndex]; ESM::Pathgrid::Point point = record.get().mPoints[subRowIndex];
@ -114,7 +114,7 @@ namespace CSMWorld
} }
} }
void PathgridPointListAdapter::setNestedData(Record<Pathgrid>& record, void PathgridPointListAdapter::setData(Record<Pathgrid>& record,
const QVariant& value, int subRowIndex, int subColIndex) const const QVariant& value, int subRowIndex, int subColIndex) const
{ {
Pathgrid pathgrid = record.get(); Pathgrid pathgrid = record.get();
@ -133,12 +133,12 @@ namespace CSMWorld
record.setModified (pathgrid); record.setModified (pathgrid);
} }
int PathgridPointListAdapter::getNestedColumnsCount(const Record<Pathgrid>& record) const int PathgridPointListAdapter::getColumnsCount(const Record<Pathgrid>& record) const
{ {
return 4; return 4;
} }
int PathgridPointListAdapter::getNestedRowsCount(const Record<Pathgrid>& record) const int PathgridPointListAdapter::getRowsCount(const Record<Pathgrid>& record) const
{ {
return static_cast<int>(record.get().mPoints.size()); return static_cast<int>(record.get().mPoints.size());
} }
@ -146,7 +146,7 @@ namespace CSMWorld
PathgridEdgeListAdapter::PathgridEdgeListAdapter () {} PathgridEdgeListAdapter::PathgridEdgeListAdapter () {}
// ToDo: seems to be auto-sorted in the dialog table display after insertion // ToDo: seems to be auto-sorted in the dialog table display after insertion
void PathgridEdgeListAdapter::addNestedRow(Record<Pathgrid>& record, int position) const void PathgridEdgeListAdapter::addRow(Record<Pathgrid>& record, int position) const
{ {
Pathgrid pathgrid = record.get(); Pathgrid pathgrid = record.get();
@ -167,7 +167,7 @@ namespace CSMWorld
record.setModified (pathgrid); record.setModified (pathgrid);
} }
void PathgridEdgeListAdapter::removeNestedRow(Record<Pathgrid>& record, int rowToRemove) const void PathgridEdgeListAdapter::removeRow(Record<Pathgrid>& record, int rowToRemove) const
{ {
Pathgrid pathgrid = record.get(); Pathgrid pathgrid = record.get();
@ -181,7 +181,7 @@ namespace CSMWorld
record.setModified (pathgrid); record.setModified (pathgrid);
} }
void PathgridEdgeListAdapter::setNestedTable(Record<Pathgrid>& record, void PathgridEdgeListAdapter::setTable(Record<Pathgrid>& record,
const NestedTableWrapperBase& nestedTable) const const NestedTableWrapperBase& nestedTable) const
{ {
Pathgrid pathgrid = record.get(); Pathgrid pathgrid = record.get();
@ -198,7 +198,7 @@ namespace CSMWorld
return new NestedTableWrapper<ESM::Pathgrid::EdgeList>(record.get().mEdges); return new NestedTableWrapper<ESM::Pathgrid::EdgeList>(record.get().mEdges);
} }
QVariant PathgridEdgeListAdapter::getNestedData(const Record<Pathgrid>& record, QVariant PathgridEdgeListAdapter::getData(const Record<Pathgrid>& record,
int subRowIndex, int subColIndex) const int subRowIndex, int subColIndex) const
{ {
Pathgrid pathgrid = record.get(); Pathgrid pathgrid = record.get();
@ -217,7 +217,7 @@ namespace CSMWorld
} }
// ToDo: detect duplicates in mEdges // ToDo: detect duplicates in mEdges
void PathgridEdgeListAdapter::setNestedData(Record<Pathgrid>& record, void PathgridEdgeListAdapter::setData(Record<Pathgrid>& record,
const QVariant& value, int subRowIndex, int subColIndex) const const QVariant& value, int subRowIndex, int subColIndex) const
{ {
Pathgrid pathgrid = record.get(); Pathgrid pathgrid = record.get();
@ -239,19 +239,19 @@ namespace CSMWorld
record.setModified (pathgrid); record.setModified (pathgrid);
} }
int PathgridEdgeListAdapter::getNestedColumnsCount(const Record<Pathgrid>& record) const int PathgridEdgeListAdapter::getColumnsCount(const Record<Pathgrid>& record) const
{ {
return 3; return 3;
} }
int PathgridEdgeListAdapter::getNestedRowsCount(const Record<Pathgrid>& record) const int PathgridEdgeListAdapter::getRowsCount(const Record<Pathgrid>& record) const
{ {
return static_cast<int>(record.get().mEdges.size()); return static_cast<int>(record.get().mEdges.size());
} }
FactionReactionsAdapter::FactionReactionsAdapter () {} FactionReactionsAdapter::FactionReactionsAdapter () {}
void FactionReactionsAdapter::addNestedRow(Record<ESM::Faction>& record, int position) const void FactionReactionsAdapter::addRow(Record<ESM::Faction>& record, int position) const
{ {
ESM::Faction faction = record.get(); ESM::Faction faction = record.get();
@ -263,7 +263,7 @@ namespace CSMWorld
record.setModified (faction); record.setModified (faction);
} }
void FactionReactionsAdapter::removeNestedRow(Record<ESM::Faction>& record, int rowToRemove) const void FactionReactionsAdapter::removeRow(Record<ESM::Faction>& record, int rowToRemove) const
{ {
ESM::Faction faction = record.get(); ESM::Faction faction = record.get();
@ -282,7 +282,7 @@ namespace CSMWorld
record.setModified (faction); record.setModified (faction);
} }
void FactionReactionsAdapter::setNestedTable(Record<ESM::Faction>& record, void FactionReactionsAdapter::setTable(Record<ESM::Faction>& record,
const NestedTableWrapperBase& nestedTable) const const NestedTableWrapperBase& nestedTable) const
{ {
ESM::Faction faction = record.get(); ESM::Faction faction = record.get();
@ -299,7 +299,7 @@ namespace CSMWorld
return new NestedTableWrapper<std::map<std::string, int> >(record.get().mReactions); return new NestedTableWrapper<std::map<std::string, int> >(record.get().mReactions);
} }
QVariant FactionReactionsAdapter::getNestedData(const Record<ESM::Faction>& record, QVariant FactionReactionsAdapter::getData(const Record<ESM::Faction>& record,
int subRowIndex, int subColIndex) const int subRowIndex, int subColIndex) const
{ {
ESM::Faction faction = record.get(); ESM::Faction faction = record.get();
@ -322,7 +322,7 @@ namespace CSMWorld
} }
} }
void FactionReactionsAdapter::setNestedData(Record<ESM::Faction>& record, void FactionReactionsAdapter::setData(Record<ESM::Faction>& record,
const QVariant& value, int subRowIndex, int subColIndex) const const QVariant& value, int subRowIndex, int subColIndex) const
{ {
ESM::Faction faction = record.get(); ESM::Faction faction = record.get();
@ -360,19 +360,19 @@ namespace CSMWorld
record.setModified (faction); record.setModified (faction);
} }
int FactionReactionsAdapter::getNestedColumnsCount(const Record<ESM::Faction>& record) const int FactionReactionsAdapter::getColumnsCount(const Record<ESM::Faction>& record) const
{ {
return 2; return 2;
} }
int FactionReactionsAdapter::getNestedRowsCount(const Record<ESM::Faction>& record) const int FactionReactionsAdapter::getRowsCount(const Record<ESM::Faction>& record) const
{ {
return static_cast<int>(record.get().mReactions.size()); return static_cast<int>(record.get().mReactions.size());
} }
RegionSoundListAdapter::RegionSoundListAdapter () {} RegionSoundListAdapter::RegionSoundListAdapter () {}
void RegionSoundListAdapter::addNestedRow(Record<ESM::Region>& record, int position) const void RegionSoundListAdapter::addRow(Record<ESM::Region>& record, int position) const
{ {
ESM::Region region = record.get(); ESM::Region region = record.get();
@ -388,7 +388,7 @@ namespace CSMWorld
record.setModified (region); record.setModified (region);
} }
void RegionSoundListAdapter::removeNestedRow(Record<ESM::Region>& record, int rowToRemove) const void RegionSoundListAdapter::removeRow(Record<ESM::Region>& record, int rowToRemove) const
{ {
ESM::Region region = record.get(); ESM::Region region = record.get();
@ -402,7 +402,7 @@ namespace CSMWorld
record.setModified (region); record.setModified (region);
} }
void RegionSoundListAdapter::setNestedTable(Record<ESM::Region>& record, void RegionSoundListAdapter::setTable(Record<ESM::Region>& record,
const NestedTableWrapperBase& nestedTable) const const NestedTableWrapperBase& nestedTable) const
{ {
ESM::Region region = record.get(); ESM::Region region = record.get();
@ -419,7 +419,7 @@ namespace CSMWorld
return new NestedTableWrapper<std::vector<ESM::Region::SoundRef> >(record.get().mSoundList); return new NestedTableWrapper<std::vector<ESM::Region::SoundRef> >(record.get().mSoundList);
} }
QVariant RegionSoundListAdapter::getNestedData(const Record<ESM::Region>& record, QVariant RegionSoundListAdapter::getData(const Record<ESM::Region>& record,
int subRowIndex, int subColIndex) const int subRowIndex, int subColIndex) const
{ {
ESM::Region region = record.get(); ESM::Region region = record.get();
@ -438,7 +438,7 @@ namespace CSMWorld
} }
} }
void RegionSoundListAdapter::setNestedData(Record<ESM::Region>& record, void RegionSoundListAdapter::setData(Record<ESM::Region>& record,
const QVariant& value, int subRowIndex, int subColIndex) const const QVariant& value, int subRowIndex, int subColIndex) const
{ {
ESM::Region region = record.get(); ESM::Region region = record.get();
@ -461,12 +461,12 @@ namespace CSMWorld
record.setModified (region); record.setModified (region);
} }
int RegionSoundListAdapter::getNestedColumnsCount(const Record<ESM::Region>& record) const int RegionSoundListAdapter::getColumnsCount(const Record<ESM::Region>& record) const
{ {
return 2; return 2;
} }
int RegionSoundListAdapter::getNestedRowsCount(const Record<ESM::Region>& record) const int RegionSoundListAdapter::getRowsCount(const Record<ESM::Region>& record) const
{ {
return static_cast<int>(record.get().mSoundList.size()); return static_cast<int>(record.get().mSoundList.size());
} }

@ -42,24 +42,24 @@ namespace CSMWorld
public: public:
PathgridPointListAdapter (); PathgridPointListAdapter ();
virtual void addNestedRow(Record<Pathgrid>& record, int position) const; virtual void addRow(Record<Pathgrid>& record, int position) const;
virtual void removeNestedRow(Record<Pathgrid>& record, int rowToRemove) const; virtual void removeRow(Record<Pathgrid>& record, int rowToRemove) const;
virtual void setNestedTable(Record<Pathgrid>& record, virtual void setTable(Record<Pathgrid>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const;
virtual NestedTableWrapperBase* nestedTable(const Record<Pathgrid>& record) const; virtual NestedTableWrapperBase* nestedTable(const Record<Pathgrid>& record) const;
virtual QVariant getNestedData(const Record<Pathgrid>& record, virtual QVariant getData(const Record<Pathgrid>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const;
virtual void setNestedData(Record<Pathgrid>& record, virtual void setData(Record<Pathgrid>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const;
virtual int getNestedColumnsCount(const Record<Pathgrid>& record) const; virtual int getColumnsCount(const Record<Pathgrid>& record) const;
virtual int getNestedRowsCount(const Record<Pathgrid>& record) const; virtual int getRowsCount(const Record<Pathgrid>& record) const;
}; };
class PathgridEdgeListAdapter : public NestedColumnAdapter<Pathgrid> class PathgridEdgeListAdapter : public NestedColumnAdapter<Pathgrid>
@ -67,24 +67,24 @@ namespace CSMWorld
public: public:
PathgridEdgeListAdapter (); PathgridEdgeListAdapter ();
virtual void addNestedRow(Record<Pathgrid>& record, int position) const; virtual void addRow(Record<Pathgrid>& record, int position) const;
virtual void removeNestedRow(Record<Pathgrid>& record, int rowToRemove) const; virtual void removeRow(Record<Pathgrid>& record, int rowToRemove) const;
virtual void setNestedTable(Record<Pathgrid>& record, virtual void setTable(Record<Pathgrid>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const;
virtual NestedTableWrapperBase* nestedTable(const Record<Pathgrid>& record) const; virtual NestedTableWrapperBase* nestedTable(const Record<Pathgrid>& record) const;
virtual QVariant getNestedData(const Record<Pathgrid>& record, virtual QVariant getData(const Record<Pathgrid>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const;
virtual void setNestedData(Record<Pathgrid>& record, virtual void setData(Record<Pathgrid>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const;
virtual int getNestedColumnsCount(const Record<Pathgrid>& record) const; virtual int getColumnsCount(const Record<Pathgrid>& record) const;
virtual int getNestedRowsCount(const Record<Pathgrid>& record) const; virtual int getRowsCount(const Record<Pathgrid>& record) const;
}; };
class FactionReactionsAdapter : public NestedColumnAdapter<ESM::Faction> class FactionReactionsAdapter : public NestedColumnAdapter<ESM::Faction>
@ -92,24 +92,24 @@ namespace CSMWorld
public: public:
FactionReactionsAdapter (); FactionReactionsAdapter ();
virtual void addNestedRow(Record<ESM::Faction>& record, int position) const; virtual void addRow(Record<ESM::Faction>& record, int position) const;
virtual void removeNestedRow(Record<ESM::Faction>& record, int rowToRemove) const; virtual void removeRow(Record<ESM::Faction>& record, int rowToRemove) const;
virtual void setNestedTable(Record<ESM::Faction>& record, virtual void setTable(Record<ESM::Faction>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const;
virtual NestedTableWrapperBase* nestedTable(const Record<ESM::Faction>& record) const; virtual NestedTableWrapperBase* nestedTable(const Record<ESM::Faction>& record) const;
virtual QVariant getNestedData(const Record<ESM::Faction>& record, virtual QVariant getData(const Record<ESM::Faction>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const;
virtual void setNestedData(Record<ESM::Faction>& record, virtual void setData(Record<ESM::Faction>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const;
virtual int getNestedColumnsCount(const Record<ESM::Faction>& record) const; virtual int getColumnsCount(const Record<ESM::Faction>& record) const;
virtual int getNestedRowsCount(const Record<ESM::Faction>& record) const; virtual int getRowsCount(const Record<ESM::Faction>& record) const;
}; };
class RegionSoundListAdapter : public NestedColumnAdapter<ESM::Region> class RegionSoundListAdapter : public NestedColumnAdapter<ESM::Region>
@ -117,24 +117,24 @@ namespace CSMWorld
public: public:
RegionSoundListAdapter (); RegionSoundListAdapter ();
virtual void addNestedRow(Record<ESM::Region>& record, int position) const; virtual void addRow(Record<ESM::Region>& record, int position) const;
virtual void removeNestedRow(Record<ESM::Region>& record, int rowToRemove) const; virtual void removeRow(Record<ESM::Region>& record, int rowToRemove) const;
virtual void setNestedTable(Record<ESM::Region>& record, virtual void setTable(Record<ESM::Region>& record,
const NestedTableWrapperBase& nestedTable) const; const NestedTableWrapperBase& nestedTable) const;
virtual NestedTableWrapperBase* nestedTable(const Record<ESM::Region>& record) const; virtual NestedTableWrapperBase* nestedTable(const Record<ESM::Region>& record) const;
virtual QVariant getNestedData(const Record<ESM::Region>& record, virtual QVariant getData(const Record<ESM::Region>& record,
int subRowIndex, int subColIndex) const; int subRowIndex, int subColIndex) const;
virtual void setNestedData(Record<ESM::Region>& record, virtual void setData(Record<ESM::Region>& record,
const QVariant& value, int subRowIndex, int subColIndex) const; const QVariant& value, int subRowIndex, int subColIndex) const;
virtual int getNestedColumnsCount(const Record<ESM::Region>& record) const; virtual int getColumnsCount(const Record<ESM::Region>& record) const;
virtual int getNestedRowsCount(const Record<ESM::Region>& record) const; virtual int getRowsCount(const Record<ESM::Region>& record) const;
}; };
template<typename ESXRecordT> template<typename ESXRecordT>
@ -143,7 +143,7 @@ namespace CSMWorld
public: public:
SpellListAdapter () {} SpellListAdapter () {}
virtual void addNestedRow(Record<ESXRecordT>& record, int position) const virtual void addRow(Record<ESXRecordT>& record, int position) const
{ {
ESXRecordT raceOrBthSgn = record.get(); ESXRecordT raceOrBthSgn = record.get();
@ -157,7 +157,7 @@ namespace CSMWorld
record.setModified (raceOrBthSgn); record.setModified (raceOrBthSgn);
} }
virtual void removeNestedRow(Record<ESXRecordT>& record, int rowToRemove) const virtual void removeRow(Record<ESXRecordT>& record, int rowToRemove) const
{ {
ESXRecordT raceOrBthSgn = record.get(); ESXRecordT raceOrBthSgn = record.get();
@ -171,7 +171,7 @@ namespace CSMWorld
record.setModified (raceOrBthSgn); record.setModified (raceOrBthSgn);
} }
virtual void setNestedTable(Record<ESXRecordT>& record, const NestedTableWrapperBase& nestedTable) const virtual void setTable(Record<ESXRecordT>& record, const NestedTableWrapperBase& nestedTable) const
{ {
ESXRecordT raceOrBthSgn = record.get(); ESXRecordT raceOrBthSgn = record.get();
@ -187,7 +187,7 @@ namespace CSMWorld
return new NestedTableWrapper<std::vector<std::string> >(record.get().mPowers.mList); return new NestedTableWrapper<std::vector<std::string> >(record.get().mPowers.mList);
} }
virtual QVariant getNestedData(const Record<ESXRecordT>& record, int subRowIndex, int subColIndex) const virtual QVariant getData(const Record<ESXRecordT>& record, int subRowIndex, int subColIndex) const
{ {
ESXRecordT raceOrBthSgn = record.get(); ESXRecordT raceOrBthSgn = record.get();
@ -204,7 +204,7 @@ namespace CSMWorld
} }
} }
virtual void setNestedData(Record<ESXRecordT>& record, const QVariant& value, virtual void setData(Record<ESXRecordT>& record, const QVariant& value,
int subRowIndex, int subColIndex) const int subRowIndex, int subColIndex) const
{ {
ESXRecordT raceOrBthSgn = record.get(); ESXRecordT raceOrBthSgn = record.get();
@ -226,12 +226,12 @@ namespace CSMWorld
record.setModified (raceOrBthSgn); record.setModified (raceOrBthSgn);
} }
virtual int getNestedColumnsCount(const Record<ESXRecordT>& record) const virtual int getColumnsCount(const Record<ESXRecordT>& record) const
{ {
return 1; return 1;
} }
virtual int getNestedRowsCount(const Record<ESXRecordT>& record) const virtual int getRowsCount(const Record<ESXRecordT>& record) const
{ {
return static_cast<int>(record.get().mPowers.mList.size()); return static_cast<int>(record.get().mPowers.mList.size());
} }
@ -243,7 +243,7 @@ namespace CSMWorld
public: public:
EffectsListAdapter () {} EffectsListAdapter () {}
virtual void addNestedRow(Record<ESXRecordT>& record, int position) const virtual void addRow(Record<ESXRecordT>& record, int position) const
{ {
ESXRecordT magic = record.get(); ESXRecordT magic = record.get();
@ -265,7 +265,7 @@ namespace CSMWorld
record.setModified (magic); record.setModified (magic);
} }
virtual void removeNestedRow(Record<ESXRecordT>& record, int rowToRemove) const virtual void removeRow(Record<ESXRecordT>& record, int rowToRemove) const
{ {
ESXRecordT magic = record.get(); ESXRecordT magic = record.get();
@ -279,7 +279,7 @@ namespace CSMWorld
record.setModified (magic); record.setModified (magic);
} }
virtual void setNestedTable(Record<ESXRecordT>& record, const NestedTableWrapperBase& nestedTable) const virtual void setTable(Record<ESXRecordT>& record, const NestedTableWrapperBase& nestedTable) const
{ {
ESXRecordT magic = record.get(); ESXRecordT magic = record.get();
@ -295,7 +295,7 @@ namespace CSMWorld
return new NestedTableWrapper<std::vector<ESM::ENAMstruct> >(record.get().mEffects.mList); return new NestedTableWrapper<std::vector<ESM::ENAMstruct> >(record.get().mEffects.mList);
} }
virtual QVariant getNestedData(const Record<ESXRecordT>& record, int subRowIndex, int subColIndex) const virtual QVariant getData(const Record<ESXRecordT>& record, int subRowIndex, int subColIndex) const
{ {
ESXRecordT magic = record.get(); ESXRecordT magic = record.get();
@ -331,7 +331,7 @@ namespace CSMWorld
} }
} }
virtual void setNestedData(Record<ESXRecordT>& record, const QVariant& value, virtual void setData(Record<ESXRecordT>& record, const QVariant& value,
int subRowIndex, int subColIndex) const int subRowIndex, int subColIndex) const
{ {
ESXRecordT magic = record.get(); ESXRecordT magic = record.get();
@ -376,12 +376,12 @@ namespace CSMWorld
record.setModified (magic); record.setModified (magic);
} }
virtual int getNestedColumnsCount(const Record<ESXRecordT>& record) const virtual int getColumnsCount(const Record<ESXRecordT>& record) const
{ {
return 8; return 8;
} }
virtual int getNestedRowsCount(const Record<ESXRecordT>& record) const virtual int getRowsCount(const Record<ESXRecordT>& record) const
{ {
return static_cast<int>(record.get().mEffects.mList.size()); return static_cast<int>(record.get().mEffects.mList.size());
} }

@ -19,21 +19,21 @@ namespace CSMWorld
virtual ~NestedColumnAdapter() {} virtual ~NestedColumnAdapter() {}
virtual void addNestedRow(Record<ESXRecordT>& record, int position) const = 0; virtual void addRow(Record<ESXRecordT>& record, int position) const = 0;
virtual void removeNestedRow(Record<ESXRecordT>& record, int rowToRemove) const = 0; virtual void removeRow(Record<ESXRecordT>& record, int rowToRemove) const = 0;
virtual void setNestedTable(Record<ESXRecordT>& record, const NestedTableWrapperBase& nestedTable) const = 0; virtual void setTable(Record<ESXRecordT>& record, const NestedTableWrapperBase& nestedTable) const = 0;
virtual NestedTableWrapperBase* nestedTable(const Record<ESXRecordT>& record) const = 0; virtual NestedTableWrapperBase* nestedTable(const Record<ESXRecordT>& record) const = 0;
virtual QVariant getNestedData(const Record<ESXRecordT>& record, int subRowIndex, int subColIndex) const = 0; virtual QVariant getData(const Record<ESXRecordT>& record, int subRowIndex, int subColIndex) const = 0;
virtual void setNestedData(Record<ESXRecordT>& record, const QVariant& value, int subRowIndex, int subColIndex) const = 0; virtual void setData(Record<ESXRecordT>& record, const QVariant& value, int subRowIndex, int subColIndex) const = 0;
virtual int getNestedColumnsCount(const Record<ESXRecordT>& record) const = 0; virtual int getColumnsCount(const Record<ESXRecordT>& record) const = 0;
virtual int getNestedRowsCount(const Record<ESXRecordT>& record) const = 0; virtual int getRowsCount(const Record<ESXRecordT>& record) const = 0;
}; };
} }

@ -93,7 +93,7 @@ namespace CSMWorld
Record<ESXRecordT> record; Record<ESXRecordT> record;
record.assign(Collection<ESXRecordT, IdAccessorT>::getRecord(row)); record.assign(Collection<ESXRecordT, IdAccessorT>::getRecord(row));
getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).addNestedRow(record, position); getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).addRow(record, position);
Collection<ESXRecordT, IdAccessorT>::setRecord(row, record); Collection<ESXRecordT, IdAccessorT>::setRecord(row, record);
} }
@ -104,7 +104,7 @@ namespace CSMWorld
Record<ESXRecordT> record; Record<ESXRecordT> record;
record.assign(Collection<ESXRecordT, IdAccessorT>::getRecord(row)); record.assign(Collection<ESXRecordT, IdAccessorT>::getRecord(row));
getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).removeNestedRow(record, subRow); getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).removeRow(record, subRow);
Collection<ESXRecordT, IdAccessorT>::setRecord(row, record); Collection<ESXRecordT, IdAccessorT>::setRecord(row, record);
} }
@ -113,7 +113,7 @@ namespace CSMWorld
QVariant NestedIdCollection<ESXRecordT, IdAccessorT>::getNestedData (int row, QVariant NestedIdCollection<ESXRecordT, IdAccessorT>::getNestedData (int row,
int column, int subRow, int subColumn) const int column, int subRow, int subColumn) const
{ {
return getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).getNestedData( return getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).getData(
Collection<ESXRecordT, IdAccessorT>::getRecord(row), subRow, subColumn); Collection<ESXRecordT, IdAccessorT>::getRecord(row), subRow, subColumn);
} }
@ -124,7 +124,7 @@ namespace CSMWorld
Record<ESXRecordT> record; Record<ESXRecordT> record;
record.assign(Collection<ESXRecordT, IdAccessorT>::getRecord(row)); record.assign(Collection<ESXRecordT, IdAccessorT>::getRecord(row));
getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).setNestedData( getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).setData(
record, data, subRow, subColumn); record, data, subRow, subColumn);
Collection<ESXRecordT, IdAccessorT>::setRecord(row, record); Collection<ESXRecordT, IdAccessorT>::setRecord(row, record);
@ -145,7 +145,7 @@ namespace CSMWorld
Record<ESXRecordT> record; Record<ESXRecordT> record;
record.assign(Collection<ESXRecordT, IdAccessorT>::getRecord(row)); record.assign(Collection<ESXRecordT, IdAccessorT>::getRecord(row));
getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).setNestedTable( getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).setTable(
record, nestedTable); record, nestedTable);
Collection<ESXRecordT, IdAccessorT>::setRecord(row, record); Collection<ESXRecordT, IdAccessorT>::setRecord(row, record);
@ -154,14 +154,14 @@ namespace CSMWorld
template<typename ESXRecordT, typename IdAccessorT> template<typename ESXRecordT, typename IdAccessorT>
int NestedIdCollection<ESXRecordT, IdAccessorT>::getNestedRowsCount(int row, int column) const int NestedIdCollection<ESXRecordT, IdAccessorT>::getNestedRowsCount(int row, int column) const
{ {
return getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).getNestedRowsCount( return getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).getRowsCount(
Collection<ESXRecordT, IdAccessorT>::getRecord(row)); Collection<ESXRecordT, IdAccessorT>::getRecord(row));
} }
template<typename ESXRecordT, typename IdAccessorT> template<typename ESXRecordT, typename IdAccessorT>
int NestedIdCollection<ESXRecordT, IdAccessorT>::getNestedColumnsCount(int row, int column) const int NestedIdCollection<ESXRecordT, IdAccessorT>::getNestedColumnsCount(int row, int column) const
{ {
return getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).getNestedColumnsCount( return getAdapter(Collection<ESXRecordT, IdAccessorT>::getColumn(column)).getColumnsCount(
Collection<ESXRecordT, IdAccessorT>::getRecord(row)); Collection<ESXRecordT, IdAccessorT>::getRecord(row));
} }

@ -867,7 +867,7 @@ namespace CSMWorld
{ {
Record<ESXRecordT>& record = Record<ESXRecordT>& record =
static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType))); static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
EffectsListAdapter<ESXRecordT>::addNestedRow(record, position); EffectsListAdapter<ESXRecordT>::addRow(record, position);
} }
using NestedRefIdAdapterBase::removeNestedRow; using NestedRefIdAdapterBase::removeNestedRow;
@ -876,7 +876,7 @@ namespace CSMWorld
{ {
Record<ESXRecordT>& record = Record<ESXRecordT>& record =
static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType))); static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
EffectsListAdapter<ESXRecordT>::removeNestedRow(record, rowToRemove); EffectsListAdapter<ESXRecordT>::removeRow(record, rowToRemove);
} }
using NestedRefIdAdapterBase::setNestedTable; using NestedRefIdAdapterBase::setNestedTable;
@ -885,7 +885,7 @@ namespace CSMWorld
{ {
Record<ESXRecordT>& record = Record<ESXRecordT>& record =
static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType))); static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
EffectsListAdapter<ESXRecordT>::setNestedTable(record, nestedTable); EffectsListAdapter<ESXRecordT>::setTable(record, nestedTable);
} }
using NestedRefIdAdapterBase::nestedTable; using NestedRefIdAdapterBase::nestedTable;
@ -903,7 +903,7 @@ namespace CSMWorld
{ {
const Record<ESXRecordT>& record = const Record<ESXRecordT>& record =
static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType))); static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
return EffectsListAdapter<ESXRecordT>::getNestedData(record, subRowIndex, subColIndex); return EffectsListAdapter<ESXRecordT>::getData(record, subRowIndex, subColIndex);
} }
using NestedRefIdAdapterBase::setNestedData; using NestedRefIdAdapterBase::setNestedData;
@ -912,14 +912,14 @@ namespace CSMWorld
{ {
Record<ESXRecordT>& record = Record<ESXRecordT>& record =
static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (row, mType))); static_cast<Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (row, mType)));
EffectsListAdapter<ESXRecordT>::setNestedData(record, value, subRowIndex, subColIndex); EffectsListAdapter<ESXRecordT>::setData(record, value, subRowIndex, subColIndex);
} }
using NestedRefIdAdapterBase::getNestedColumnsCount; using NestedRefIdAdapterBase::getNestedColumnsCount;
virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const
{ {
const Record<ESXRecordT> record; // not used, just a dummy const Record<ESXRecordT> record; // not used, just a dummy
return EffectsListAdapter<ESXRecordT>::getNestedColumnsCount(record); return EffectsListAdapter<ESXRecordT>::getColumnsCount(record);
} }
using NestedRefIdAdapterBase::getNestedRowsCount; using NestedRefIdAdapterBase::getNestedRowsCount;
@ -927,7 +927,7 @@ namespace CSMWorld
{ {
const Record<ESXRecordT>& record = const Record<ESXRecordT>& record =
static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType))); static_cast<const Record<ESXRecordT>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
return EffectsListAdapter<ESXRecordT>::getNestedRowsCount(record); return EffectsListAdapter<ESXRecordT>::getRowsCount(record);
} }
}; };
@ -1731,7 +1731,7 @@ namespace CSMWorld
{ {
case 0: case 0:
{ {
if (content.mPart >=0 && content.mPart < ESM::PRT_Count) if (content.mPart < ESM::PRT_Count)
return content.mPart; return content.mPart;
else else
throw std::runtime_error("Part Reference Type unexpected value"); throw std::runtime_error("Part Reference Type unexpected value");

Loading…
Cancel
Save