summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llcolorswatch.cpp7
-rw-r--r--indra/newview/llcolorswatch.h2
-rw-r--r--indra/newview/llfloatercolorpicker.cpp10
-rw-r--r--indra/newview/llfloatercolorpicker.h1
-rw-r--r--indra/newview/llinventorypanel.cpp9
-rw-r--r--indra/newview/llpanelobjectinventory.cpp3
6 files changed, 11 insertions, 21 deletions
diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp
index b2399d238b..dc6847f236 100644
--- a/indra/newview/llcolorswatch.cpp
+++ b/indra/newview/llcolorswatch.cpp
@@ -306,13 +306,16 @@ void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op )
}
}
-void LLColorSwatchCtrl::onFloaterClose()
+// This is called when the main floatercustomize panel is closed.
+// Since this class has pointers up to its parents, we need to cleanup
+// this class first in order to avoid a crash.
+void LLColorSwatchCtrl::onParentFloaterClosed()
{
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get();
-
if (pickerp)
{
pickerp->setSwatch(NULL);
+ pickerp->closeFloater();
}
mPickerHandle.markDead();
diff --git a/indra/newview/llcolorswatch.h b/indra/newview/llcolorswatch.h
index 2f6aec85e8..4bb7d837cb 100644
--- a/indra/newview/llcolorswatch.h
+++ b/indra/newview/llcolorswatch.h
@@ -105,7 +105,7 @@ public:
/*virtual*/ void setEnabled( BOOL enabled );
static void onColorChanged ( void* data, EColorPickOp pick_op = COLOR_CHANGE );
- void onFloaterClose();
+ void onParentFloaterClosed();
protected:
BOOL mValid;
diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp
index 56b56dc3d2..73b79d8e13 100644
--- a/indra/newview/llfloatercolorpicker.cpp
+++ b/indra/newview/llfloatercolorpicker.cpp
@@ -241,16 +241,6 @@ BOOL LLFloaterColorPicker::postBuild()
return TRUE;
}
-/*virtual*/
-void LLFloaterColorPicker::onClose(bool app_settings)
-{
- if (mSwatch)
- {
- mSwatch->onFloaterClose();
- }
- stopUsingPipette();
-}
-
//////////////////////////////////////////////////////////////////////////////
//
void LLFloaterColorPicker::initUI ( F32 rValIn, F32 gValIn, F32 bValIn )
diff --git a/indra/newview/llfloatercolorpicker.h b/indra/newview/llfloatercolorpicker.h
index b381740acd..0bbbe2051c 100644
--- a/indra/newview/llfloatercolorpicker.h
+++ b/indra/newview/llfloatercolorpicker.h
@@ -56,7 +56,6 @@ class LLFloaterColorPicker
// overrides
virtual BOOL postBuild ();
- virtual void onClose(bool app_settings);
virtual void draw ();
virtual BOOL handleMouseDown ( S32 x, S32 y, MASK mask );
virtual BOOL handleMouseUp ( S32 x, S32 y, MASK mask );
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 4cbf27b725..92b9dc427f 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -903,13 +903,10 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
if (!auto_open) return NULL;
// D. Open the inventory side panel and use that.
- LLSideTray *side_tray = LLSideTray::getInstance();
+ LLSD key;
LLSidepanelInventory *sidepanel_inventory =
- dynamic_cast<LLSidepanelInventory *>(side_tray->getPanel("sidepanel_inventory"));
-
- // Use the inventory side panel only if it is already active.
- // Activating it may unexpectedly switch off the currently active tab in some cases.
- if (sidepanel_inventory && (LLPanel*)side_tray->getActiveTab() == (LLPanel*)sidepanel_inventory)
+ dynamic_cast<LLSidepanelInventory *>(LLSideTray::getInstance()->showPanel("sidepanel_inventory", key));
+ if (sidepanel_inventory)
{
return sidepanel_inventory->getActivePanel();
}
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index 9d38dab26e..43366ef814 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -157,7 +157,7 @@ LLInventoryItem* LLTaskInvFVBridge::findItem() const
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
if(object)
{
- return (LLInventoryItem*)(object->getInventoryObject(mUUID));
+ return dynamic_cast<LLInventoryItem*>(object->getInventoryObject(mUUID));
}
return NULL;
}
@@ -712,6 +712,7 @@ public:
virtual LLUIImagePtr getIcon() const;
virtual const std::string& getDisplayName() const { return getName(); }
virtual BOOL isItemRenameable() const;
+ // virtual BOOL isItemCopyable() const { return FALSE; }
virtual BOOL renameItem(const std::string& new_name);
virtual BOOL isItemRemovable();
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);