summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-02-13 15:05:44 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-02-13 15:05:44 +0000
commit1bb68d936de2657c3bce3bbe64947f043b5f7333 (patch)
tree1c2feca2edc4a64e23e6e1c13bfb16962af865af /indra/newview
parent2aab1d33e125502913075d38d126936d7c2a4a2e (diff)
parent9fee359d1baf6e0046655cb8e4afabb8774754b1 (diff)
viewer2 trunk merge.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llchiclet.h5
-rw-r--r--indra/newview/llfloatertopobjects.cpp9
-rw-r--r--indra/newview/llinventorybridge.cpp16
-rw-r--r--indra/newview/llinventorymodel.cpp21
-rw-r--r--indra/newview/llpanelface.cpp20
-rw-r--r--indra/newview/llpanellandmarkinfo.cpp32
-rw-r--r--indra/newview/llviewermenu.cpp5
-rw-r--r--indra/newview/llvovolume.cpp11
8 files changed, 78 insertions, 41 deletions
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index b006ae3420..ba17c5970e 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -1228,12 +1228,15 @@ T* LLChicletPanel::findChiclet(const LLUUID& im_session_id)
{
LLChiclet* chiclet = *it;
+ llassert(chiclet);
+ if (!chiclet) continue;
if(chiclet->getSessionId() == im_session_id)
{
T* result = dynamic_cast<T*>(chiclet);
- if(!result && chiclet)
+ if(!result)
{
llwarns << "Found chiclet but of wrong type " << llendl;
+ continue;
}
return result;
}
diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp
index c930e99bad..8ab050beaa 100644
--- a/indra/newview/llfloatertopobjects.cpp
+++ b/indra/newview/llfloatertopobjects.cpp
@@ -283,8 +283,13 @@ void LLFloaterTopObjects::updateSelectionInfo()
std::string object_id_string = object_id.asString();
childSetValue("id_editor", LLSD(object_id_string));
- childSetValue("object_name_editor", list->getFirstSelected()->getColumn(1)->getValue().asString());
- childSetValue("owner_name_editor", list->getFirstSelected()->getColumn(2)->getValue().asString());
+ LLScrollListItem* sli = list->getFirstSelected();
+ llassert(sli);
+ if (sli)
+ {
+ childSetValue("object_name_editor", sli->getColumn(1)->getValue().asString());
+ childSetValue("owner_name_editor", sli->getColumn(2)->getValue().asString());
+ }
}
// static
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index d0ef159228..7b80d00c2c 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -5176,12 +5176,18 @@ void LLInvFVBridgeAction::doAction(LLAssetType::EType asset_type,
//static
void LLInvFVBridgeAction::doAction(const LLUUID& uuid, LLInventoryModel* model)
{
- LLAssetType::EType asset_type = model->getItem(uuid)->getType();
- LLInvFVBridgeAction* action = createAction(asset_type,uuid,model);
- if(action)
+ llassert(model);
+ LLViewerInventoryItem* item = model->getItem(uuid);
+ llassert(item);
+ if (item)
{
- action->doIt();
- delete action;
+ LLAssetType::EType asset_type = item->getType();
+ LLInvFVBridgeAction* action = createAction(asset_type,uuid,model);
+ if(action)
+ {
+ action->doIt();
+ delete action;
+ }
}
}
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 7ec976604a..326f2a5577 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1937,23 +1937,26 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item)
{
//llinfos << "LLInventoryModel::addItem()" << llendl;
- // This can happen if assettype enums from llassettype.h ever change.
- // For example, there is a known backwards compatibility issue in some viewer prototypes prior to when
- // the AT_LINK enum changed from 23 to 24.
- if ((item->getType() == LLAssetType::AT_NONE)
- || LLAssetType::lookup(item->getType()) == LLAssetType::badLookup())
- {
- llwarns << "Got bad asset type for item [ name: " << item->getName() << " type: " << item->getType() << " inv-type: " << item->getInventoryType() << " ], ignoring." << llendl;
- return;
- }
+ llassert(item);
if(item)
{
+ // This can happen if assettype enums from llassettype.h ever change.
+ // For example, there is a known backwards compatibility issue in some viewer prototypes prior to when
+ // the AT_LINK enum changed from 23 to 24.
+ if ((item->getType() == LLAssetType::AT_NONE)
+ || LLAssetType::lookup(item->getType()) == LLAssetType::badLookup())
+ {
+ llwarns << "Got bad asset type for item [ name: " << item->getName() << " type: " << item->getType() << " inv-type: " << item->getInventoryType() << " ], ignoring." << llendl;
+ return;
+ }
+
// This condition means that we tried to add a link without the baseobj being in memory.
// The item will show up as a broken link.
if (item->getIsBrokenLink())
{
llinfos << "Adding broken link [ name: " << item->getName() << " itemID: " << item->getUUID() << " assetID: " << item->getAssetUUID() << " ) parent: " << item->getParentUUID() << llendl;
}
+
mItemMap[item->getUUID()] = item;
}
}
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 8c5208678e..b50c6442e1 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -265,10 +265,13 @@ void LLPanelFace::sendAlpha()
void LLPanelFace::sendGlow()
{
- LLSpinCtrl* mCtrlGlow = getChild<LLSpinCtrl>("glow");
- F32 glow = mCtrlGlow->get();
-
- LLSelectMgr::getInstance()->selectionSetGlow( glow );
+ LLSpinCtrl* mCtrlGlow = getChild<LLSpinCtrl>("glow");
+ llassert(mCtrlGlow);
+ if (mCtrlGlow)
+ {
+ F32 glow = mCtrlGlow->get();
+ LLSelectMgr::getInstance()->selectionSetGlow( glow );
+ }
}
struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
@@ -286,6 +289,9 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
LLCheckBoxCtrl* checkFlipScaleS = mPanel->getChild<LLCheckBoxCtrl>("checkbox flip s");
LLCheckBoxCtrl* checkFlipScaleT = mPanel->getChild<LLCheckBoxCtrl>("checkbox flip t");
LLComboBox* comboTexGen = mPanel->getChild<LLComboBox>("combobox texgen");
+ llassert(comboTexGen);
+ llassert(object);
+
if (ctrlTexScaleS)
{
valid = !ctrlTexScaleS->getTentative() || !checkFlipScaleS->getTentative();
@@ -296,7 +302,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
{
value = -value;
}
- if (comboTexGen->getCurrentIndex() == 1)
+ if (comboTexGen &&
+ comboTexGen->getCurrentIndex() == 1)
{
value *= 0.5f;
}
@@ -314,7 +321,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
{
value = -value;
}
- if (comboTexGen->getCurrentIndex() == 1)
+ if (comboTexGen &&
+ comboTexGen->getCurrentIndex() == 1)
{
value *= 0.5f;
}
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
index cd6c727b5c..56d52ccc65 100644
--- a/indra/newview/llpanellandmarkinfo.cpp
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -376,21 +376,31 @@ void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id)
// static
std::string LLPanelLandmarkInfo::getFullFolderName(const LLViewerInventoryCategory* cat)
{
- std::string name = cat->getName();
+ std::string name;
LLUUID parent_id;
- // translate category name, if it's right below the root
- // FIXME: it can throw notification about non existent string in strings.xml
- if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID())
+ llassert(cat);
+ if (cat)
{
- LLTrans::findString(name, "InvFolder " + name);
- }
+ name = cat->getName();
- // we don't want "My Inventory" to appear in the name
- while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID())
- {
- cat = gInventory.getCategory(parent_id);
- name = cat->getName() + "/" + name;
+ // translate category name, if it's right below the root
+ // FIXME: it can throw notification about non existent string in strings.xml
+ if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID())
+ {
+ LLTrans::findString(name, "InvFolder " + name);
+ }
+
+ // we don't want "My Inventory" to appear in the name
+ while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID())
+ {
+ cat = gInventory.getCategory(parent_id);
+ llassert(cat);
+ if (cat)
+ {
+ name = cat->getName() + "/" + name;
+ }
+ }
}
return name;
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 1ff7920bb2..c18628d6f0 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -4842,9 +4842,10 @@ class LLToolsEnableUnlink : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
+ LLViewerObject* first_editable_object = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject();
bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
- LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
- !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment();
+ first_editable_object &&
+ !first_editable_object->isAttachment();
return new_value;
}
};
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e95c7f411c..0e5a01ca2c 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3644,7 +3644,8 @@ static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry");
void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
{
llpushcallstacks ;
- if (group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY))
+ llassert(group);
+ if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY))
{
LLFastTimer tm(FTM_VOLUME_GEOM);
S32 num_mapped_veretx_buffer = LLVertexBuffer::sMappedCount ;
@@ -3703,9 +3704,9 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
}
// don't forget alpha
- if( group != NULL &&
- !group->mVertexBuffer.isNull() &&
- group->mVertexBuffer->isLocked())
+ if(group != NULL &&
+ !group->mVertexBuffer.isNull() &&
+ group->mVertexBuffer->isLocked())
{
group->mVertexBuffer->setBuffer(0);
}
@@ -3731,7 +3732,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
group->clearState(LLSpatialGroup::MESH_DIRTY | LLSpatialGroup::NEW_DRAWINFO);
}
- if (group->isState(LLSpatialGroup::NEW_DRAWINFO))
+ if (group && group->isState(LLSpatialGroup::NEW_DRAWINFO))
{
llerrs << "WTF?" << llendl;
}