Example #1
0
// static
void LLFloaterProperties::onClickCopy(void* user_data)
{
	LLFloaterProperties* floaterp = (LLFloaterProperties*)user_data;
	if(floaterp)
	{
		LLViewerInventoryItem* item = (LLViewerInventoryItem*)floaterp->findItem();
		if(item)
		{
			std::string str(floaterp->childGetValue("item_text").asString());
			std::string::size_type pos;
			while((pos = str.find("    ")) != std::string::npos)
			{
				str.replace(pos, 4, "\t");
			}

			std::istringstream strm(str);
			LLViewerInventoryItem* temp = new LLViewerInventoryItem();
			temp->importLegacyStream(strm);
			std::ostringstream strm2;
			temp->exportLegacyStream(strm2, TRUE);
			LLWString wstr(utf8str_to_wstring(strm2.str()));

			gClipboard.copyFromSubstring(wstr, 0, wstr.length());

			//delete temp;
		}
	}
}