@@ -810,7 +810,7 @@ void MapObjectProps::_TeamToDict(void)
810
810
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
811
811
Dict newDict;
812
812
newDict.setAsciiString (TheKey_originalOwner, AsciiString (buf));
813
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
813
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
814
814
pDoc->AddAndDoUndoable (pUndo);
815
815
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
816
816
// Update is called by Do
@@ -827,7 +827,7 @@ void MapObjectProps::_NameToDict(void)
827
827
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
828
828
Dict newDict;
829
829
newDict.setAsciiString (TheKey_objectName, cstr.GetBuffer (0 ));
830
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
830
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
831
831
pDoc->AddAndDoUndoable (pUndo);
832
832
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
833
833
// Update is called by Do
@@ -865,7 +865,7 @@ void MapObjectProps::_HealthToDict(void)
865
865
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
866
866
Dict newDict;
867
867
newDict.setInt (TheKey_objectInitialHealth, value);
868
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
868
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
869
869
pDoc->AddAndDoUndoable (pUndo);
870
870
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
871
871
// Update is called by Do
@@ -929,7 +929,7 @@ void MapObjectProps::_PrebuiltUpgradesToDict(void)
929
929
930
930
// Now, do the Undoable
931
931
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
932
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, NAMEKEY_INVALID, m_allSelectedDicts.size (), pDoc, true );
932
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, NAMEKEY_INVALID, m_allSelectedDicts.size (), pDoc, true );
933
933
pDoc->AddAndDoUndoable (pUndo);
934
934
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
935
935
}
@@ -944,7 +944,7 @@ void MapObjectProps::_EnabledToDict(void)
944
944
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
945
945
Dict newDict;
946
946
newDict.setBool (TheKey_objectEnabled, isChecked);
947
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
947
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
948
948
pDoc->AddAndDoUndoable (pUndo);
949
949
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
950
950
// Update is called by Do
@@ -961,7 +961,7 @@ void MapObjectProps::_ScriptToDict(void)
961
961
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
962
962
Dict newDict;
963
963
newDict.setAsciiString (TheKey_objectScriptAttachment, AsciiString (buf));
964
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
964
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
965
965
pDoc->AddAndDoUndoable (pUndo);
966
966
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
967
967
// Update is called by Do
@@ -977,7 +977,7 @@ void MapObjectProps::_IndestructibleToDict(void)
977
977
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
978
978
Dict newDict;
979
979
newDict.setBool (TheKey_objectIndestructible, isChecked);
980
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
980
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
981
981
pDoc->AddAndDoUndoable (pUndo);
982
982
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
983
983
// Update is called by Do
@@ -993,7 +993,7 @@ void MapObjectProps::_UnsellableToDict(void)
993
993
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
994
994
Dict newDict;
995
995
newDict.setBool (TheKey_objectUnsellable, isChecked);
996
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
996
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
997
997
pDoc->AddAndDoUndoable (pUndo);
998
998
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
999
999
// Update is called by Do
@@ -1010,7 +1010,7 @@ void MapObjectProps::_TargetableToDict()
1010
1010
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
1011
1011
Dict newDict;
1012
1012
newDict.setBool ( TheKey_objectTargetable, isChecked );
1013
- DictItemUndoable *pUndo = new DictItemUndoable ( &m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size () );
1013
+ DictItemUndoable *pUndo = new DictItemUndoable ( getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size () );
1014
1014
pDoc->AddAndDoUndoable ( pUndo );
1015
1015
REF_PTR_RELEASE ( pUndo ); // belongs to pDoc now.
1016
1016
// Update is called by Do
@@ -1027,7 +1027,7 @@ void MapObjectProps::_PoweredToDict(void)
1027
1027
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
1028
1028
Dict newDict;
1029
1029
newDict.setBool (TheKey_objectPowered, isChecked);
1030
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
1030
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
1031
1031
pDoc->AddAndDoUndoable (pUndo);
1032
1032
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1033
1033
// Update is called by Do
@@ -1058,7 +1058,7 @@ void MapObjectProps::_AggressivenessToDict(void)
1058
1058
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
1059
1059
Dict newDict;
1060
1060
newDict.setInt (TheKey_objectAggressiveness, value);
1061
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
1061
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
1062
1062
pDoc->AddAndDoUndoable (pUndo);
1063
1063
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1064
1064
// Update is called by Do
@@ -1082,7 +1082,7 @@ void MapObjectProps::_VisibilityToDict(void)
1082
1082
if (value != -1 ) {
1083
1083
newDict.setInt (TheKey_objectVisualRange, value);
1084
1084
}
1085
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, TheKey_objectVisualRange, m_allSelectedDicts.size ());
1085
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, TheKey_objectVisualRange, m_allSelectedDicts.size ());
1086
1086
pDoc->AddAndDoUndoable (pUndo);
1087
1087
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1088
1088
// Update is called by Do
@@ -1103,7 +1103,7 @@ void MapObjectProps::_VeterancyToDict(void)
1103
1103
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
1104
1104
Dict newDict;
1105
1105
newDict.setInt (TheKey_objectVeterancy, value);
1106
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
1106
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
1107
1107
pDoc->AddAndDoUndoable (pUndo);
1108
1108
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1109
1109
// Update is called by Do
@@ -1121,7 +1121,7 @@ void MapObjectProps::_WeatherToDict(void)
1121
1121
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
1122
1122
Dict newDict;
1123
1123
newDict.setInt (TheKey_objectWeather, curSel);
1124
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
1124
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
1125
1125
pDoc->AddAndDoUndoable (pUndo);
1126
1126
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1127
1127
// Update is called by Do
@@ -1139,7 +1139,7 @@ void MapObjectProps::_TimeToDict(void)
1139
1139
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
1140
1140
Dict newDict;
1141
1141
newDict.setInt (TheKey_objectTime, curSel);
1142
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
1142
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
1143
1143
pDoc->AddAndDoUndoable (pUndo);
1144
1144
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1145
1145
// Update is called by Do
@@ -1164,7 +1164,7 @@ void MapObjectProps::_ShroudClearingDistanceToDict(void)
1164
1164
if (value != -1 ) {
1165
1165
newDict.setInt (TheKey_objectShroudClearingDistance, value);
1166
1166
}
1167
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, TheKey_objectShroudClearingDistance, m_allSelectedDicts.size ());
1167
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, TheKey_objectShroudClearingDistance, m_allSelectedDicts.size ());
1168
1168
pDoc->AddAndDoUndoable (pUndo);
1169
1169
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1170
1170
// Update is called by Do
@@ -1180,7 +1180,7 @@ void MapObjectProps::_RecruitableAIToDict(void)
1180
1180
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
1181
1181
Dict newDict;
1182
1182
newDict.setBool (TheKey_objectRecruitableAI, isChecked);
1183
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
1183
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
1184
1184
pDoc->AddAndDoUndoable (pUndo);
1185
1185
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1186
1186
// Update is called by Do
@@ -1196,7 +1196,7 @@ void MapObjectProps::_SelectableToDict(void)
1196
1196
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
1197
1197
Dict newDict;
1198
1198
newDict.setBool (TheKey_objectSelectable, isChecked);
1199
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
1199
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
1200
1200
pDoc->AddAndDoUndoable (pUndo);
1201
1201
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1202
1202
// Update is called by Do
@@ -1219,7 +1219,7 @@ void MapObjectProps::_HPsToDict()
1219
1219
Dict newDict;
1220
1220
1221
1221
newDict.setInt (TheKey_objectMaxHPs, value);
1222
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
1222
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size ());
1223
1223
pDoc->AddAndDoUndoable (pUndo);
1224
1224
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1225
1225
}
@@ -1242,7 +1242,7 @@ void MapObjectProps::_StoppingDistanceToDict(void)
1242
1242
CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc ();
1243
1243
Dict newDict;
1244
1244
newDict.setReal (TheKey_objectStoppingDistance, value);
1245
- DictItemUndoable *pUndo = new DictItemUndoable (&m_allSelectedDicts. front (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
1245
+ DictItemUndoable *pUndo = new DictItemUndoable (getAllSelectedDictsData (), newDict, newDict.getNthKey (0 ), m_allSelectedDicts.size (), pDoc, true );
1246
1246
pDoc->AddAndDoUndoable (pUndo);
1247
1247
REF_PTR_RELEASE (pUndo); // belongs to pDoc now.
1248
1248
// Update is called by Do
@@ -1342,6 +1342,14 @@ void MapObjectProps::getAllSelectedDicts(void)
1342
1342
}
1343
1343
}
1344
1344
1345
+ Dict** MapObjectProps::getAllSelectedDictsData ()
1346
+ {
1347
+ #if defined(USING_STLPORT) || __cplusplus < 201103L
1348
+ return !m_allSelectedDicts.empty () ? &m_allSelectedDicts.front () : NULL ;
1349
+ #else
1350
+ return m_allSelectedDicts.data ();
1351
+ #endif
1352
+ }
1345
1353
1346
1354
void MapObjectProps::GetPopSliderInfo (const long sliderID, long *pMin, long *pMax, long *pLineSize, long *pInitial)
1347
1355
{
0 commit comments