aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltooldraganddrop.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/lltooldraganddrop.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/newview/lltooldraganddrop.cpp')
-rw-r--r--linden/indra/newview/lltooldraganddrop.cpp37
1 files changed, 26 insertions, 11 deletions
diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp
index 398263f..ffa124f 100644
--- a/linden/indra/newview/lltooldraganddrop.cpp
+++ b/linden/indra/newview/lltooldraganddrop.cpp
@@ -601,6 +601,7 @@ LLToolDragAndDrop::LLToolDragAndDrop()
601 LLTool("draganddrop", NULL), 601 LLTool("draganddrop", NULL),
602 mDragStartX(0), 602 mDragStartX(0),
603 mDragStartY(0), 603 mDragStartY(0),
604 mSource(SOURCE_AGENT),
604 mCursor(UI_CURSOR_NO), 605 mCursor(UI_CURSOR_NO),
605 mLastAccept(ACCEPT_NO), 606 mLastAccept(ACCEPT_NO),
606 mDrop(FALSE), 607 mDrop(FALSE),
@@ -1203,6 +1204,8 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj,
1203 return TRUE; 1204 return TRUE;
1204 } 1205 }
1205 1206
1207 if (!item) return FALSE;
1208
1206 LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); 1209 LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
1207 if(!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID())) 1210 if(!item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID()))
1208 { 1211 {
@@ -1258,6 +1261,11 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj,
1258 LLToolDragAndDrop::ESource source, 1261 LLToolDragAndDrop::ESource source,
1259 const LLUUID& src_id) 1262 const LLUUID& src_id)
1260{ 1263{
1264 if (!item)
1265 {
1266 llwarns << "LLToolDragAndDrop::dropTextureAllFaces no texture item." << llendl;
1267 return;
1268 }
1261 LLUUID asset_id = item->getAssetUUID(); 1269 LLUUID asset_id = item->getAssetUUID();
1262 BOOL success = handleDropTextureProtections(hit_obj, item, source, src_id); 1270 BOOL success = handleDropTextureProtections(hit_obj, item, source, src_id);
1263 if(!success) 1271 if(!success)
@@ -1273,11 +1281,9 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj,
1273 // update viewer side image in anticipation of update from simulator 1281 // update viewer side image in anticipation of update from simulator
1274 hit_obj->setTEImage(face, image); 1282 hit_obj->setTEImage(face, image);
1275 dialog_refresh_all(); 1283 dialog_refresh_all();
1276
1277 // send the update to the simulator
1278 hit_obj->sendTEUpdate();
1279 } 1284 }
1280 1285 // send the update to the simulator
1286 hit_obj->sendTEUpdate();
1281} 1287}
1282 1288
1283/* 1289/*
@@ -1480,6 +1486,9 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target,
1480 // since it's coming from the library or trash, we want to not 1486 // since it's coming from the library or trash, we want to not
1481 // 'take' it back to the same place. 1487 // 'take' it back to the same place.
1482 item->setParent(LLUUID::null); 1488 item->setParent(LLUUID::null);
1489 // *TODO this code isn't working - the parent (FolderID) is still
1490 // set when the object is "taken". so code on the "take" side is
1491 // checking for trash and library as well (llviewermenu.cpp)
1483 } 1492 }
1484 if (mSource == SOURCE_NOTECARD) 1493 if (mSource == SOURCE_NOTECARD)
1485 { 1494 {
@@ -1662,7 +1671,7 @@ void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent,
1662 const S32 BUCKET_SIZE = sizeof(U8) + UUID_BYTES; 1671 const S32 BUCKET_SIZE = sizeof(U8) + UUID_BYTES;
1663 U8 bucket[BUCKET_SIZE]; 1672 U8 bucket[BUCKET_SIZE];
1664 bucket[0] = (U8)item->getType(); 1673 bucket[0] = (U8)item->getType();
1665 memcpy(&bucket[1], &(item->getUUID().mData), UUID_BYTES); 1674 memcpy(&bucket[1], &(item->getUUID().mData), UUID_BYTES); /* Flawfinder: ignore */
1666 pack_instant_message( 1675 pack_instant_message(
1667 gMessageSystem, 1676 gMessageSystem,
1668 gAgent.getID(), 1677 gAgent.getID(),
@@ -1842,26 +1851,26 @@ void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent,
1842 U8* bucket = new U8[bucket_size]; 1851 U8* bucket = new U8[bucket_size];
1843 U8* pos = bucket; 1852 U8* pos = bucket;
1844 U8 type = (U8)cat->getType(); 1853 U8 type = (U8)cat->getType();
1845 memcpy(pos, &type, sizeof(U8)); 1854 memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */
1846 pos += sizeof(U8); 1855 pos += sizeof(U8);
1847 memcpy(pos, &(cat->getUUID()), UUID_BYTES); 1856 memcpy(pos, &(cat->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
1848 pos += UUID_BYTES; 1857 pos += UUID_BYTES;
1849 S32 i; 1858 S32 i;
1850 count = cats.count(); 1859 count = cats.count();
1851 for(i = 0; i < count; ++i) 1860 for(i = 0; i < count; ++i)
1852 { 1861 {
1853 memcpy(pos, &type, sizeof(U8)); 1862 memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */
1854 pos += sizeof(U8); 1863 pos += sizeof(U8);
1855 memcpy(pos, &(cats.get(i)->getUUID()), UUID_BYTES); 1864 memcpy(pos, &(cats.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
1856 pos += UUID_BYTES; 1865 pos += UUID_BYTES;
1857 } 1866 }
1858 count = items.count(); 1867 count = items.count();
1859 for(i = 0; i < count; ++i) 1868 for(i = 0; i < count; ++i)
1860 { 1869 {
1861 type = (U8)items.get(i)->getType(); 1870 type = (U8)items.get(i)->getType();
1862 memcpy(pos, &type, sizeof(U8)); 1871 memcpy(pos, &type, sizeof(U8)); /* Flawfinder: ignore */
1863 pos += sizeof(U8); 1872 pos += sizeof(U8);
1864 memcpy(pos, &(items.get(i)->getUUID()), UUID_BYTES); 1873 memcpy(pos, &(items.get(i)->getUUID()), UUID_BYTES); /* Flawfinder: ignore */
1865 pos += UUID_BYTES; 1874 pos += UUID_BYTES;
1866 } 1875 }
1867 pack_instant_message( 1876 pack_instant_message(
@@ -2320,6 +2329,12 @@ EAcceptance LLToolDragAndDrop::dad3dTextureObject(
2320 { 2329 {
2321 return ACCEPT_NO_LOCKED; 2330 return ACCEPT_NO_LOCKED;
2322 } 2331 }
2332 //If texture !copyable don't texture or you'll never get it back.
2333 if(!item->getPermissions().allowCopyBy(gAgent.getID()))
2334 {
2335 return ACCEPT_NO;
2336 }
2337
2323 if(drop && (ACCEPT_YES_SINGLE <= rv)) 2338 if(drop && (ACCEPT_YES_SINGLE <= rv))
2324 { 2339 {
2325 if((mask & MASK_SHIFT)) 2340 if((mask & MASK_SHIFT))