diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llimage/llimagedimensionsinfo.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llfloatermap.cpp | 33 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llnetmap.h | 2 |
4 files changed, 62 insertions, 6 deletions
diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp index 5ea4a236b5..835664c60f 100644 --- a/indra/llimage/llimagedimensionsinfo.cpp +++ b/indra/llimage/llimagedimensionsinfo.cpp @@ -30,6 +30,9 @@ #include "llimagedimensionsinfo.h" +// Value is true if one of Libjpeg's functions has encountered an error while working. +static bool sJpegErrorEncountered = false; + bool LLImageDimensionsInfo::load(const std::string& src_filename,U32 codec) { clean(); @@ -101,9 +104,17 @@ bool LLImageDimensionsInfo::getImageDimensionsPng() return true; } +// Called instead of exit() if Libjpeg encounters an error. +void on_jpeg_error(j_common_ptr cinfo) +{ + (void) cinfo; + sJpegErrorEncountered = true; + llwarns << "Libjpeg has encountered an error!" << llendl; +} bool LLImageDimensionsInfo::getImageDimensionsJpeg() { + sJpegErrorEncountered = false; clean(); FILE *fp = fopen (mSrcFilename.c_str(), "rb"); if (fp == NULL) @@ -115,6 +126,9 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg() jpeg_error_mgr jerr; jpeg_decompress_struct cinfo; cinfo.err = jpeg_std_error(&jerr); + // Call our function instead of exit() if Libjpeg encounters an error. + // This is done to avoid crash in this case (STORM-472). + cinfo.err->error_exit = on_jpeg_error; jpeg_create_decompress (&cinfo); jpeg_stdio_src (&cinfo, fp); @@ -128,6 +142,6 @@ bool LLImageDimensionsInfo::getImageDimensionsJpeg() jpeg_destroy_decompress(&cinfo); fclose(fp); - return true; + return !sJpegErrorEncountered; } diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index a1d291fea6..351b9ac5da 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -43,6 +43,8 @@ #include "lldraghandle.h" #include "lltextbox.h" #include "llviewermenu.h" +#include "llfloaterworldmap.h" +#include "llagent.h" // // Constants @@ -122,11 +124,36 @@ BOOL LLFloaterMap::postBuild() return TRUE; } -BOOL LLFloaterMap::handleDoubleClick( S32 x, S32 y, MASK mask ) +BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask) { // If floater is minimized, minimap should be shown on doubleclick (STORM-299) - std::string floater_to_show = this->isMinimized() ? "mini_map" : "world_map"; - LLFloaterReg::showInstance(floater_to_show); + if (isMinimized()) + { + setMinimized(FALSE); + return TRUE; + } + + LLVector3d pos_global = mMap->viewPosToGlobal(x, y); + + // If we're not tracking a beacon already, double-click will set one + if (!LLTracker::isTracking(NULL)) + { + LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance(); + if (world_map) + { + world_map->trackLocation(pos_global); + } + } + + if (gSavedSettings.getBOOL("DoubleClickTeleport")) + { + // If DoubleClickTeleport is on, double clicking the minimap will teleport there + gAgent.teleportViaLocationLookAt(pos_global); + } + else + { + LLFloaterReg::showInstance("world_map"); + } return TRUE; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e672892282..5ba87423c7 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1643,17 +1643,18 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const BOOL is_agent_inventory = (model->getCategory(inv_cat->getUUID()) != NULL) && (LLToolDragAndDrop::SOURCE_AGENT == source); + const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); + const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + BOOL accept = FALSE; if (is_agent_inventory) { const LLUUID &cat_id = inv_cat->getUUID(); const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false); - const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); const BOOL move_is_into_outfit = getCategory() && (getCategory()->getPreferredType() == LLFolderType::FT_OUTFIT); - const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id); //-------------------------------------------------------------------------------- @@ -1794,6 +1795,17 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, LLUUID category_id = mUUID; accept = move_inv_category_world_to_agent(object_id, category_id, drop); } + else if (LLToolDragAndDrop::SOURCE_LIBRARY == source) + { + // Accept folders that contain complete outfits. + accept = move_is_into_current_outfit && LLAppearanceMgr::instance().getCanMakeFolderIntoOutfit(inv_cat->getUUID()); + + if (accept && drop) + { + LLAppearanceMgr::instance().wearInventoryCategory(inv_cat, true, false); + } + } + return accept; } @@ -2896,6 +2908,7 @@ static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_curr { if ((inv_item->getInventoryType() != LLInventoryType::IT_WEARABLE) && (inv_item->getInventoryType() != LLInventoryType::IT_GESTURE) && + (inv_item->getInventoryType() != LLInventoryType::IT_ATTACHMENT) && (inv_item->getInventoryType() != LLInventoryType::IT_OBJECT)) { return FALSE; diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 650bce0da4..e053b1c177 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -38,6 +38,7 @@ class LLColor4U; class LLCoordGL; class LLImageRaw; class LLViewerTexture; +class LLFloaterMap; class LLNetMap : public LLUICtrl { @@ -55,6 +56,7 @@ public: protected: LLNetMap (const Params & p); friend class LLUICtrlFactory; + friend class LLFloaterMap; public: virtual ~LLNetMap(); |