diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llfloatersnapshot.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpreview.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewertexteditor.cpp | 58 | ||||
-rw-r--r-- | indra/newview/llviewertexteditor.h | 5 |
7 files changed, 61 insertions, 54 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 907f957bed..97f652d88d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -390,7 +390,6 @@ static const char USAGE[] = "\n" " -set <variable> <value> specify the value of a particular\n" " configuration variable that\n" " overrides all other settings\n" -" -user <user_server_ip> specify userserver in dotted quad\n" #if !LL_RELEASE_FOR_DOWNLOAD " -sim <simulator_ip> specify the simulator ip address\n" #endif @@ -658,21 +657,6 @@ int parse_args(int argc, char **argv) gGridChoice = GRID_INFO_YAMI; sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); } - else if (!strcmp(argv[j], "-user") && (++j < argc)) - { - if (!strcmp(argv[j], "-")) - { - gGridChoice = GRID_INFO_LOCAL; - snprintf(gGridName, MAX_STRING, "%s", LOOPBACK_ADDRESS_STRING); // Flawfinder: ignore - } - else - { - gGridChoice = GRID_INFO_OTHER; - ip_string.assign( argv[j] ); - LLString::trim(ip_string); - snprintf(gGridName, MAX_STRING, "%s", ip_string.c_str()); // Flawfinder: ignore - } - } else if (!strcmp(argv[j], "-loginpage") && (++j < argc)) { LLAppViewer::instance()->setLoginPage(utf8str_trim(argv[j])); @@ -1927,17 +1911,6 @@ bool LLAppViewer::initEarlyConfiguration() { sprintf(gGridName,"%s", gGridInfo[GRID_INFO_ARUNA].mName); } - else if (!strcmp(argv[j], "-user") && (++j < argc)) - { - if (!strcmp(argv[j], "-")) - { - snprintf(gGridName, MAX_STRING, "%s", LOOPBACK_ADDRESS_STRING); // Flawfinder: ignore - } - else - { - snprintf(gGridName, MAX_STRING, "%s", argv[j]); // Flawfinder: ignore - } - } else if (!strcmp(argv[j], "-multiple")) { // Hack to detect -multiple so we can disable the marker file check (which will always fail) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index da298c56c4..31c60d8b2d 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1126,7 +1126,7 @@ void LLFloaterSnapshot::Impl::onCommitResolution(LLUICtrl* ctrl, void* data) std::string sdstring = combobox->getSelectedValue(); LLSD sdres; std::stringstream sstream(sdstring); - LLSDSerialize::fromNotation(sdres, sstream); + LLSDSerialize::fromNotation(sdres, sstream, sdstring.size()); S32 width = sdres[0]; S32 height = sdres[1]; diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 660de69fb0..b0d7aa6d1b 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -468,6 +468,7 @@ void LLPreview::onBtnCopyToInv(void* userdata) cb); } } + self->close(); } // static diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 20e4eee396..8df34d39c6 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1377,8 +1377,13 @@ BOOL idle_startup() const char* look_at_str = gUserAuthp->getResponse("look_at"); if (look_at_str) { - LLMemoryStream mstr((U8*)look_at_str, strlen(look_at_str)); /* Flawfinder: ignore */ - LLSD sd = LLSDNotationParser::parse(mstr); +#if !LL_WINDOWS && !LL_DARWIN + size_t len = strnlen(look_at_str, MAX_STRING); +#else + size_t len = strlen(look_at_str); +#endif + LLMemoryStream mstr((U8*)look_at_str, len); + LLSD sd = LLSDSerialize::fromNotation(mstr, len); agent_start_look_at = ll_vector3_from_sd(sd); } @@ -1399,8 +1404,13 @@ BOOL idle_startup() const char* home_location = gUserAuthp->getResponse("home"); if(home_location) { - LLMemoryStream mstr((U8*)home_location, strlen(home_location)); /* Flawfinder: ignore */ - LLSD sd = LLSDNotationParser::parse(mstr); +#if !LL_WINDOWS && !LL_DARWIN + size_t len = strnlen(home_location, MAX_STRING); +#else + size_t len = strlen(home_location); +#endif + LLMemoryStream mstr((U8*)home_location, len); + LLSD sd = LLSDSerialize::fromNotation(mstr, len); S32 region_x = sd["region_handle"][0].asInteger(); S32 region_y = sd["region_handle"][1].asInteger(); U64 region_handle = to_region_handle(region_x, region_y); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 9332a909d7..6b18fb46be 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1194,8 +1194,8 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) LLString::format_map_t args; args["[OBJECTNAME]"] = info->mDesc; // must protect against a NULL return from lookupHumanReadable() - const char* typestr = LLAssetType::lookupHumanReadable(info->mType); - if (typestr) + std::string typestr = ll_safe_string(LLAssetType::lookupHumanReadable(info->mType)); + if (!typestr.empty()) { args["[OBJECTTYPE]"] = typestr; } diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index bd488577e3..871fc9702e 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -942,7 +942,13 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) S32 dy = y - mMouseDownY; if (-2 < dx && dx < 2 && -2 < dy && dy < 2) { - openEmbeddedItem(mDragItem, mDragItemSaved); + if(mDragItemSaved) + { + openEmbeddedItem(mDragItem); + }else + { + showUnsavedAlertDialog(mDragItem); + } } } mDragItem = NULL; @@ -1311,15 +1317,23 @@ BOOL LLViewerTextEditor::openEmbeddedItemAtPos(S32 pos) if( item ) { BOOL saved = LLEmbeddedItems::getEmbeddedItemSaved( mWText[pos] ); - return openEmbeddedItem(item, saved); + if (saved) + { + return openEmbeddedItem(item); + } + else + { + showUnsavedAlertDialog(item); + } } } return FALSE; } -BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, BOOL saved) +BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item) { + switch( item->getType() ) { case LLAssetType::AT_TEXTURE: @@ -1329,15 +1343,15 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, BOOL saved) case LLAssetType::AT_SOUND: openEmbeddedSound( item ); return TRUE; - + case LLAssetType::AT_NOTECARD: - openEmbeddedNotecard( item, saved ); + openEmbeddedNotecard( item ); return TRUE; case LLAssetType::AT_LANDMARK: openEmbeddedLandmark( item ); return TRUE; - + case LLAssetType::AT_LSL_TEXT: case LLAssetType::AT_CLOTHING: case LLAssetType::AT_OBJECT: @@ -1345,10 +1359,11 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, BOOL saved) case LLAssetType::AT_ANIMATION: case LLAssetType::AT_GESTURE: showCopyToInvDialog( item ); - return TRUE; + return TRUE; default: return FALSE; } + } @@ -1401,23 +1416,30 @@ void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item ) open_landmark((LLViewerInventoryItem*)item, title, FALSE, item->getUUID(), TRUE); } -void LLViewerTextEditor::openEmbeddedNotecard( LLInventoryItem* item, BOOL saved ) +void LLViewerTextEditor::openEmbeddedNotecard( LLInventoryItem* item ) { - if (saved) - { + //if (saved) + //{ // An LLInventoryItem needs to be in an inventory to be opened. // This will give the item to the viewer's agent. // The callback will attempt to open it if its not already opened. - copyInventory(item, gInventoryCallbacks.registerCB(mInventoryCallback)); - } - else - { - LLNotecardCopyInfo *info = new LLNotecardCopyInfo(this, item); - gViewerWindow->alertXml("ConfirmNotecardSave", - LLViewerTextEditor::onNotecardDialog, (void*)info); - } + copyInventory(item, gInventoryCallbacks.registerCB(mInventoryCallback)); + + //} + //else + //{ + // LLNotecardCopyInfo *info = new LLNotecardCopyInfo(this, item); + // gViewerWindow->alertXml("ConfirmNotecardSave", + // LLViewerTextEditor::onNotecardDialog, (void*)info); + //} } +void LLViewerTextEditor::showUnsavedAlertDialog( LLInventoryItem* item ) +{ + LLNotecardCopyInfo *info = new LLNotecardCopyInfo(this, item); + gViewerWindow->alertXml( "ConfirmNotecardSave", + LLViewerTextEditor::onNotecardDialog, (void*)info); +} // static void LLViewerTextEditor::onNotecardDialog( S32 option, void* userdata ) { diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index 1ec173a5d1..02d934fc3c 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -107,15 +107,16 @@ protected: BOOL getEmbeddedItemToolTipAtPos(S32 pos, LLWString &wmsg); BOOL openEmbeddedItemAtPos( S32 pos ); - BOOL openEmbeddedItem(LLInventoryItem* item, BOOL saved); + BOOL openEmbeddedItem(LLInventoryItem* item); S32 insertEmbeddedItem(S32 pos, LLInventoryItem* item); void openEmbeddedTexture( LLInventoryItem* item ); void openEmbeddedSound( LLInventoryItem* item ); void openEmbeddedLandmark( LLInventoryItem* item ); - void openEmbeddedNotecard( LLInventoryItem* item, BOOL saved ); + void openEmbeddedNotecard( LLInventoryItem* item); void showCopyToInvDialog( LLInventoryItem* item ); + void showUnsavedAlertDialog( LLInventoryItem* item ); static void onCopyToInvDialog( S32 option, void* userdata ); static void onNotecardDialog( S32 option, void* userdata ); |