Replace "sys::default" with ESM::CellId::sDefaultWorldspace

coverity_scan^2
scrawl 9 years ago
parent 96757a3b7c
commit b9b73d7b12

@ -2,6 +2,8 @@
#include <stdexcept> #include <stdexcept>
#include <components/esm/cellid.hpp>
#include "collectionbase.hpp" #include "collectionbase.hpp"
#include "columnbase.hpp" #include "columnbase.hpp"
@ -259,7 +261,7 @@ std::pair<CSMWorld::UniversalId, std::string> CSMWorld::IdTable::view (int row)
return std::make_pair (UniversalId::Type_None, ""); return std::make_pair (UniversalId::Type_None, "");
if (id[0]=='#') if (id[0]=='#')
id = "sys::default"; id = ESM::CellId::sDefaultWorldspace;
return std::make_pair (UniversalId (UniversalId::Type_Scene, id), hint); return std::make_pair (UniversalId (UniversalId::Type_Scene, id), hint);
} }

@ -303,7 +303,7 @@ void CSVWorld::RegionMap::view()
hint << cellId; hint << cellId;
} }
emit editRequest (CSMWorld::UniversalId (CSMWorld::UniversalId::Type_Scene, "sys::default"), emit editRequest (CSMWorld::UniversalId (CSMWorld::UniversalId::Type_Scene, ESM::CellId::sDefaultWorldspace),
hint.str()); hint.str());
} }

@ -38,7 +38,7 @@ CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::D
CSVRender::WorldspaceWidget* worldspaceWidget = NULL; CSVRender::WorldspaceWidget* worldspaceWidget = NULL;
widgetType whatWidget; widgetType whatWidget;
if (id.getId()=="sys::default") if (id.getId()==ESM::CellId::sDefaultWorldspace)
{ {
whatWidget = widget_Paged; whatWidget = widget_Paged;
@ -160,7 +160,7 @@ void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::UniversalId&
void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::CellSelection& selection) void CSVWorld::SceneSubView::cellSelectionChanged (const CSMWorld::CellSelection& selection)
{ {
setUniversalId(CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Scene, "sys::default")); setUniversalId(CSMWorld::UniversalId(CSMWorld::UniversalId::Type_Scene, ESM::CellId::sDefaultWorldspace));
int size = selection.getSize(); int size = selection.getSize();
std::ostringstream stream; std::ostringstream stream;

@ -322,7 +322,7 @@ namespace MWGui
{ {
ESM::CellId cellId; ESM::CellId cellId;
cellId.mPaged = !mInterior; cellId.mPaged = !mInterior;
cellId.mWorldspace = (mInterior ? mPrefix : "sys::default"); cellId.mWorldspace = (mInterior ? mPrefix : ESM::CellId::sDefaultWorldspace);
cellId.mIndex.mX = mCurX+dX; cellId.mIndex.mX = mCurX+dX;
cellId.mIndex.mY = mCurY+dY; cellId.mIndex.mY = mCurY+dY;
@ -738,7 +738,7 @@ namespace MWGui
mEditingMarker.mCell.mWorldspace = LocalMapBase::mPrefix; mEditingMarker.mCell.mWorldspace = LocalMapBase::mPrefix;
else else
{ {
mEditingMarker.mCell.mWorldspace = "sys::default"; mEditingMarker.mCell.mWorldspace = ESM::CellId::sDefaultWorldspace;
mEditingMarker.mCell.mIndex.mX = x; mEditingMarker.mCell.mIndex.mX = x;
mEditingMarker.mCell.mIndex.mY = y; mEditingMarker.mCell.mIndex.mY = y;
} }
@ -848,7 +848,7 @@ namespace MWGui
ESM::CellId cellId; ESM::CellId cellId;
cellId.mIndex.mX = x; cellId.mIndex.mX = x;
cellId.mIndex.mY = y; cellId.mIndex.mY = y;
cellId.mWorldspace = "sys::default"; cellId.mWorldspace = ESM::CellId::sDefaultWorldspace;
cellId.mPaged = true; cellId.mPaged = true;
CustomMarkerCollection::RangeType markers = mCustomMarkers.getMarkers(cellId); CustomMarkerCollection::RangeType markers = mCustomMarkers.getMarkers(cellId);
std::vector<std::string> destNotes; std::vector<std::string> destNotes;

@ -105,7 +105,7 @@ MWWorld::CellStore *MWWorld::Cells::getExterior (int x, int y)
{ {
// Cell isn't predefined. Make one on the fly. // Cell isn't predefined. Make one on the fly.
ESM::Cell record; ESM::Cell record;
record.mCellId.mWorldspace = "sys::default"; record.mCellId.mWorldspace = ESM::CellId::sDefaultWorldspace;
record.mCellId.mPaged = true; record.mCellId.mPaged = true;
record.mCellId.mIndex.mX = x; record.mCellId.mIndex.mX = x;
record.mCellId.mIndex.mY = y; record.mCellId.mIndex.mY = y;

@ -972,7 +972,7 @@ namespace MWWorld
{ {
mPhysics->clearQueuedMovement(); mPhysics->clearQueuedMovement();
if (changeEvent && mCurrentWorldSpace != "sys::default") // FIXME if (changeEvent && mCurrentWorldSpace != ESM::CellId::sDefaultWorldspace)
{ {
// changed worldspace // changed worldspace
mProjectileManager->clear(); mProjectileManager->clear();

@ -3,6 +3,8 @@
#include "esmreader.hpp" #include "esmreader.hpp"
#include "esmwriter.hpp" #include "esmwriter.hpp"
const std::string ESM::CellId::sDefaultWorldspace = "sys::default";
void ESM::CellId::load (ESMReader &esm) void ESM::CellId::load (ESMReader &esm)
{ {
mWorldspace = esm.getHNString ("SPAC"); mWorldspace = esm.getHNString ("SPAC");

@ -20,6 +20,8 @@ namespace ESM
CellIndex mIndex; CellIndex mIndex;
bool mPaged; bool mPaged;
static const std::string sDefaultWorldspace;
void load (ESMReader &esm); void load (ESMReader &esm);
void save (ESMWriter &esm) const; void save (ESMWriter &esm) const;
}; };

@ -96,7 +96,7 @@ namespace ESM
if (mCellId.mPaged) if (mCellId.mPaged)
{ {
mCellId.mWorldspace = "sys::default"; mCellId.mWorldspace = ESM::CellId::sDefaultWorldspace;
mCellId.mIndex.mX = mData.mX; mCellId.mIndex.mX = mData.mX;
mCellId.mIndex.mY = mData.mY; mCellId.mIndex.mY = mData.mY;
} }

Loading…
Cancel
Save