diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-02-21 21:05:14 +0100 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-02-21 23:14:31 +0200 |
commit | 60d3dd98a44230c21803c1606552ee098ed9fa7c (patch) | |
tree | af0aa11c458ca86f786560e0875f7e018e1a16b9 /indra/newview/llpanelobjectinventory.cpp | |
parent | 855eea7ddf9e1de9226036ca94ccb03ac0e311b9 (diff) |
Convert remaining BOOL to bool
Diffstat (limited to 'indra/newview/llpanelobjectinventory.cpp')
-rw-r--r-- | indra/newview/llpanelobjectinventory.cpp | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 4af8f9efdc..40f2ecd064 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -123,7 +123,7 @@ public: virtual LLUIImagePtr getIcon() const; virtual void openItem(); - virtual BOOL canOpenItem() const { return FALSE; } + virtual bool canOpenItem() const { return false; } virtual void closeItem() {} virtual void selectItem() {} virtual void navigateToFolder(bool new_window = false, bool change_mode = false) {} @@ -142,8 +142,8 @@ public: virtual void pasteLinkFromClipboard(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual void performAction(LLInventoryModel* model, std::string action); - virtual BOOL isUpToDate() const { return TRUE; } - virtual bool hasChildren() const { return FALSE; } + virtual bool isUpToDate() const { return true; } + virtual bool hasChildren() const { return false; } virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; } virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; } virtual LLSettingsType::type_e getSettingsType() const { return LLSettingsType::ST_NONE; } @@ -153,7 +153,7 @@ public: // LLDragAndDropBridge functionality virtual LLToolDragAndDrop::ESource getDragSource() const { return LLToolDragAndDrop::SOURCE_WORLD; } - virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const; + virtual bool startDrag(EDragAndDropType* type, LLUUID* id) const; virtual bool dragOrDrop(MASK mask, bool drop, EDragAndDropType cargo_type, void* cargo_data, @@ -236,9 +236,9 @@ const std::string& LLTaskInvFVBridge::getDisplayName() const } const LLPermissions& perm(item->getPermissions()); - BOOL copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); - BOOL mod = gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE); - BOOL xfer = gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE); + bool copy = gAgent.allowOperation(PERM_COPY, perm, GP_OBJECT_MANIPULATE); + bool mod = gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE); + bool xfer = gAgent.allowOperation(PERM_TRANSFER, perm, GP_OBJECT_MANIPULATE); if(!copy) { @@ -277,7 +277,7 @@ void LLTaskInvFVBridge::setCreationDate(time_t creation_date_utc) LLUIImagePtr LLTaskInvFVBridge::getIcon() const { - const BOOL item_is_multi = (mFlags & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS); + const bool item_is_multi = (mFlags & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS); return LLInventoryIcon::getIcon(mAssetType, mInventoryType, 0, item_is_multi ); } @@ -473,7 +473,7 @@ void LLTaskInvFVBridge::pasteLinkFromClipboard() { } -BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const +bool LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const { //LL_INFOS() << "LLTaskInvFVBridge::startDrag()" << LL_ENDL; if(mPanel) @@ -493,7 +493,7 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const // due to a race condition and possible exploit where // attached objects do not update their inventory items // when their contents are manipulated - return FALSE; + return false; } if((can_copy && perm.allowTransferTo(gAgent.getID())) || object->permYouOwner()) @@ -503,12 +503,12 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const *type = LLViewerAssetType::lookupDragAndDropType(inv->getType()); *id = inv->getUUID(); - return TRUE; + return true; } } } } - return FALSE; + return false; } bool LLTaskInvFVBridge::dragOrDrop(MASK mask, bool drop, @@ -586,17 +586,17 @@ public: virtual LLUIImagePtr getIcon() const; virtual const std::string& getDisplayName() const; virtual bool isItemRenameable() const; - // virtual BOOL isItemCopyable() const { return FALSE; } + // virtual bool isItemCopyable() const { return false; } virtual bool renameItem(const std::string& new_name); virtual bool isItemRemovable() const; virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual bool hasChildren() const; - virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const; + virtual bool startDrag(EDragAndDropType* type, LLUUID* id) const; virtual bool dragOrDrop(MASK mask, bool drop, EDragAndDropType cargo_type, void* cargo_data, std::string& tooltip_msg); - virtual BOOL canOpenItem() const { return TRUE; } + virtual bool canOpenItem() const { return true; } virtual void openItem(); virtual EInventorySortGroup getSortGroup() const { return SG_NORMAL_FOLDER; } }; @@ -662,8 +662,8 @@ void LLTaskCategoryBridge::buildContextMenu(LLMenuGL& menu, U32 flags) bool LLTaskCategoryBridge::hasChildren() const { - // return TRUE if we have or do know know if we have children. - // *FIX: For now, return FALSE - we will know for sure soon enough. + // return true if we have or do know know if we have children. + // *FIX: For now, return false - we will know for sure soon enough. return false; } @@ -671,7 +671,7 @@ void LLTaskCategoryBridge::openItem() { } -BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const +bool LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const { //LL_INFOS() << "LLTaskInvFVBridge::startDrag()" << LL_ENDL; if(mPanel && mUUID.notNull()) @@ -680,15 +680,15 @@ BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const if(object) { const LLInventoryObject* cat = object->getInventoryObject(mUUID); - if ( (cat) && (move_inv_category_world_to_agent(mUUID, LLUUID::null, FALSE)) ) + if ( (cat) && (move_inv_category_world_to_agent(mUUID, LLUUID::null, false)) ) { *type = LLViewerAssetType::lookupDragAndDropType(cat->getType()); *id = mUUID; - return TRUE; + return true; } } } - return FALSE; + return false; } bool LLTaskCategoryBridge::dragOrDrop(MASK mask, bool drop, @@ -746,7 +746,7 @@ bool LLTaskCategoryBridge::dragOrDrop(MASK mask, bool drop, LLViewerInventoryItem* item = (LLViewerInventoryItem*)cargo_data; // rez in the script active by default, rez in // inactive if the control key is being held down. - BOOL active = ((mask & MASK_CONTROL) == 0); + bool active = ((mask & MASK_CONTROL) == 0); LLToolDragAndDrop::dropScript(object, item, active, LLToolDragAndDrop::getInstance()->getSource(), LLToolDragAndDrop::getInstance()->getSourceID()); @@ -771,7 +771,7 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } + virtual bool canOpenItem() const { return true; } virtual void openItem(); }; @@ -803,7 +803,7 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } + virtual bool canOpenItem() const { return true; } virtual void openItem(); virtual void performAction(LLInventoryModel* model, std::string action); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); @@ -932,7 +932,7 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - //static BOOL enableIfCopyable( void* userdata ); + //static bool enableIfCopyable( void* userdata ); }; class LLTaskLSLBridge : public LLTaskScriptBridge @@ -943,7 +943,7 @@ public: const std::string& name) : LLTaskScriptBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } + virtual bool canOpenItem() const { return true; } virtual void openItem(); virtual bool removeItem(); //virtual void buildContextMenu(LLMenuGL& menu); @@ -1008,7 +1008,7 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } + virtual bool canOpenItem() const { return true; } virtual void openItem(); virtual bool removeItem(); }; @@ -1023,7 +1023,7 @@ void LLTaskNotecardBridge::openItem() // Note: even if we are not allowed to modify copyable notecard, we should be able to view it LLInventoryItem *item = dynamic_cast<LLInventoryItem*>(object->getInventoryObject(mUUID)); - BOOL item_copy = item && gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE); + bool item_copy = item && gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE); if( item_copy || object->permModify() || gAgent.isGodlike()) @@ -1057,7 +1057,7 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } + virtual bool canOpenItem() const { return true; } virtual void openItem(); virtual bool removeItem(); }; @@ -1091,7 +1091,7 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - virtual BOOL canOpenItem() const { return TRUE; } + virtual bool canOpenItem() const { return true; } virtual void openItem(); virtual bool removeItem(); }; @@ -1135,7 +1135,7 @@ public: LLUIImagePtr LLTaskWearableBridge::getIcon() const { - return LLInventoryIcon::getIcon(mAssetType, mInventoryType, mFlags, FALSE ); + return LLInventoryIcon::getIcon(mAssetType, mInventoryType, mFlags, false ); } ///---------------------------------------------------------------------------- @@ -1157,7 +1157,7 @@ public: LLUIImagePtr LLTaskSettingsBridge::getIcon() const { - return LLInventoryIcon::getIcon(mAssetType, mInventoryType, mFlags, FALSE); + return LLInventoryIcon::getIcon(mAssetType, mInventoryType, mFlags, false); } LLSettingsType::type_e LLTaskSettingsBridge::getSettingsType() const @@ -1177,7 +1177,7 @@ public: const std::string& name) : LLTaskInvFVBridge(panel, uuid, name) {} - BOOL canOpenItem() const override { return TRUE; } + bool canOpenItem() const override { return true; } void openItem() override; bool removeItem() override; }; @@ -1192,7 +1192,7 @@ void LLTaskMaterialBridge::openItem() // Note: even if we are not allowed to modify copyable notecard, we should be able to view it LLInventoryItem *item = dynamic_cast<LLInventoryItem*>(object->getInventoryObject(mUUID)); - BOOL item_copy = item && gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE); + bool item_copy = item && gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE); if( item_copy || object->permModify() || gAgent.isGodlike()) @@ -1205,7 +1205,7 @@ void LLTaskMaterialBridge::openItem() { mat->setObjectID(mPanel->getTaskUUID()); mat->openFloater(floater_key); - mat->setFocus(TRUE); + mat->setFocus(true); } } } @@ -1333,9 +1333,9 @@ LLPanelObjectInventory::LLPanelObjectInventory(const LLPanelObjectInventory::Par LLPanel(p), mScroller(NULL), mFolders(NULL), - mHaveInventory(FALSE), - mIsInventoryEmpty(TRUE), - mInventoryNeedsUpdate(FALSE), + mHaveInventory(false), + mIsInventoryEmpty(true), + mInventoryNeedsUpdate(false), mInventoryViewModel(p.name), mShowRootFolder(p.show_root_folder) { @@ -1377,8 +1377,8 @@ void LLPanelObjectInventory::doToSelected(const LLSD& userdata) void LLPanelObjectInventory::clearContents() { - mHaveInventory = FALSE; - mIsInventoryEmpty = TRUE; + mHaveInventory = false; + mIsInventoryEmpty = true; if (LLToolDragAndDrop::getInstance() && LLToolDragAndDrop::getInstance()->getSource() == LLToolDragAndDrop::SOURCE_WORLD) { LLToolDragAndDrop::getInstance()->endDrag(); @@ -1457,7 +1457,7 @@ void LLPanelObjectInventory::inventoryChanged(LLViewerObject* object, // << " task UUID: " << object->mID << LL_ENDL; if(mTaskUUID == object->mID) { - mInventoryNeedsUpdate = TRUE; + mInventoryNeedsUpdate = true; } } @@ -1469,7 +1469,7 @@ void LLPanelObjectInventory::updateInventory() // We're still interested in this task's inventory. std::vector<LLUUID> selected_item_ids; std::set<LLFolderViewItem*> selected_items; - BOOL inventory_has_focus = FALSE; + bool inventory_has_focus = false; if (mHaveInventory && mFolders) { selected_items = mFolders->getSelectionList(); @@ -1492,14 +1492,14 @@ void LLPanelObjectInventory::updateInventory() if (inventory_root) { reset(); - mIsInventoryEmpty = FALSE; + mIsInventoryEmpty = false; createFolderViews(inventory_root, contents); - mFolders->setEnabled(TRUE); + mFolders->setEnabled(true); } else { // TODO: create an empty inventory - mIsInventoryEmpty = TRUE; + mIsInventoryEmpty = true; } mHaveInventory = !mIsInventoryEmpty || !objectp->isInventoryDirty(); @@ -1514,8 +1514,8 @@ void LLPanelObjectInventory::updateInventory() else { // TODO: create an empty inventory - mIsInventoryEmpty = TRUE; - mHaveInventory = TRUE; + mIsInventoryEmpty = true; + mHaveInventory = true; } // restore previous selection @@ -1530,12 +1530,12 @@ void LLPanelObjectInventory::updateInventory() //HACK: "set" first item then "change" each other one to get keyboard focus right if (first_item) { - mFolders->setSelection(selected_item, TRUE, inventory_has_focus); - first_item = FALSE; + mFolders->setSelection(selected_item, true, inventory_has_focus); + first_item = false; } else { - mFolders->changeSelection(selected_item, TRUE); + mFolders->changeSelection(selected_item, true); } } } @@ -1544,7 +1544,7 @@ void LLPanelObjectInventory::updateInventory() { mFolders->requestArrange(); } - mInventoryNeedsUpdate = FALSE; + mInventoryNeedsUpdate = false; // Edit menu handler is set in onFocusReceived } @@ -1665,8 +1665,8 @@ void LLPanelObjectInventory::createViewsForCategory(LLInventoryObject::object_li void LLPanelObjectInventory::refresh() { //LL_INFOS() << "LLPanelObjectInventory::refresh()" << LL_ENDL; - BOOL has_inventory = FALSE; - const BOOL non_root_ok = TRUE; + bool has_inventory = false; + const bool non_root_ok = true; LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); LLSelectNode* node = selection->getFirstRootNode(NULL, non_root_ok); if(node && node->mValid) @@ -1677,7 +1677,7 @@ void LLPanelObjectInventory::refresh() { // determine if we need to make a request. Start with a // default based on if we have inventory at all. - BOOL make_request = !mHaveInventory; + bool make_request = !mHaveInventory; // If the task id is different than what we've stored, // then make the request. @@ -1685,7 +1685,7 @@ void LLPanelObjectInventory::refresh() { mTaskUUID = object->mID; mAttachmentUUID = object->getAttachmentItemID(); - make_request = TRUE; + make_request = true; // This is a new object so pre-emptively clear the contents // Otherwise we show the old stuff until the update comes in @@ -1711,7 +1711,7 @@ void LLPanelObjectInventory::refresh() { if(node->mInventorySerial != object->getInventorySerial() || object->isInventoryDirty()) { - make_request = TRUE; + make_request = true; } } @@ -1720,7 +1720,7 @@ void LLPanelObjectInventory::refresh() { requestVOInventory(); } - has_inventory = TRUE; + has_inventory = true; } } if(!has_inventory) @@ -1901,16 +1901,16 @@ bool LLPanelObjectInventory::handleKeyHere( KEY key, MASK mask ) return handled; } -BOOL LLPanelObjectInventory::isSelectionRemovable() +bool LLPanelObjectInventory::isSelectionRemovable() { if (!mFolders || !mFolders->getRoot()) { - return FALSE; + return false; } std::set<LLFolderViewItem*> selection_set = mFolders->getRoot()->getSelectionList(); if (selection_set.empty()) { - return FALSE; + return false; } for (std::set<LLFolderViewItem*>::iterator iter = selection_set.begin(); iter != selection_set.end(); @@ -1920,8 +1920,8 @@ BOOL LLPanelObjectInventory::isSelectionRemovable() const LLFolderViewModelItemInventory *listener = dynamic_cast<const LLFolderViewModelItemInventory*>(item->getViewModelItem()); if (!listener || !listener->isItemRemovable() || listener->isItemInTrash()) { - return FALSE; + return false; } } - return TRUE; + return true; } |