diff options
| author | Merov Linden <merov@lindenlab.com> | 2012-03-01 21:57:16 -0800 | 
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2012-03-01 21:57:16 -0800 | 
| commit | 44c66e11ccee4f8370dc9cf2a87c44e323c9c68d (patch) | |
| tree | 40ef3f9c92fb8be9c82ea83ebd1729bc7b974246 | |
| parent | f0a1b43f2270cb8424409babf5ae88233cdd8f6c (diff) | |
EXP-1841 : Use std::vector instead of LLDynamicArray in LLClipboard.
| -rw-r--r-- | indra/llui/llclipboard.cpp | 17 | ||||
| -rw-r--r-- | indra/llui/llclipboard.h | 4 | 
2 files changed, 11 insertions, 10 deletions
| diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index e0729366cc..037b9cb254 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -55,7 +55,7 @@ void LLClipboard::reset()  		mCleanupCallback();  	}  	// Clear the clipboard -	mObjects.reset(); +	mObjects.clear();  	mCutMode = false;  	mCleanupCallback = NULL;  	mString = LLWString(); @@ -83,24 +83,24 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ  		}  		if (res)  		{ -			mObjects.put(src); +			mObjects.push_back(src);  			mState++;  		}  	}  	return res;  } -bool LLClipboard::pasteFromClipboard(LLDynamicArray<LLUUID>& inv_objects) const +bool LLClipboard::pasteFromClipboard(std::vector<LLUUID>& inv_objects) const  {  	bool res = false; -	S32 count = mObjects.count(); +	S32 count = mObjects.size();  	if (count > 0)  	{  		res = true; -		inv_objects.reset(); +		inv_objects.clear();  		for (S32 i = 0; i < count; i++)  		{ -			inv_objects.put(mObjects[i]); +			inv_objects.push_back(mObjects[i]);  		}  	}  	return res; @@ -109,13 +109,14 @@ bool LLClipboard::pasteFromClipboard(LLDynamicArray<LLUUID>& inv_objects) const  // Returns true if the LL Clipboard has pasteable items in it  bool LLClipboard::hasContents() const  { -	return (mObjects.count() > 0); +	return (mObjects.size() > 0);  }  // Returns true if the input uuid is in the list of clipboard objects  bool LLClipboard::isOnClipboard(const LLUUID& object) const  { -	return (mObjects.find(object) != LLDynamicArray<LLUUID>::FAIL); +	std::vector<LLUUID>::const_iterator iter = std::find(mObjects.begin(), mObjects.end(), object); +	return (iter != mObjects.end());  }  // Copy the input string to the LL and the system clipboard diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h index e8a4f64035..50b4c7cd77 100644 --- a/indra/llui/llclipboard.h +++ b/indra/llui/llclipboard.h @@ -74,7 +74,7 @@ public:  	// Adds one object to the current list of objects on the clipboard  	bool addToClipboard(const LLUUID& src, const LLAssetType::EType type = LLAssetType::AT_NONE);  	// Gets a copy of the objects on the clipboard -	bool pasteFromClipboard(LLDynamicArray<LLUUID>& inventory_objects) const; +	bool pasteFromClipboard(std::vector<LLUUID>& inventory_objects) const;  	bool hasContents() const;										// True if the clipboard has pasteable objects  	bool isOnClipboard(const LLUUID& object) const;					// True if the input object uuid is on the clipboard @@ -83,7 +83,7 @@ public:  	void setCutMode(bool mode, cleanup_callback_t cb = NULL) { mCutMode = mode; mCleanupCallback = cb; mState++; }  private: -	LLDynamicArray<LLUUID> mObjects;	// Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat) +	std::vector<LLUUID> mObjects;	// Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat)  	LLWString mString;					// The text string. If mObjects is not empty, this string is reflecting them (UUIDs for the moment).  	bool mCutMode;						// This is a convenience flag for the viewer. Will determine if mCleanupCallback() needs to be called.  	cleanup_callback_t mCleanupCallback;// Function to call when the cut clipboard is being wiped out. Can be set to NULL (nothing done then). | 
