summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepaneliteminfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llsidepaneliteminfo.cpp')
-rw-r--r--indra/newview/llsidepaneliteminfo.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp
index 3d4b4fb9c1..fccf745a74 100644
--- a/indra/newview/llsidepaneliteminfo.cpp
+++ b/indra/newview/llsidepaneliteminfo.cpp
@@ -56,8 +56,6 @@
#include "llviewerregion.h"
-const char* const DEFAULT_DESC = "(No Description)";
-
class PropertiesChangedCallback : public LLInventoryCallback
{
public:
@@ -130,7 +128,6 @@ LLSidepanelItemInfo::LLSidepanelItemInfo(const LLPanel::Params& p)
, mUpdatePendingId(-1)
, mIsDirty(false) /*Not ready*/
, mParentFloater(NULL)
- , mLabelItemDesc(NULL)
{
gInventory.addObserver(this);
gIdleCallbacks.addFunction(&LLSidepanelItemInfo::onIdle, (void*)this);
@@ -161,11 +158,10 @@ bool LLSidepanelItemInfo::postBuild()
mItemTypeIcon = getChild<LLIconCtrl>("item_type_icon");
mLabelOwnerName = getChild<LLTextBox>("LabelOwnerName");
mLabelCreatorName = getChild<LLTextBox>("LabelCreatorName");
- mLabelItemDesc = getChild<LLTextEditor>("LabelItemDesc");
getChild<LLLineEditor>("LabelItemName")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitName,this));
- mLabelItemDesc->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this));
+ getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this));
// Thumnail edition
mChangeThumbnailBtn->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onEditThumbnail, this));
// acquired date
@@ -927,22 +923,17 @@ void LLSidepanelItemInfo::onCommitDescription()
LLViewerInventoryItem* item = findItem();
if(!item) return;
- if(!mLabelItemDesc)
- {
- return;
- }
- if (!gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE))
+ LLTextEditor* labelItemDesc = getChild<LLTextEditor>("LabelItemDesc");
+ if(!labelItemDesc)
{
return;
}
- std::string old_desc = item->getDescription();
- std::string new_desc = mLabelItemDesc->getText();
- if(old_desc != new_desc)
+ if((item->getDescription() != labelItemDesc->getText()) &&
+ (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE)))
{
- mLabelItemDesc->setSelectAllOnFocusReceived(false);
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
- new_item->setDescription(new_desc);
+ new_item->setDescription(labelItemDesc->getText());
onCommitChanges(new_item);
}
}