diff options
author | Adam Moss <moss@lindenlab.com> | 2009-04-16 23:45:35 +0000 |
---|---|---|
committer | Adam Moss <moss@lindenlab.com> | 2009-04-16 23:45:35 +0000 |
commit | b01c75cb423f07a3d3354f8bd62f265f80062b3b (patch) | |
tree | dec1b220c24a60cc220d1cb07fd3545610644f0a /indra/newview | |
parent | 868250bdd74f348557102c0d8408d9bec30331f6 (diff) |
svn merge -r117314:117337
svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/mv13a-merge-1
QAR-1343 maint-viewer-13a+libcurlexploitfix-3-3 combo merge
Diffstat (limited to 'indra/newview')
67 files changed, 598 insertions, 773 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c3d92953ce..fa7d226f16 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -279,7 +279,6 @@ set(viewer_SOURCE_FILES llpanelgrouplandmoney.cpp llpanelgroupnotices.cpp llpanelgrouproles.cpp - llpanelgroupvoting.cpp llpanelinput.cpp llpanelinventory.cpp llpanelland.cpp @@ -683,7 +682,6 @@ set(viewer_HEADER_FILES llpanelgrouplandmoney.h llpanelgroupnotices.h llpanelgrouproles.h - llpanelgroupvoting.h llpanelinput.h llpanelinventory.h llpanelland.h diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 90c7b11637..dab88a5ec3 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -11,6 +11,17 @@ <key>Value</key> <string>The Resident you messaged is in 'busy mode' which means they have requested not to be disturbed. Your message will still be shown in their IM panel for later viewing.</string> </map> + <key>BusyModeResponse2</key> + <map> + <key>Comment</key> + <string>Auto response to instant messages while in busy mode, clean (unencoded) version of BusyModeResponse</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>|TOKEN COPY BusyModeResponse|</string> + </map> <key>IMLogTimestamp</key> <map> <key>Comment</key> diff --git a/indra/newview/linux_tools/client-readme-joystick.txt b/indra/newview/linux_tools/client-readme-joystick.txt index 997a8b08eb..4f89a73ccb 100644 --- a/indra/newview/linux_tools/client-readme-joystick.txt +++ b/indra/newview/linux_tools/client-readme-joystick.txt @@ -41,7 +41,7 @@ applications such as the Second Life Viewer, as follows: * Ubuntu or Gentoo Linux Configuration: For a quick start, you can simply paste the following line into a terminal before plugging in your SpaceNavigator - this only needs to be done once: - sudo bash -c 'echo KERNEL==\"event[0-9]*\", SYSFS{idVendor}==\"046d\", SYSFS{idProduct}==\"c626\", SYMLINK+=\"input/spacenavigator\", GROUP=\"plugdev\", MODE=\"664\" >> /etc/udev/rules.d/91-spacenavigator.rules' + sudo bash -c 'echo KERNEL==\"event[0-9]*\", SYSFS{idVendor}==\"046d\", SYSFS{idProduct}==\"c626\", SYMLINK+=\"input/spacenavigator\", GROUP=\"plugdev\", MODE=\"664\" > /etc/udev/rules.d/91-spacenavigator-LL.rules ; echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><deviceinfo version=\"0.2\"><device><match key=\"info.product\" contains=\"3Dconnexion SpaceNavigator\"><merge key=\"input.x11_driver\" type=\"string\"></merge></match></device></deviceinfo>" > /etc/hal/fdi/policy/3Dconnexion_SpaceNavigator_LL.fdi' For more comprehensive Linux SpaceNavigator configuration information please see the section 'Installing SpaceNavigator without the official driver' here: diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index a894bca619..3b534ce5a7 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -76,6 +76,7 @@ #include "llfloaterdirectory.h" #include "llfloatergroupinfo.h" #include "llfloatergroups.h" +#include "llfloaterland.h" #include "llfloatermap.h" #include "llfloatermute.h" #include "llfloatersnapshot.h" @@ -3835,7 +3836,7 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit) if(constrain) { F32 max_dist = ( CAMERA_MODE_CUSTOMIZE_AVATAR == mCameraMode ) ? - APPEARANCE_MAX_ZOOM : MAX_CAMERA_DISTANCE_FROM_AGENT; + APPEARANCE_MAX_ZOOM : mDrawDistance; LLVector3d camera_offset = camera_position_global - gAgent.getPositionGlobal(); @@ -5950,6 +5951,9 @@ bool LLAgent::teleportCore(bool is_local) LLFloaterWorldMap::hide(NULL); LLFloaterDirectory::hide(NULL); + // hide land floater too - it'll be out of date + LLFloaterLand::hideInstance(); + LLViewerParcelMgr::getInstance()->deselectLand(); // Close all pie menus, deselect land, etc. diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1e6d8fdf25..43800c67fa 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -202,7 +202,6 @@ const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user fl F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() F32 gSimFrames; -BOOL gAllowIdleAFK = TRUE; BOOL gAllowTapTapHoldRun = TRUE; BOOL gShowObjectUpdates = FALSE; BOOL gUseQuickTime = TRUE; @@ -301,7 +300,7 @@ LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; void idle_afk_check() { // check idle timers - if (gAllowIdleAFK && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout"))) + if (gSavedSettings.getBOOL("AllowIdleAFK") && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout"))) { gAgent.setAFK(); } @@ -394,7 +393,6 @@ static void settings_to_globals() gAgent.mHideGroupTitle = gSavedSettings.getBOOL("RenderHideGroupTitle"); gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc"); - gAllowIdleAFK = gSavedSettings.getBOOL("AllowIdleAFK"); gAllowTapTapHoldRun = gSavedSettings.getBOOL("AllowTapTapHoldRun"); gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); gMapScale = gSavedSettings.getF32("MapScale"); @@ -507,6 +505,7 @@ LLTextureFetch* LLAppViewer::sTextureFetch = NULL; LLAppViewer::LLAppViewer() : mMarkerFile(), + mLogoutMarkerFile(NULL), mReportedCrash(false), mNumSessions(0), mPurgeCache(false), @@ -2158,7 +2157,6 @@ void LLAppViewer::cleanupSavedSettings() gSavedSettings.setBOOL("DebugWindowProc", gDebugWindowProc); - gSavedSettings.setBOOL("AllowIdleAFK", gAllowIdleAFK); gSavedSettings.setBOOL("AllowTapTapHoldRun", gAllowTapTapHoldRun); gSavedSettings.setBOOL("ShowObjectUpdates", gShowObjectUpdates); @@ -3497,7 +3495,7 @@ void LLAppViewer::idleShutdown() S32 finished_uploads = total_uploads - pending_uploads; F32 percent = 100.f * finished_uploads / total_uploads; gViewerWindow->setProgressPercent(percent); - gViewerWindow->setProgressString("Saving final data..."); + gViewerWindow->setProgressString("Saving your settings..."); return; } @@ -3669,7 +3667,7 @@ void LLAppViewer::idleNetwork() // Check that the circuit between the viewer and the agent's current // region is still alive LLViewerRegion *agent_region = gAgent.getRegion(); - if (agent_region) + if (agent_region && (LLStartUp::getStartupState()==STATE_STARTED)) { LLUUID this_region_id = agent_region->getRegionID(); bool this_region_alive = agent_region->isAlive(); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 6d7c3c8577..fc88c76aaf 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -251,7 +251,6 @@ const S32 AGENT_UPDATES_PER_SECOND = 10; extern LLSD gDebugInfo; -extern BOOL gAllowIdleAFK; extern BOOL gAllowTapTapHoldRun; extern BOOL gShowObjectUpdates; diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index 8b81478eaf..d02e86a557 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -165,14 +165,14 @@ static inline BOOL do_basic_glibc_backtrace() // amazing backtrace. static inline BOOL do_basic_glibc_backtrace() { - void *array[MAX_STACK_TRACE_DEPTH]; + void *stackarray[MAX_STACK_TRACE_DEPTH]; size_t size; char **strings; size_t i; BOOL success = FALSE; - size = backtrace(array, MAX_STACK_TRACE_DEPTH); - strings = backtrace_symbols(array, size); + size = backtrace(stackarray, MAX_STACK_TRACE_DEPTH); + strings = backtrace_symbols(stackarray, size); std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); llinfos << "Opening stack trace file " << strace_filename << llendl; @@ -186,8 +186,13 @@ static inline BOOL do_basic_glibc_backtrace() if (size) { for (i = 0; i < size; i++) - fputs((std::string(strings[i])+"\n").c_str(), - StraceFile); + { + // the format of the StraceFile is very specific, to allow (kludgy) machine-parsing + fprintf(StraceFile, "%-3d ", i); + fprintf(StraceFile, "%-32s\t", "unknown"); + fprintf(StraceFile, "%p ", stackarray[i]); + fprintf(StraceFile, "%s\n", strings[i]); + } success = TRUE; } @@ -205,7 +210,7 @@ static inline BOOL do_basic_glibc_backtrace() // extraction without exporting symbols (which'd cause subtle, fatal bugs). static inline BOOL do_elfio_glibc_backtrace() { - void *array[MAX_STACK_TRACE_DEPTH]; + void *stackarray[MAX_STACK_TRACE_DEPTH]; size_t btsize; char **strings; BOOL success = FALSE; @@ -222,8 +227,8 @@ static inline BOOL do_elfio_glibc_backtrace() } // get backtrace address list and basic symbol info - btsize = backtrace(array, MAX_STACK_TRACE_DEPTH); - strings = backtrace_symbols(array, btsize); + btsize = backtrace(stackarray, MAX_STACK_TRACE_DEPTH); + strings = backtrace_symbols(stackarray, btsize); // create ELF reader for our app binary IELFI* pReader; @@ -257,7 +262,8 @@ static inline BOOL do_elfio_glibc_backtrace() size_t btpos; for (btpos = 0; btpos < btsize; ++btpos) { - fprintf(StraceFile, "%d:\t", btpos); + // the format of the StraceFile is very specific, to allow (kludgy) machine-parsing + fprintf(StraceFile, "%-3d ", btpos); int symidx; for (symidx = 0; symidx < nSymNo; ++symidx) { @@ -266,9 +272,13 @@ static inline BOOL do_elfio_glibc_backtrace() bind, type, section)) { // check if trace address within symbol range - if (uintptr_t(array[btpos]) >= value && - uintptr_t(array[btpos]) < value+ssize) + if (uintptr_t(stackarray[btpos]) >= value && + uintptr_t(stackarray[btpos]) < value+ssize) { + // symbol is inside viewer + fprintf(StraceFile, "%-32s\t", "com.secondlife.indra.viewer"); + fprintf(StraceFile, "%p ", stackarray[btpos]); + char *demangled_str = NULL; int demangle_result = 1; demangled_str = @@ -278,20 +288,19 @@ static inline BOOL do_elfio_glibc_backtrace() if (0 == demangle_result && NULL != demangled_str) { fprintf(StraceFile, - "ELF(%s", demangled_str); + "%s", demangled_str); free(demangled_str); } else // failed demangle; print it raw { fprintf(StraceFile, - "ELF(%s", name.c_str()); + "%s", name.c_str()); } // print offset from symbol start fprintf(StraceFile, - "+0x%lx) [%p]\n", - uintptr_t(array[btpos]) - - value, - array[btpos]); + " + %lu\n", + uintptr_t(stackarray[btpos]) - + value); goto got_sym; // early escape } } @@ -299,6 +308,8 @@ static inline BOOL do_elfio_glibc_backtrace() // Fallback: // Didn't find a suitable symbol in the binary - it's probably // a symbol in a DSO; use glibc's idea of what it should be. + fprintf(StraceFile, "%-32s\t", "unknown"); + fprintf(StraceFile, "%p ", stackarray[btpos]); fprintf(StraceFile, "%s\n", strings[btpos]); got_sym:; } diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 3cdcb35197..1c32f0c564 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -1,6 +1,6 @@ /** * @file llappviewermacosx.cpp - * @brief The LLAppViewerWin32 class definitions + * @brief The LLAppViewerMacOSX class definitions * * $LicenseInfo:firstyear=2007&license=viewergpl$ * diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 47e4a2278f..9f4afc9f17 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1015,6 +1015,10 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, U32 data_mask) mPartitionType = LLViewerRegion::PARTITION_VOLUME; mOctree->balance(); + + llassert(mDrawable); + llassert(mDrawable->getRegion()); + llassert(mDrawable->getRegion()->getSpatialPartition(mPartitionType)); mDrawable->getRegion()->getSpatialPartition(mPartitionType)->put(this); } @@ -1315,6 +1319,10 @@ void LLSpatialBridge::move(LLDrawable *drawablep, LLSpatialGroup *curp, BOOL imm BOOL LLSpatialBridge::updateMove() { + llassert(mDrawable); + llassert(mDrawable->getRegion()); + llassert(mDrawable->getRegion()->getSpatialPartition(mPartitionType)); + mOctree->balance(); mDrawable->getRegion()->getSpatialPartition(mPartitionType)->move(this, getSpatialGroup(), TRUE); return TRUE; diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 104e0df293..ab2455620f 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -59,6 +59,7 @@ #include <commdlg.h> #endif +extern "C" { // mostly for Linux, possible on others #if LL_GTK # include "gtk/gtk.h" @@ -68,6 +69,7 @@ #if LL_X11 #include "SDL/SDL_syswm.h" #endif +} class LLFilePicker { diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h index 33aac8257e..3adbd14370 100644 --- a/indra/newview/llfloaterchatterbox.h +++ b/indra/newview/llfloaterchatterbox.h @@ -148,7 +148,14 @@ public: { if (visible(instance, key)) { - LLFloaterChatterBox::hideInstance(); + if(instance->getHost()) + { + LLFloaterChatterBox::hideInstance(); + } + else + { + VisibilityPolicy<LLFloater>::hide(instance, key); + } } } diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 658aa16429..6d39d75663 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -200,12 +200,7 @@ void LLFloaterGesture::refreshAll() } else { - if (list->setCurrentByID(sInstance->mSelectedID)) - { - LLCtrlScrollInterface *scroll = sInstance->childGetScrollInterface("gesture_list"); - if (scroll) scroll->scrollToShowSelected(); - } - else + if (! list->setCurrentByID(sInstance->mSelectedID)) { list->selectFirstItem(); } @@ -219,8 +214,14 @@ void LLFloaterGesture::refreshAll() void LLFloaterGesture::buildGestureList() { LLCtrlListInterface *list = childGetListInterface("gesture_list"); - if (!list) return; + LLCtrlScrollInterface *scroll = childGetScrollInterface("gesture_list"); + if (! (list && scroll)) return; + + // attempt to preserve scroll position through re-builds + // since we do re-build any time anything dirties + S32 current_scroll_pos = scroll->getScrollPos(); + list->operateOnAll(LLCtrlListInterface::OP_DELETE); LLGestureManager::item_map_t::iterator it; @@ -319,6 +320,8 @@ void LLFloaterGesture::buildGestureList() } list->addElement(element, ADD_BOTTOM); } + + scroll->setScrollPos(current_scroll_pos); } // static diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 689f9f48d0..3606f7ccbe 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -72,11 +72,14 @@ const S32 PREVIEW_TEXTURE_HEIGHT = 300; // LLFloaterImagePreview() //----------------------------------------------------------------------------- LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) : - LLFloaterNameDesc(filename) + LLFloaterNameDesc(filename), + + mAvatarPreview(NULL), + mSculptedPreview(NULL), + mLastMouseX(0), + mLastMouseY(0), + mImagep(NULL) { - mLastMouseX = 0; - mLastMouseY = 0; - mImagep = NULL ; loadImage(mFilenameAndPath); } @@ -815,7 +818,7 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) mVertexBuffer->getIndexStrider(index_strider); // build vertices and normals - for (U32 i = 0; (S32)i < num_vertices; i++) + for (U32 i = 0; i < num_vertices; i++) { *(vertex_strider++) = vf.mVertices[i].mPosition; LLVector3 normal = vf.mVertices[i].mNormal; diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index fc483dd307..f4984df6d9 100644 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -80,12 +80,26 @@ void LLFloaterOpenObject::refresh() { mPanelInventory->refresh(); + std::string name; + BOOL enabled; + LLSelectNode* node = mObjectSelection->getFirstRootNode(); if (node) { - std::string name = node->mName; - childSetTextArg("object_name", "[DESC]", name); + name = node->mName; + enabled = TRUE; + } + else + { + name = ""; + enabled = FALSE; } + + childSetTextArg("object_name", "[DESC]", name); + + childSetEnabled("copy_to_inventory_button", enabled); + childSetEnabled("copy_and_wear_button", enabled); + } void LLFloaterOpenObject::draw() diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 588df7b43b..2b418b4caa 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -2862,20 +2862,14 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs, S32 file_length = file.getSize(); - char* buffer = new char[file_length+1]; - if (buffer == NULL) - { - llerrs << "Memory Allocation Failed" << llendl; - return; - } - - file.read((U8*)buffer, file_length); /* Flawfinder: ignore */ + std::vector<char> buffer(file_length+1); + file.read((U8*)&buffer[0], file_length); // put a EOS at the end buffer[file_length] = 0; - if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) + if( (file_length > 19) && !strncmp( &buffer[0], "Linden text version", 19 ) ) { - if( !panelp->mEditor->importBuffer( buffer, file_length+1 ) ) + if( !panelp->mEditor->importBuffer( &buffer[0], file_length+1 ) ) { llwarns << "Problem importing estate covenant." << llendl; LLNotifications::instance().add("ProblemImportingEstateCovenant"); @@ -2890,7 +2884,6 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs, // Version 0 (just text, doesn't include version number) panelp->sendChangeCovenantID(asset_uuid); } - delete[] buffer; } else { diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index e3b95e4058..d45d9c052f 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1275,7 +1275,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) LLSnapshotLivePreview* previewp = getPreviewView(floater); BOOL got_bytes = previewp && previewp->getDataSize() > 0; - BOOL got_snap = previewp->getSnapshotUpToDate(); + BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); floater->childSetEnabled("send_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD && got_snap && previewp->getDataSize() <= MAX_POSTCARD_DATASIZE); floater->childSetEnabled("upload_btn", shot_type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE && got_snap); @@ -1283,7 +1283,10 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) LLLocale locale(LLLocale::USER_LOCALE); std::string bytes_string; - LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); + if (got_snap) + { + LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); + } S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); floater->childSetLabelArg("texture", "[AMOUNT]", llformat("%d",upload_cost)); floater->childSetLabelArg("upload_btn", "[AMOUNT]", llformat("%d",upload_cost)); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index e2e71f51fa..8326557cf8 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -1610,7 +1610,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) childSetFocus("search_results"); onCommitSearchResult(NULL, this); } - else + else if (num_results == 0) { list->addCommentText(std::string("None found.")); list->operateOnAll(LLCtrlListInterface::OP_DESELECT); diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 1402d241c7..97a3bd7c50 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -146,9 +146,9 @@ void LLFolderViewItem::cleanupClass() // Default constructor // NOTE: Optimize this, we call it a *lot* when opening a large inventory LLFolderViewItem::LLFolderViewItem( const std::string& name, LLUIImagePtr icon, - S32 creation_date, - LLFolderView* root, - LLFolderViewEventListener* listener ) : + time_t creation_date, + LLFolderView* root, + LLFolderViewEventListener* listener ) : LLUICtrl( name, LLRect(0, 0, 0, 0), TRUE, NULL, NULL, FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT), mLabel( name ), mLabelWidth(0), @@ -4684,7 +4684,7 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) BOOL LLInventoryFilter::isSinceLogoff() { - return (mFilterOps.mMinDate == mLastLogoff) && + return (mFilterOps.mMinDate == (time_t)mLastLogoff) && (mFilterOps.mMaxDate == time_max()); } diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 44b076e397..3fe3095c58 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -335,7 +335,7 @@ protected: std::string mSearchableLabel; std::string mType; S32 mLabelWidth; - U32 mCreationDate; + time_t mCreationDate; LLFolderViewFolder* mParentFolder; LLFolderViewEventListener* mListener; BOOL mIsSelected; @@ -386,7 +386,7 @@ public: void filterFromRoot( void ); // creation_date is in UTC seconds - LLFolderViewItem( const std::string& name, LLUIImagePtr icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener ); + LLFolderViewItem( const std::string& name, LLUIImagePtr icon, time_t creation_date, LLFolderView* root, LLFolderViewEventListener* listener ); virtual ~LLFolderViewItem( void ); // addToFolder() returns TRUE if it succeeds. FALSE otherwise diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 2135ea5315..2dbff92ba0 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -926,20 +926,15 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, LLVFile file(vfs, asset_uuid, type, LLVFile::READ); S32 size = file.getSize(); - char* buffer = new char[size+1]; - if (buffer == NULL) - { - llerrs << "Memory Allocation Failed" << llendl; - return; - } + std::vector<char> buffer(size+1); - file.read((U8*)buffer, size); /* Flawfinder: ignore */ + file.read((U8*)&buffer[0], size); // ensure there's a trailing NULL so strlen will work. buffer[size] = '\0'; LLMultiGesture* gesture = new LLMultiGesture(); - LLDataPackerAsciiBuffer dp(buffer, size+1); + LLDataPackerAsciiBuffer dp(&buffer[0], size+1); BOOL ok = gesture->deserialize(dp); if (ok) @@ -991,9 +986,6 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, delete gesture; gesture = NULL; } - - delete [] buffer; - buffer = NULL; } else { diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 77ee29a449..003a02c3cd 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -803,7 +803,12 @@ static void formatDateString(std::string &date_string) const regex expression("([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})"); if (regex_match(date_string.c_str(), result, expression)) { - date_string = result[3]+"/"+result[1]+"/"+result[2]; + std::string year = result[3]; + std::string month = result[1]; + std::string day = result[2]; + + // ISO 8601 date format + date_string = llformat("%04s-%02s-%02s", year.c_str(), month.c_str(), day.c_str()); } } diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp index 88521df29c..a13ee8572f 100644 --- a/indra/newview/llhudeffectpointat.cpp +++ b/indra/newview/llhudeffectpointat.cpp @@ -160,6 +160,7 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum) LLHUDEffect::unpackData(mesgsys, blocknum); LLUUID source_id; LLUUID target_id; + U8 pointAtTypeUnpacked = 0; S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData); if (size != PKT_SIZE) { @@ -169,6 +170,9 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum) mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, packed_data, PKT_SIZE, blocknum); htonmemcpy(source_id.mData, &(packed_data[SOURCE_AVATAR]), MVT_LLUUID, 16); + htonmemcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16); + htonmemcpy(new_target.mdV, &(packed_data[TARGET_POS]), MVT_LLVector3d, 24); + htonmemcpy(&pointAtTypeUnpacked, &(packed_data[POINTAT_TYPE]), MVT_U8, 1); LLViewerObject *objp = gObjectList.findObject(source_id); if (objp && objp->isAvatar()) @@ -181,12 +185,8 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum) return; } - htonmemcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16); - objp = gObjectList.findObject(target_id); - htonmemcpy(new_target.mdV, &(packed_data[TARGET_POS]), MVT_LLVector3d, 24); - if (objp) { setTargetObjectAndOffset(objp, new_target); @@ -196,8 +196,6 @@ void LLHUDEffectPointAt::unpackData(LLMessageSystem *mesgsys, S32 blocknum) setTargetPosGlobal(new_target); } - U8 pointAtTypeUnpacked = 0; - htonmemcpy(&pointAtTypeUnpacked, &(packed_data[POINTAT_TYPE]), MVT_U8, 1); mTargetType = (EPointAtType)pointAtTypeUnpacked; // mKillTime = mTimer.getElapsedTimeF32() + mDuration; diff --git a/indra/newview/llhudeffecttrail.cpp b/indra/newview/llhudeffecttrail.cpp index 32b52f8628..0ade6810ba 100644 --- a/indra/newview/llhudeffecttrail.cpp +++ b/indra/newview/llhudeffecttrail.cpp @@ -121,7 +121,7 @@ void LLHUDEffectSpiral::unpackData(LLMessageSystem *mesgsys, S32 blocknum) LLHUDEffect::unpackData(mesgsys, blocknum); LLUUID object_id, target_object_id; - S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData); + size_t size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData); if (size != EFFECT_SIZE) { llwarns << "Spiral effect with bad size " << size << llendl; diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index fcebfa7053..66c2e4fe21 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -2030,8 +2030,8 @@ void LLFloaterIMPanel::sendMsg() LLViewerStats::getInstance()->incStat(LLViewerStats::ST_IM_COUNT); + mInputEditor->setText(LLStringUtil::null); } - mInputEditor->setText(LLStringUtil::null); // Don't need to actually send the typing stop message, the other // client will infer it from receiving the message. diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 69a403e388..2697ef25f9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1012,6 +1012,19 @@ BOOL LLItemBridge::isItemCopyable() const LLViewerInventoryItem* item = getItem(); if (item) { + // can't copy worn objects. DEV-15183 + LLVOAvatar *avatarp = gAgent.getAvatarObject(); + if( !avatarp ) + { + return FALSE; + } + + if( avatarp->isWearingAttachment( mUUID ) ) + { + return FALSE; + } + + return (item->getPermissions().allowCopyBy(gAgent.getID())); } return FALSE; @@ -4624,7 +4637,7 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, { EWearableType type = wearable->getType(); - if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&& + if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES ) ) //&& //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) { gAgent.removeWearable( type ); diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index e8cdcdfdd6..2f43b41042 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -89,11 +89,11 @@ void LLLandmarkList::processGetAssetReply( LLVFile file(vfs, uuid, type); S32 file_length = file.getSize(); - char* buffer = new char[ file_length + 1 ]; - file.read( (U8*)buffer, file_length); /*Flawfinder: ignore*/ + std::vector<char> buffer(file_length + 1); + file.read( (U8*)&buffer[0], file_length); buffer[ file_length ] = 0; - LLLandmark* landmark = LLLandmark::constructFromString(buffer); + LLLandmark* landmark = LLLandmark::constructFromString(&buffer[0]); if (landmark) { LLVector3d pos; @@ -111,8 +111,6 @@ void LLLandmarkList::processGetAssetReply( } gLandmarkList.mList[ uuid ] = landmark; } - - delete[] buffer; } else { diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index a9b0610ed5..1709d6465d 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -50,7 +50,7 @@ std::string LLLogChat::makeLogFileName(std::string filename) std::string LLLogChat::cleanFileName(std::string filename) { std::string invalidChars = "\"\'\\/?*:<>|"; - S32 position = filename.find_first_of(invalidChars); + std::string::size_type position = filename.find_first_of(invalidChars); while (position != filename.npos) { filename[position] = '_'; diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index bfcba59975..841330483c 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -788,8 +788,9 @@ void LLMuteList::processMuteListUpdate(LLMessageSystem* msg, void**) llwarns << "Got an mute list update for the wrong agent." << llendl; return; } - std::string filename; - msg->getStringFast(_PREHASH_MuteData, _PREHASH_Filename, filename); + std::string unclean_filename; + msg->getStringFast(_PREHASH_MuteData, _PREHASH_Filename, unclean_filename); + std::string filename = LLDir::getScrubbedFileName(unclean_filename); std::string *local_filename_and_path = new std::string(gDirUtilp->getExpandedFilename( LL_PATH_CACHE, filename )); gXferManager->requestFile(*local_filename_and_path, diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 7253d758ea..9d5a4ad01c 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -483,11 +483,20 @@ LLPanelAvatarWeb::~LLPanelAvatarWeb() }; } +void LLPanelAvatarWeb::refresh() +{ + if (mNavigateTo != "") + { + llinfos << "Loading " << mNavigateTo << llendl; + mWebBrowser->navigateTo( mNavigateTo ); + mNavigateTo = ""; + } +} + + void LLPanelAvatarWeb::enableControls(BOOL self) { childSetEnabled("url_edit",self); - childSetVisible("status_text",!self && !mHome.empty()); - childSetText("status_text", LLStringUtil::null); } void LLPanelAvatarWeb::setWebURL(std::string url) @@ -511,11 +520,8 @@ void LLPanelAvatarWeb::setWebURL(std::string url) else { childSetVisible("profile_html",false); + childSetVisible("status_text", false); } - - BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); - childSetVisible("status_text",!own_avatar && !mHome.empty()); - } // static @@ -538,13 +544,15 @@ void LLPanelAvatarWeb::load(std::string url) { bool have_url = (!url.empty()); + + childSetVisible("profile_html", have_url); + childSetVisible("status_text", have_url); + childSetText("status_text", LLStringUtil::null); + if (have_url) { - llinfos << "Loading " << url << llendl; - mWebBrowser->navigateTo( url ); + mNavigateTo = url; } - - childSetVisible("profile_html", have_url); } //static diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 041d50331c..12e1b99360 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -144,6 +144,8 @@ public: /*virtual*/ ~LLPanelAvatarWeb(); /*virtual*/ BOOL postBuild(void); + /*virtual*/ void refresh(); + void enableControls(BOOL own_avatar); void setWebURL(std::string url); @@ -160,6 +162,7 @@ public: private: std::string mHome; + std::string mNavigateTo; LLWebBrowserCtrl* mWebBrowser; }; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index b1a38e07a7..e93a5be8ed 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -73,7 +73,6 @@ BOOL LLPanelFace::postBuild() LLTextureCtrl* mTextureCtrl; LLColorSwatchCtrl* mColorSwatch; - LLTextBox* mLabelTexGen; LLComboBox* mComboTexGen; LLCheckBoxCtrl *mCheckFullbright; @@ -81,7 +80,6 @@ BOOL LLPanelFace::postBuild() LLTextBox* mLabelColorTransp; LLSpinCtrl* mCtrlColorTransp; // transparency = 1 - alpha - LLTextBox* mLabelGlow; LLSpinCtrl* mCtrlGlow; setMouseOpaque(FALSE); @@ -152,7 +150,7 @@ BOOL LLPanelFace::postBuild() mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright); mCheckFullbright->setCallbackUserData( this ); } - mLabelTexGen = getChild<LLTextBox>("tex gen"); + mComboTexGen = getChild<LLComboBox>("combobox texgen"); if(mComboTexGen) { @@ -161,7 +159,6 @@ BOOL LLPanelFace::postBuild() mComboTexGen->setCallbackUserData( this ); } - mLabelGlow = getChild<LLTextBox>("glow label"); mCtrlGlow = getChild<LLSpinCtrl>("glow"); if(mCtrlGlow) { diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index add1f3caa5..d9d796fd9e 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -37,7 +37,6 @@ #include "llbutton.h" #include "llpanelgroupgeneral.h" #include "llpanelgrouproles.h" -#include "llpanelgroupvoting.h" #include "llpanelgrouplandmoney.h" #include "llpanelgroupnotices.h" #include "lltabcontainer.h" @@ -148,8 +147,6 @@ LLPanelGroup::LLPanelGroup(const std::string& filename, &mID); mFactoryMap["notices_tab"] = LLCallbackMap(LLPanelGroupNotices::createTab, &mID); - mFactoryMap["voting_tab"] = LLCallbackMap(LLPanelGroupVoting::createTab, - &mID); mFactoryMap["land_money_tab"]= LLCallbackMap(LLPanelGroupLandMoney::createTab, &mID); // Roles sub tabs diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index cbf4a8740c..3dc5e032c5 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -901,7 +901,7 @@ void LLPanelGroupGeneral::updateChanged() mChanged = FALSE; - for( int i= 0; i< LL_ARRAY_SIZE(check_list); i++ ) + for( size_t i=0; i<LL_ARRAY_SIZE(check_list); i++ ) { if( check_list[i] && check_list[i]->isDirty() ) { diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 7c2e8981f9..6ff09e56f8 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -974,7 +974,7 @@ void LLGroupMoneyTabEventHandler::clickLaterCallback(void* data) void LLGroupMoneyTabEventHandler::clickTabCallback(void* data, bool from_click) { LLGroupMoneyTabEventHandler* selfp = (LLGroupMoneyTabEventHandler*) data; - if ( selfp ) selfp->onClickTab(); + if ( selfp && from_click ) selfp->onClickTab(); } //************************************************** diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index e07259f7a1..5824df46e2 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -56,8 +56,6 @@ #include "llviewermessage.h" #include "llnotifications.h" -const S32 NOTICE_DATE_STRING_SIZE = 30; - ///////////////////////// // LLPanelGroupNotices // ///////////////////////// @@ -170,14 +168,23 @@ BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, //----------------------------------------------------------------------------- // LLPanelGroupNotices //----------------------------------------------------------------------------- -std::string build_notice_date(const time_t& the_time) +std::string build_notice_date(const U32& the_time) { - time_t t = the_time; - if (!t) time(&t); + // ISO 8601 date format + + time_t t = (time_t)the_time; + + if (!t) + { + time(&t); + } + tm* lt = localtime(&t); + //for some reason, the month is off by 1. See other uses of //"local" time in the code... - std::string buffer = llformat("%i/%i/%i", lt->tm_mon + 1, lt->tm_mday, lt->tm_year + 1900); + std::string buffer = llformat("%04i-%02i-%02i", lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday); + return buffer; } @@ -469,7 +476,6 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) msg->getBOOL("Data","HasAttachment",has_attachment,i); msg->getU8("Data","AssetType",asset_type,i); msg->getU32("Data","Timestamp",timestamp,i); - time_t t = timestamp; LLSD row; row["id"] = id; @@ -490,13 +496,11 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) row["columns"][2]["column"] = "from"; row["columns"][2]["value"] = name; - std::string buffer = build_notice_date(t); row["columns"][3]["column"] = "date"; - row["columns"][3]["value"] = buffer; + row["columns"][3]["value"] = build_notice_date(timestamp); - buffer = llformat( "%u", timestamp); row["columns"][4]["column"] = "sort"; - row["columns"][4]["value"] = buffer; + row["columns"][4]["value"] = llformat( "%u", timestamp); mNoticesList->addElement(row, ADD_BOTTOM); } diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index da8c9a9ac7..389f06f355 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -1034,7 +1034,7 @@ void LLPanelPermissions::setAllSaleInfo() { // Don't extract the price if it's labeled as MIXED or is empty. const std::string& editPriceString = editPrice->getText(); - if (editPriceString != getString("Cost Mixed") && + if (editPriceString != getString("Cost Mixed") && editPriceString != getString("Sale Mixed") && !editPriceString.empty()) { price = atoi(editPriceString.c_str()); @@ -1048,12 +1048,6 @@ void LLPanelPermissions::setAllSaleInfo() if (price < 0) sale_type = LLSaleInfo::FS_NOT; - // Force the sale price of not-for-sale items to DEFAULT_PRICE. - if (sale_type == LLSaleInfo::FS_NOT) - { - price = DEFAULT_PRICE; - } - // Pack up the sale info and send the update. LLSaleInfo sale_info(sale_type, price); LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(sale_info); diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index ff3b9433f4..76a9b80645 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -920,13 +920,13 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs, LLVFile file(vfs, asset_uuid, type, LLVFile::READ); S32 size = file.getSize(); - char* buffer = new char[size+1]; - file.read((U8*)buffer, size); /*Flawfinder: ignore*/ + std::vector<char> buffer(size+1); + file.read((U8*)&buffer[0], size); buffer[size] = '\0'; LLMultiGesture* gesture = new LLMultiGesture(); - LLDataPackerAsciiBuffer dp(buffer, size+1); + LLDataPackerAsciiBuffer dp(&buffer[0], size+1); BOOL ok = gesture->deserialize(dp); if (ok) @@ -947,9 +947,6 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs, delete gesture; gesture = NULL; - delete [] buffer; - buffer = NULL; - self->mAssetStatus = PREVIEW_ASSET_LOADED; } else diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 897fd6a2ee..4abe390bc5 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -364,8 +364,8 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, S32 file_length = file.getSize(); - char* buffer = new char[file_length+1]; - file.read((U8*)buffer, file_length); /*Flawfinder: ignore*/ + std::vector<char> buffer(file_length+1); + file.read((U8*)&buffer[0], file_length); // put a EOS at the end buffer[file_length] = 0; @@ -373,9 +373,9 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, LLViewerTextEditor* previewEditor = preview->getChild<LLViewerTextEditor>("Notecard Editor"); - if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) + if( (file_length > 19) && !strncmp( &buffer[0], "Linden text version", 19 ) ) { - if( !previewEditor->importBuffer( buffer, file_length+1 ) ) + if( !previewEditor->importBuffer( &buffer[0], file_length+1 ) ) { llwarns << "Problem importing notecard" << llendl; } @@ -383,7 +383,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, else { // Version 0 (just text, doesn't include version number) - previewEditor->setText(LLStringExplicit(buffer)); + previewEditor->setText(LLStringExplicit(&buffer[0])); } previewEditor->makePristine(); @@ -392,7 +392,6 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE); preview->setEnabled(modifiable); - delete[] buffer; preview->mAssetStatus = PREVIEW_ASSET_LOADED; } else diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 931d30c9fa..0bacb95d2d 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -314,7 +314,8 @@ LLScriptEdCore::LLScriptEdCore( mForceClose( FALSE ), mLastHelpToken(NULL), mLiveHelpHistorySize(0), - mEnableSave(FALSE) + mEnableSave(FALSE), + mHasScriptData(FALSE) { setFollowsAll(); setBorderVisible(FALSE); @@ -442,12 +443,21 @@ void LLScriptEdCore::initMenu() menuItem->setEnabledCallback(NULL); } +void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid) +{ + if (mEditor) + { + mEditor->setText(text); + mHasScriptData = is_valid; + } +} + BOOL LLScriptEdCore::hasChanged(void* userdata) { LLScriptEdCore* self = (LLScriptEdCore*)userdata; if (!self || !self->mEditor) return FALSE; - return !self->mEditor->isPristine() || self->mEnableSave; + return ((!self->mEditor->isPristine() || self->mEnableSave) && self->mHasScriptData); } void LLScriptEdCore::draw() @@ -975,8 +985,8 @@ bool LLScriptEdCore::handleReloadFromServerDialog(const LLSD& notification, cons case 0: // "Yes" if( mLoadCallback ) { - mEditor->setText( getString("loading") ); - mLoadCallback( mUserdata ); + setScriptText(getString("loading"), FALSE); + mLoadCallback(mUserdata); } break; @@ -1189,7 +1199,7 @@ void LLPreviewLSL::loadAsset() } else { - mScriptEd->mEditor->setText(mScriptEd->getString("can_not_view")); + mScriptEd->setScriptText(mScriptEd->getString("can_not_view"), FALSE); mScriptEd->mEditor->makePristine(); mScriptEd->mEditor->setEnabled(FALSE); mScriptEd->mFunctions->setEnabled(FALSE); @@ -1200,7 +1210,7 @@ void LLPreviewLSL::loadAsset() } else { - mScriptEd->mEditor->setText(std::string(HELLO_LSL)); + mScriptEd->setScriptText(std::string(HELLO_LSL), TRUE); mAssetStatus = PREVIEW_ASSET_LOADED; } } @@ -1506,14 +1516,13 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset LLVFile file(vfs, asset_uuid, type); S32 file_length = file.getSize(); - char* buffer = new char[file_length+1]; - file.read((U8*)buffer, file_length); /*Flawfinder: ignore*/ + std::vector<char> buffer(file_length+1); + file.read((U8*)&buffer[0], file_length); // put a EOS at the end buffer[file_length] = 0; - preview->mScriptEd->mEditor->setText(LLStringExplicit(buffer)); + preview->mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE); preview->mScriptEd->mEditor->makePristine(); - delete [] buffer; LLInventoryItem* item = gInventory.getItem(*item_uuid); BOOL is_modifiable = FALSE; if(item @@ -1726,7 +1735,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new) || !gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE)))) { mItem = new LLViewerInventoryItem(item); - mScriptEd->mEditor->setText(getString("not_allowed")); + mScriptEd->setScriptText(getString("not_allowed"), FALSE); mScriptEd->mEditor->makePristine(); mScriptEd->mEditor->setEnabled(FALSE); mScriptEd->enableSave(FALSE); @@ -1758,7 +1767,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new) } else { - mScriptEd->mEditor->setText(LLStringUtil::null); + mScriptEd->setScriptText(LLStringUtil::null, FALSE); mScriptEd->mEditor->makePristine(); mAssetStatus = PREVIEW_ASSET_LOADED; } @@ -1795,7 +1804,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new) // This may be better than having a accessible null pointer around, // though this newly allocated object will most likely be replaced. mItem = new LLViewerInventoryItem(); - mScriptEd->mEditor->setText(LLStringUtil::null); + mScriptEd->setScriptText(LLStringUtil::null, FALSE); mScriptEd->mEditor->makePristine(); mScriptEd->mEditor->setEnabled(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; @@ -1803,7 +1812,7 @@ void LLLiveLSLEditor::loadAsset(BOOL is_new) } else { - mScriptEd->mEditor->setText(std::string(HELLO_LSL)); + mScriptEd->setScriptText(std::string(HELLO_LSL), TRUE); mScriptEd->enableSave(FALSE); LLPermissions perm; perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, gAgent.getGroupID()); @@ -1902,8 +1911,8 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType { LLVFile file(vfs, uuid, type); S32 file_length = file.getSize(); - char *buffer = new char[file_length + 1]; - file.read((U8*)buffer, file_length); /*Flawfinder: ignore*/ + std::vector<char> buffer(file_length + 1); + file.read((U8*)&buffer[0], file_length); if (file.getLastBytesRead() != file_length || file_length <= 0) @@ -1913,10 +1922,8 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType buffer[file_length] = '\0'; - mScriptEd->mEditor->setText(LLStringExplicit(buffer)); + mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE); mScriptEd->mEditor->makePristine(); - delete[] buffer; - } diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 7f634a48a0..eb8b414709 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -81,6 +81,8 @@ public: BOOL canClose(); + void setScriptText(const std::string& text, BOOL is_valid); + bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response); bool handleReloadFromServerDialog(const LLSD& notification, const LLSD& response); @@ -150,6 +152,7 @@ private: LLFrameTimer mLiveHelpTimer; S32 mLiveHelpHistorySize; BOOL mEnableSave; + BOOL mHasScriptData; }; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9aa5c37b26..564313980d 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -92,7 +92,6 @@ LLViewerObject* getSelectedParentObject(LLViewerObject *object) ; const S32 NUM_SELECTION_UNDO_ENTRIES = 200; const F32 SILHOUETTE_UPDATE_THRESHOLD_SQUARED = 0.02f; -const S32 OWNERSHIP_COST_PER_OBJECT = 10; // Must be the same as economy_constants.price_object_claim in the database. const S32 MAX_ACTION_QUEUE_SIZE = 20; const S32 MAX_SILS_PER_FRAME = 50; const S32 MAX_OBJECTS_PER_PACKET = 254; @@ -2620,11 +2619,6 @@ BOOL LLSelectMgr::selectGetPerm(U8 which_perm, U32* mask_on, U32* mask_off) -BOOL LLSelectMgr::selectGetOwnershipCost(S32* out_cost) -{ - return mSelectedObjects->getOwnershipCost(*out_cost); -} - BOOL LLSelectMgr::selectGetPermissions(LLPermissions& result_perm) { BOOL first = TRUE; @@ -5869,16 +5863,6 @@ BOOL LLObjectSelection::isEmpty() const return (mList.size() == 0); } -//----------------------------------------------------------------------------- -// getOwnershipCost() -//----------------------------------------------------------------------------- -BOOL LLObjectSelection::getOwnershipCost(S32 &cost) -{ - S32 count = getObjectCount(); - cost = count * OWNERSHIP_COST_PER_OBJECT; - return (count > 0); -} - //----------------------------------------------------------------------------- // getObjectCount() - returns number of non null objects diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 582a78551d..d6c4b5485d 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -275,8 +275,6 @@ public: BOOL isEmpty() const; - S32 getOwnershipCost(S32 &cost); - LLSelectNode* getFirstNode(LLSelectedNodeFunctor* func = NULL); LLSelectNode* getFirstRootNode(LLSelectedNodeFunctor* func = NULL, BOOL non_root_ok = FALSE); LLViewerObject* getFirstSelectedObject(LLSelectedNodeFunctor* func, BOOL get_parent = FALSE); @@ -552,7 +550,6 @@ public: // the value found if available. BOOL selectGetGroup(LLUUID& id); BOOL selectGetPerm( U8 which_perm, U32* mask_on, U32* mask_off); // TRUE if all have data, returns two masks, each indicating which bits are all on and all off - BOOL selectGetOwnershipCost(S32* cost); // sum of all ownership costs BOOL selectIsGroupOwned(); // TRUE if all root objects have valid data and are group owned. diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index bd2e157779..a145e965fb 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -116,6 +116,7 @@ #include "llkeyboard.h" #include "llloginhandler.h" // gLoginHandler, SLURL support #include "llpanellogin.h" +#include "llprefsim.h" #include "llmutelist.h" #include "llnotify.h" #include "llpanelavatar.h" @@ -1294,16 +1295,9 @@ bool idle_startup() if (update || gSavedSettings.getBOOL("ForceMandatoryUpdate")) { gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); - if (show_connect_box) - { - update_app(TRUE, auth_message); - LLStartUp::setStartupState( STATE_UPDATE_CHECK ); - return false; - } - else - { - quit = true; - } + update_app(TRUE, auth_message); + LLStartUp::setStartupState( STATE_UPDATE_CHECK ); + return false; } // Version update and we're not showing the dialog @@ -1976,6 +1970,9 @@ bool idle_startup() //--------------------------------------------------------------------- if (STATE_INVENTORY_SEND == LLStartUp::getStartupState()) { + // Inform simulator of our language preference + LLAgentLanguage::update(); + // unpack thin inventory LLUserAuth::options_t options; options.clear(); @@ -2291,9 +2288,6 @@ bool idle_startup() // JC - 7/20/2002 gViewerWindow->sendShapeToSim(); - // Inform simulator of our language preference - LLAgentLanguage::update(); - // Ignore stipend information for now. Money history is on the web site. // if needed, show the L$ history window @@ -2352,6 +2346,9 @@ bool idle_startup() //DEV-17797. get null folder. Any items found here moved to Lost and Found LLInventoryModel::findLostItems(); + //DEV-10530. do cleanup. remove at some later date. jan-2009 + LLPrefsIM::cleanupBadSetting(); + LLStartUp::setStartupState( STATE_PRECACHE ); timeout.reset(); return FALSE; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 971930d7ee..f36d12d638 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -628,9 +628,16 @@ void LLStatusBar::refresh() mTextParcelName->setRect(r); // Set search bar visibility - childSetVisible("search_editor", search_visible); - childSetVisible("search_btn", search_visible); - childSetVisible("menubar_search_bevel_bg", search_visible); + + if (gAgent.getCameraMode() != CAMERA_MODE_MOUSELOOK) + { + // don't monkey with search visibility in mouselook - it will be set + // with setVisibleForMouselook() below + childSetVisible("search_editor", search_visible); + childSetVisible("search_btn", search_visible); + childSetVisible("menubar_search_bevel_bg", search_visible); + } + mSGBandwidth->setVisible(! search_visible); mSGPacketLoss->setVisible(! search_visible); childSetEnabled("stat_btn", ! search_visible); @@ -643,6 +650,7 @@ void LLStatusBar::setVisibleForMouselook(bool visible) childSetVisible("buycurrency", visible); childSetVisible("search_editor", visible); childSetVisible("search_btn", visible); + childSetVisible("menubar_search_bevel_bg", visible); mSGBandwidth->setVisible(visible); mSGPacketLoss->setVisible(visible); setBackgroundVisible(visible); diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 69723f622a..a3966ed666 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1254,7 +1254,7 @@ void LLTextureCache::purgeTextures(bool validate) else if (validate) { // make sure file exists and is the correct size - S32 uuididx = entries[idx].mID.mData[0]; + U32 uuididx = entries[idx].mID.mData[0]; if (uuididx == validate_idx) { LL_DEBUGS("TextureCache") << "Validating: " << filename << "Size: " << entries[idx].mSize << LL_ENDL; diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index da9f3c5bd7..6a3ada0474 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -65,7 +65,6 @@ LLTool::~LLTool() } } - BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask) { if (gDebugClicks) @@ -125,6 +124,20 @@ BOOL LLTool::handleRightMouseUp(S32 x, S32 y, MASK mask) // llinfos << "LLTool::handleRightMouseDown" << llendl; return FALSE; } + +BOOL LLTool::handleMiddleMouseDown(S32 x,S32 y,MASK mask) +{ + // by default, didn't handle it + // llinfos << "LLTool::handleMiddleMouseDown" << llendl; + return FALSE; +} + +BOOL LLTool::handleMiddleMouseUp(S32 x, S32 y, MASK mask) +{ + // by default, didn't handle it + // llinfos << "LLTool::handleMiddleMouseUp" << llendl; + return FALSE; +} BOOL LLTool::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) { diff --git a/indra/newview/lltool.h b/indra/newview/lltool.h index 249088fd3d..f954a8c243 100644 --- a/indra/newview/lltool.h +++ b/indra/newview/lltool.h @@ -57,6 +57,9 @@ public: // Virtual functions inherited from LLMouseHandler virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask); + virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 351c02b4c0..4e8274a6ef 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -128,8 +128,8 @@ BOOL LLToolCamera::handleMouseDown(S32 x, S32 y, MASK mask) gViewerWindow->hideCursor(); gViewerWindow->pickAsync(x, y, mask, pickCallback); - // don't steal focus from UI - return FALSE; + + return TRUE; } void LLToolCamera::pickCallback(const LLPickInfo& pick_info) diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index ed9ca851d3..d9811dac6c 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -210,22 +210,29 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info) if (!objectp->usePhysics()) { - // In mouselook, we shouldn't be able to grab non-physical, - // non-touchable objects. If it has a touch handler, we - // do grab it (so llDetectedGrab works), but movement is - // blocked on the server side. JC - if (gAgent.cameraMouselook() && !script_touch) + if (script_touch) { - mMode = GRAB_LOCKED; - gViewerWindow->hideCursor(); - gViewerWindow->moveCursorToCenter(); + mMode = GRAB_NONPHYSICAL; // if it has a script, use the non-physical grab } else { - mMode = GRAB_NONPHYSICAL; + // In mouselook, we shouldn't be able to grab non-physical, + // non-touchable objects. If it has a touch handler, we + // do grab it (so llDetectedGrab works), but movement is + // blocked on the server side. JC + if (gAgent.cameraMouselook()) + { + mMode = GRAB_LOCKED; + } + else + { + mMode = GRAB_ACTIVE_CENTER; + } + + gViewerWindow->hideCursor(); + gViewerWindow->moveCursorToCenter(); + } - // Don't bail out here, go on and grab so buttons can get - // their "touched" event. } else if( !objectp->permMove() ) { diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 8e81152a89..d54cc798d2 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -294,6 +294,7 @@ void LLTracker::trackAvatar( const LLUUID& avatar_id, const std::string& name ) LLAvatarTracker::instance().track( avatar_id, name ); instance()->mTrackingStatus = TRACKING_AVATAR; instance()->mLabel = name; + instance()->mToolTip = ""; } @@ -309,6 +310,7 @@ void LLTracker::trackLandmark( const LLUUID& asset_id, const LLUUID& item_id, co instance()->cacheLandmarkPosition(); instance()->mTrackingStatus = TRACKING_LANDMARK; instance()->mLabel = name; + instance()->mToolTip = ""; } diff --git a/indra/newview/lluploaddialog.cpp b/indra/newview/lluploaddialog.cpp index 2ba87f01bd..7f63972c8d 100644 --- a/indra/newview/lluploaddialog.cpp +++ b/indra/newview/lluploaddialog.cpp @@ -103,18 +103,10 @@ void LLUploadDialog::setMessage( const std::string& msg) S32 max_msg_width = 0; std::list<std::string> msg_lines; - S32 size = msg.size() + 1;// + strlen("Uploading...\n\n"); - char* temp_msg = new char[size]; - - //strcpy(temp_msg,"Uploading...\n\n"); - if (temp_msg == NULL) - { - llerrs << "Memory Allocation Failed" << llendl; - return; - } - - strcpy( temp_msg, msg.c_str()); /* Flawfinder: ignore */ - char* token = strtok( temp_msg, "\n" ); + S32 size = msg.size() + 1; + std::vector<char> temp_msg(size); // non-const copy to make strtok happy + strcpy( &temp_msg[0], msg.c_str()); + char* token = strtok( &temp_msg[0], "\n" ); while( token ) { std::string tokstr(token); @@ -123,8 +115,6 @@ void LLUploadDialog::setMessage( const std::string& msg) msg_lines.push_back( tokstr ); token = strtok( NULL, "\n" ); } - delete[] temp_msg; - S32 line_height = S32( font->getLineHeight() + 0.99f ); S32 dialog_width = max_msg_width + 2 * HPAD; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 2c487665d2..eb8cdd82b3 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -63,6 +63,7 @@ #include "llviewerparcelmgr.h" #include "llparcel.h" #include "llnotify.h" +#include "lloverlaybar.h" #include "llkeyboard.h" #include "llerrorcontrol.h" #include "llversionviewer.h" @@ -269,17 +270,21 @@ static bool handleAudioStreamMusicChanged(const LLSD& newvalue) if (LLViewerParcelMgr::getInstance()->getAgentParcel() && !LLViewerParcelMgr::getInstance()->getAgentParcel()->getMusicURL().empty()) { - // if stream is already playing, don't call this - // otherwise music will briefly stop - if ( !gAudiop->isInternetStreamPlaying() ) + // if music isn't playing, start it + if (gOverlayBar && !gOverlayBar->musicPlaying()) { - gAudiop->startInternetStream(LLViewerParcelMgr::getInstance()->getAgentParcel()->getMusicURL()); + LLOverlayBar::toggleMusicPlay(NULL); } } } else { - gAudiop->stopInternetStream(); + // if music is playing, stop it. + if (gOverlayBar && gOverlayBar->musicPlaying()) + { + LLOverlayBar::toggleMusicPlay(NULL); + } + } } return true; diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 652e50e20c..9f7e4d338b 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -992,6 +992,13 @@ void LLViewerJoystick::scanJoystick() #endif updateStatus(); + // App focus check Needs to happen AFTER updateStatus in case the joystick + // is not centred when the app loses focus. + if (!gFocusMgr.getAppHasFocus()) + { + return; + } + static long toggle_flycam = 0; if (mBtn[0] == 1) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 96a4f74927..4fd0c8dc8a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -762,7 +762,7 @@ void init_client_menu(LLMenuGL* menu) /*menu->append(new LLMenuItemCallGL("Reload settings/colors", &handle_reload_settings, NULL, NULL));*/ menu->append(new LLMenuItemCallGL("Reload personal setting overrides", - &reload_personal_settings_overrides, NULL, NULL, KEY_F2, MASK_CONTROL|MASK_SHIFT)); + &reload_personal_settings_overrides, NULL, NULL, KEY_F12, MASK_CONTROL|MASK_SHIFT)); sub_menu = new LLMenuGL("HUD Info"); { @@ -1084,94 +1084,95 @@ void init_debug_rendering_menu(LLMenuGL* menu) // sub_menu = new LLMenuGL("Types"); menu->appendMenu(sub_menu); - + sub_menu->append(new LLMenuItemCheckGL("Simple", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_SIMPLE, '1', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_SIMPLE, '1', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Alpha", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_ALPHA, '2', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_ALPHA, '2', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Tree", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_TREE, '3', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_TREE, '3', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Character", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_AVATAR, '4', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_AVATAR, '4', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("SurfacePatch", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_TERRAIN, '5', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_TERRAIN, '5', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Sky", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_SKY, '6', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_SKY, '6', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Water", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_WATER, '7', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_WATER, '7', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Ground", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_GROUND, '8', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_GROUND, '8', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Volume", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_VOLUME, '9', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_VOLUME, '9', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Grass", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_GRASS, '0', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_GRASS, '0', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Clouds", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_CLOUDS, '-', MASK_CONTROL|MASK_ALT| MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_CLOUDS, '-', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Particles", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_PARTICLES, '=', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_PARTICLES, '`', MASK_ALT|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Bump", &LLPipeline::toggleRenderTypeControl, NULL, &LLPipeline::hasRenderTypeControl, - (void*)LLPipeline::RENDER_TYPE_BUMP, '\\', MASK_CONTROL|MASK_ALT|MASK_SHIFT)); + (void*)LLPipeline::RENDER_TYPE_BUMP, '\\', MASK_ALT|MASK_SHIFT)); + sub_menu->createJumpKeys(); sub_menu = new LLMenuGL("Features"); menu->appendMenu(sub_menu); sub_menu->append(new LLMenuItemCheckGL("UI", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_UI, KEY_F1, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_UI, KEY_F1, MASK_CONTROL|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Selected", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_SELECTED, KEY_F2, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_SELECTED, KEY_F2, MASK_CONTROL|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Highlighted", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_HIGHLIGHTED, KEY_F3, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_HIGHLIGHTED, KEY_F3, MASK_CONTROL|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Dynamic Textures", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES, KEY_F4, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES, KEY_F4, MASK_CONTROL|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL( "Foot Shadows", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS, KEY_F5, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS, KEY_F5, MASK_CONTROL|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Fog", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOG, KEY_F6, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOG, KEY_F6, MASK_CONTROL|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL("Test FRInfo", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FR_INFO, KEY_F8, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_FR_INFO, KEY_F8, MASK_CONTROL|MASK_SHIFT)); sub_menu->append(new LLMenuItemCheckGL( "Flexible Objects", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE, KEY_F9, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE, KEY_F9, MASK_CONTROL|MASK_SHIFT)); sub_menu->createJumpKeys(); ///////////////////////////// @@ -1328,8 +1329,11 @@ void init_debug_avatar_menu(LLMenuGL* menu) menu->appendMenu(sub_menu); sub_menu = new LLMenuGL("Character Tests"); - sub_menu->append(new LLMenuItemToggleGL("Go Away/AFK When Idle", - &gAllowIdleAFK)); + sub_menu->append(new LLMenuItemCheckGL("Go Away/AFK When Idle", + menu_toggle_control, + NULL, + menu_check_control, + (void*)"AllowIdleAFK")); sub_menu->append(new LLMenuItemCallGL("Appearance To XML", &LLVOAvatar::dumpArchetypeXML)); @@ -4730,25 +4734,29 @@ class LLWorldSetBusy : public view_listener_t } }; +bool can_create_landmark() +{ + BOOL can = FALSE; + + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (agent_parcel) + { + + if (agent_parcel->getAllowLandmark() + || LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) + { + can = TRUE; + } + } + + return can; +} class LLWorldCreateLandmark : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - LLViewerRegion* agent_region = gAgent.getRegion(); - if(!agent_region) - { - llwarns << "No agent region" << llendl; - return true; - } - LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (!agent_parcel) - { - llwarns << "No agent parcel" << llendl; - return true; - } - if (!agent_parcel->getAllowLandmark() - && !LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) + if (!can_create_landmark()) { LLNotifications::instance().add("CannotCreateLandmarkNotOwner"); return true; @@ -6284,25 +6292,28 @@ class LLToolsEnableTakeCopy : public view_listener_t bool all_valid = false; if (LLSelectMgr::getInstance()) { - all_valid = true; + if (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) + { + all_valid = true; #ifndef HACKED_GODLIKE_VIEWER # ifdef TOGGLE_HACKED_GODLIKE_VIEWER - if (LLViewerLogin::getInstance()->isInProductionGrid() - || !gAgent.isGodlike()) + if (LLViewerLogin::getInstance()->isInProductionGrid() + || !gAgent.isGodlike()) # endif - { - struct f : public LLSelectedObjectFunctor { - virtual bool apply(LLViewerObject* obj) + struct f : public LLSelectedObjectFunctor { - return (!obj->permCopy() || obj->isAttachment()); - } - } func; - const bool firstonly = true; - bool any_invalid = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); - all_valid = !any_invalid; - } + virtual bool apply(LLViewerObject* obj) + { + return (!obj->permCopy() || obj->isAttachment()); + } + } func; + const bool firstonly = true; + bool any_invalid = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); + all_valid = !any_invalid; + } #endif // HACKED_GODLIKE_VIEWER + } } gMenuHolder->findControl(userdata["control"].asString())->setValue(all_valid); @@ -6496,9 +6507,10 @@ class LLWorldEnableCreateLandmark : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - bool new_value = gAgent.isGodlike() || - (gAgent.getRegion() && gAgent.getRegion()->getAllowLandmark()); + bool new_value = can_create_landmark(); + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); + return true; } }; @@ -7544,8 +7556,8 @@ void initialize_menus() addMenu(new LLToolsEnableUnlink(), "Tools.EnableUnlink"); addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake"); addMenu(new LLToolsEnableTakeCopy(), "Tools.EnableTakeCopy"); - addMenu(new LLToolsEnableSaveToInventory(), "Tools.SaveToInventory"); - addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.SaveToObjectInventory"); + addMenu(new LLToolsEnableSaveToInventory(), "Tools.EnableSaveToInventory"); + addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory"); /*addMenu(new LLToolsVisibleBuyObject(), "Tools.VisibleBuyObject"); addMenu(new LLToolsVisibleTakeObject(), "Tools.VisibleTakeObject");*/ diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 2925916e2a..5240fd3211 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -658,7 +658,7 @@ void upload_new_resource(const std::string& src_filename, std::string name, { // read in the file header char buf[16384]; /* Flawfinder: ignore */ - S32 read; /* Flawfinder: ignore */ + size_t readbytes; S32 version; if (fscanf(in, "LindenResource\nversion %d\n", &version)) { @@ -741,9 +741,9 @@ void upload_new_resource(const std::string& src_filename, std::string name, LLFILE* out = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */ if (out) { - while((read = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */ + while((readbytes = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */ { - if (fwrite(buf, 1, read, out) != read) + if (fwrite(buf, 1, readbytes, out) != readbytes) { llwarns << "Short write" << llendl; } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6ffb19bcdf..088ba62d0c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1343,27 +1343,6 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) LLNotifications::instance().add(p); } - -bool group_vote_callback(const LLSD& notification, const LLSD& response) -{ - LLUUID group_id = notification["payload"]["group_id"].asUUID(); - S32 option = LLNotification::getSelectedOption(notification, response); - switch(option) - { - case 0: - // Vote Now - // Open up the voting tab - LLFloaterGroupInfo::showFromUUID(group_id, "voting_tab"); - break; - default: - // Vote Later or - // close button - break; - } - return false; -} -static LLNotificationFunctorRegistration group_vote_callback_reg("GroupVote", group_vote_callback); - bool lure_callback(const LLSD& notification, const LLSD& response) { S32 option = 0; @@ -1514,7 +1493,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // initiated by the other party) then... std::string my_name; gAgent.buildFullname(my_name); - std::string response = gSavedPerAccountSettings.getText("BusyModeResponse"); + std::string response = gSavedPerAccountSettings.getString("BusyModeResponse2"); pack_instant_message( gMessageSystem, gAgent.getID(), @@ -1847,17 +1826,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLNotifications::instance().add("InventoryDeclined", args); break; } + // TODO: _DEPRECATED suffix as part of vote removal - DEV-24856 case IM_GROUP_VOTE: - { - LLSD args; - args["NAME"] = name; - args["MESSAGE"] = message; - - LLSD payload; - payload["group_id"] = session_id; - LLNotifications::instance().add("GroupVote", args, payload); - } - break; + { + LL_WARNS("Messaging") << "Received IM: IM_GROUP_VOTE_DEPRECATED" << LL_ENDL; + } + break; case IM_GROUP_ELECTION_DEPRECATED: { @@ -2113,7 +2087,7 @@ void busy_message (LLMessageSystem* msg, LLUUID from_id) { std::string my_name; gAgent.buildFullname(my_name); - std::string response = gSavedPerAccountSettings.getText("BusyModeResponse"); + std::string response = gSavedPerAccountSettings.getString("BusyModeResponse2"); pack_instant_message( gMessageSystem, gAgent.getID(), @@ -4362,11 +4336,11 @@ void mean_name_callback(const LLUUID &id, const std::string& first, const std::s return; } - static const int max_collision_list_size = 20; + static const U32 max_collision_list_size = 20; if (gMeanCollisionList.size() > max_collision_list_size) { mean_collision_list_t::iterator iter = gMeanCollisionList.begin(); - for (S32 i=0; i<max_collision_list_size; i++) iter++; + for (U32 i=0; i<max_collision_list_size; i++) iter++; for_each(iter, gMeanCollisionList.end(), DeletePointer()); gMeanCollisionList.erase(iter, gMeanCollisionList.end()); } @@ -5217,17 +5191,22 @@ static LLNotificationFunctorRegistration callback_script_dialog_reg_2("ScriptDia void process_script_dialog(LLMessageSystem* msg, void**) { S32 i; - LLSD payload; + LLUUID object_id; + msg->getUUID("Data", "ObjectID", object_id); + + if (LLMuteList::getInstance()->isMuted(object_id)) + { + return; + } + std::string message; std::string first_name; std::string last_name; std::string title; - LLUUID object_id; S32 chat_channel; - msg->getUUID("Data", "ObjectID", object_id); msg->getString("Data", "FirstName", first_name); msg->getString("Data", "LastName", last_name); msg->getString("Data", "ObjectName", title); @@ -5526,25 +5505,18 @@ void onCovenantLoadComplete(LLVFS *vfs, S32 file_length = file.getSize(); - char* buffer = new char[file_length+1]; - if (buffer == NULL) - { - LL_ERRS("Messaging") << "Memory Allocation failed" << LL_ENDL; - return; - } - - file.read((U8*)buffer, file_length); /* Flawfinder: ignore */ - + std::vector<char> buffer(file_length+1); + file.read((U8*)&buffer[0], file_length); // put a EOS at the end - buffer[file_length] = 0; + buffer[file_length] = '\0'; - if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) + if( (file_length > 19) && !strncmp( &buffer[0], "Linden text version", 19 ) ) { LLViewerTextEditor* editor = new LLViewerTextEditor(std::string("temp"), LLRect(0,0,0,0), file_length+1); - if( !editor->importBuffer( buffer, file_length+1 ) ) + if( !editor->importBuffer( &buffer[0], file_length+1 ) ) { LL_WARNS("Messaging") << "Problem importing estate covenant." << LL_ENDL; covenant_text = "Problem importing estate covenant."; @@ -5554,7 +5526,6 @@ void onCovenantLoadComplete(LLVFS *vfs, // Version 0 (just text, doesn't include version number) covenant_text = editor->getText(); } - delete[] buffer; delete editor; } else diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index d7313c1653..32c89e158c 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2441,7 +2441,11 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data) msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, object->mInventorySerialNum); LLFilenameAndTask* ft = new LLFilenameAndTask; ft->mTaskID = task_id; - msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, ft->mFilename); + + std::string unclean_filename; + msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, unclean_filename); + ft->mFilename = LLDir::getScrubbedFileName(unclean_filename); + if(ft->mFilename.empty()) { lldebugs << "Task has no inventory" << llendl; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 194029398d..07203ce0f4 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -650,10 +650,9 @@ BOOL LLViewerParcelMgr::agentCanBuild() const { if (mAgentParcel) { - return (gAgent.isGodlike() - || (mAgentParcel->allowModifyBy( - gAgent.getID(), - gAgent.getGroupID()))); + return (gAgent.isGodlike() || + (mAgentParcel->allowModifyBy(gAgent.getID(), gAgent.getGroupID())) || + (isParcelOwnedByAgent(mAgentParcel, GP_LAND_ALLOW_CREATE))); } else { diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 750151ea2d..44d0304533 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -318,7 +318,7 @@ void LLViewerRegion::loadCache() LLUUID cache_id; nread = fread(&cache_id.mData, 1, UUID_BYTES, fp); - if (nread != UUID_BYTES || mCacheID != cache_id) + if (nread != (size_t)UUID_BYTES || mCacheID != cache_id) { llinfos << "Cache ID doesn't match for this region, discarding" << llendl; @@ -394,7 +394,7 @@ void LLViewerRegion::saveCache() } // write the cache id for this sim - if (fwrite(&mCacheID.mData, 1, UUID_BYTES, fp) != UUID_BYTES) + if (fwrite(&mCacheID.mData, 1, UUID_BYTES, fp) != (size_t)UUID_BYTES) { llwarns << "Short write" << llendl; } @@ -1387,11 +1387,12 @@ void LLViewerRegion::unpackRegionHandshake() void LLViewerRegion::setSeedCapability(const std::string& url) { - if (getCapability("Seed") == url) + if (getCapability("Seed") == url) { - llwarns << "Ignoring duplicate seed capability" << llendl; - return; + // llwarns << "Ignoring duplicate seed capability" << llendl; + return; } + delete mEventPoll; mEventPoll = NULL; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 1fd31a013a..728509e39c 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -894,51 +894,9 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask) BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) { - BOOL handled = FALSE; - - // let scrollbar have first dibs - handled = LLView::childrenHandleMouseUp(x, y, mask) != NULL; - - // Used to enable I Agree checkbox if the user scrolled through entire text - BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); - if (mOnScrollEndCallback && was_scrolled_to_bottom) - { - mOnScrollEndCallback(mOnScrollEndData); - } - - if( !handled && mTakesNonScrollClicks) - { - if( mIsSelecting ) - { - // Finish selection - if( y > getTextRect().mTop ) - { - mScrollbar->setDocPos( mScrollbar->getDocPos() - 1 ); - } - else - if( y < getTextRect().mBottom ) - { - mScrollbar->setDocPos( mScrollbar->getDocPos() + 1 ); - } - - setCursorAtLocalPos( x, y, TRUE ); - endSelection(); - - updateScrollFromCursor(); - } - - if( !hasSelection() ) - { - handleMouseUpOverSegment( x, y, mask ); - } - - handled = TRUE; - } - - // Delay cursor flashing - resetKeystrokeTimer(); + BOOL handled = FALSE; - if( hasMouseCapture() ) + if( hasMouseCapture() ) { if (mDragItem) { @@ -957,8 +915,15 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) } } mDragItem = NULL; - gFocusMgr.setMouseCapture( NULL ); - handled = TRUE; + } + + handled = LLTextEditor::handleMouseUp(x,y,mask); + + // Used to enable I Agree checkbox if the user scrolled through entire text + BOOL was_scrolled_to_bottom = (mScrollbar->getDocPos() == mScrollbar->getDocPosMax()); + if (mOnScrollEndCallback && was_scrolled_to_bottom) + { + mOnScrollEndCallback(mOnScrollEndData); } return handled; @@ -1000,6 +965,24 @@ BOOL LLViewerTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) return handled; } +BOOL LLViewerTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) +{ + BOOL handled = FALSE; + handled = childrenHandleMiddleMouseDown(x, y, mask) != NULL; + if (!handled) + { + handled = LLTextEditor::handleMiddleMouseDown(x, y, mask); + } + return handled; +} + +BOOL LLViewerTextEditor::handleMiddleMouseUp(S32 x, S32 y, MASK mask) +{ + BOOL handled = childrenHandleMiddleMouseUp(x, y, mask) != NULL; + + return handled; +} + BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; @@ -1022,7 +1005,6 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) } } } - setCursorAtLocalPos( x, y, FALSE ); deselect(); @@ -1060,6 +1042,9 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) // delay cursor flashing resetKeystrokeTimer(); + // take selection to 'primary' clipboard + updatePrimary(); + handled = TRUE; } return handled; diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index 0aa9164c90..1ed60a57fe 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -59,6 +59,8 @@ public: // mousehandler overrides virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask ); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 71406d268d..26ddf213d2 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -589,19 +589,46 @@ bool LLViewerWindow::shouldShowToolTipFor(LLMouseHandler *mh) return false; } -BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask) +BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down) { + std::string buttonname; + std::string buttonstatestr; + BOOL handled = FALSE; S32 x = pos.mX; S32 y = pos.mY; x = llround((F32)x / mDisplayScale.mV[VX]); y = llround((F32)y / mDisplayScale.mV[VY]); - LLView::sMouseHandlerMessage.clear(); - - if (gDebugClicks) + if (down) + { + buttonstatestr = "down" ; + } + else { - llinfos << "ViewerWindow left mouse down at " << x << "," << y << llendl; + buttonstatestr = "up" ; } + + switch (clicktype) + { + case LLMouseHandler::CLICK_LEFT: + mLeftMouseDown = down; + buttonname = "Left"; + break; + case LLMouseHandler::CLICK_RIGHT: + mRightMouseDown = down; + buttonname = "Right"; + break; + case LLMouseHandler::CLICK_MIDDLE: + mMiddleMouseDown = down; + buttonname = "Middle"; + break; + case LLMouseHandler::CLICK_DOUBLELEFT: + mLeftMouseDown = down; + buttonname = "Left Double Click"; + break; + } + + LLView::sMouseHandlerMessage.clear(); if (gMenuBarView) { @@ -609,18 +636,24 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask gMenuBarView->resetMenuTrigger(); } - mLeftMouseDown = TRUE; + if (gDebugClicks) + { + llinfos << "ViewerWindow " << buttonname << " mouse " << buttonstatestr << " at " << x << "," << y << llendl; + } - // Make sure we get a coresponding mouseup event, even if the mouse leaves the window - mWindow->captureMouse(); + // Make sure we get a corresponding mouseup event, even if the mouse leaves the window + if (down) + mWindow->captureMouse(); + else + mWindow->releaseMouse(); // Indicate mouse was active gMouseIdleTimer.reset(); // Hide tooltips on mousedown - mToolTipBlocked = TRUE; + mToolTipBlocked = down; - // Also hide hover info on mousedown + // Also hide hover info on mousedown/mouseup if (gHoverView) { gHoverView->cancelHover(); @@ -629,7 +662,7 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask // Don't let the user move the mouse out of the window until mouse up. if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) { - mWindow->setMouseClipping(TRUE); + mWindow->setMouseClipping(down); } LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); @@ -640,10 +673,9 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); if (LLView::sDebugMouseHandling) { - llinfos << "Left Mouse Down handled by captor " << mouse_captor->getName() << llendl; + llinfos << buttonname << " Mouse " << buttonstatestr << " handled by captor " << mouse_captor->getName() << llendl; } - - return mouse_captor->handleMouseDown(local_x, local_y, mask); + return mouse_captor->handleAnyMouseClick(local_x, local_y, mask, clicktype, down); } // Topmost view gets a chance before the hierarchy @@ -652,215 +684,99 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask { S32 local_x, local_y; top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); - if (top_ctrl->pointInView(local_x, local_y)) + if (down) { - return top_ctrl->handleMouseDown(local_x, local_y, mask); + if (top_ctrl->pointInView(local_x, local_y)) + { + return top_ctrl->handleAnyMouseClick(local_x, local_y, mask, clicktype, down) ; + } + else + { + gFocusMgr.setTopCtrl(NULL); + } } else { - gFocusMgr.setTopCtrl(NULL); + handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask); } } // Give the UI views a chance to process the click - if( mRootView->handleMouseDown(x, y, mask) ) + if( mRootView->handleAnyMouseClick(x, y, mask, clicktype, down) ) { if (LLView::sDebugMouseHandling) { - llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl; + llinfos << buttonname << " Mouse " << buttonstatestr << " " << LLView::sMouseHandlerMessage << llendl; } return TRUE; } else if (LLView::sDebugMouseHandling) { - llinfos << "Left Mouse Down not handled by view" << llendl; - } - - if (gDisconnected) - { - return FALSE; + llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl; } - if(LLToolMgr::getInstance()->getCurrentTool()->handleMouseDown( x, y, mask ) ) + if (down) { - // This is necessary to force clicks in the world to cause edit - // boxes that might have keyboard focus to relinquish it, and hence - // cause a commit to update their value. JC - gFocusMgr.setKeyboardFocus(NULL); - return TRUE; - } - - return FALSE; -} - -BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask) -{ - S32 x = pos.mX; - S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); - - LLView::sMouseHandlerMessage.clear(); - - if (gDebugClicks) - { - llinfos << "ViewerWindow left mouse double-click at " << x << "," << y << llendl; - } - - mLeftMouseDown = TRUE; - - // Hide tooltips - if( mToolTip ) - { - mToolTip->setVisible( FALSE ); - } - - LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); - if( mouse_captor ) - { - S32 local_x; - S32 local_y; - mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); - if (LLView::sDebugMouseHandling) + if (gDisconnected) { - llinfos << "Left Mouse Down handled by captor " << mouse_captor->getName() << llendl; + return FALSE; + } + + if(LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) ) + { + // This is necessary to force clicks in the world to cause edit + // boxes that might have keyboard focus to relinquish it, and hence + // cause a commit to update their value. JC + gFocusMgr.setKeyboardFocus(NULL); + return TRUE; } - - return mouse_captor->handleDoubleClick(local_x, local_y, mask); } - - // Check for hit on UI. - LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); - if (top_ctrl) + else { - S32 local_x, local_y; - top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); - if (top_ctrl->pointInView(local_x, local_y)) + if( !handled ) { - return top_ctrl->handleDoubleClick(local_x, local_y, mask); + handled = mRootView->handleAnyMouseClick(x, y, mask, clicktype, down); } - else + + if( !handled ) { - gFocusMgr.setTopCtrl(NULL); + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); + if (tool) + { + handled = tool->handleAnyMouseClick(x, y, mask, clicktype, down); + } } } - if (mRootView->handleDoubleClick(x, y, mask)) - { - if (LLView::sDebugMouseHandling) - { - llinfos << "Left Mouse Down" << LLView::sMouseHandlerMessage << llendl; - } - return TRUE; - } - else if (LLView::sDebugMouseHandling) - { - llinfos << "Left Mouse Down not handled by view" << llendl; - } + // If we got this far on a down-click, it wasn't handled. + // Up-clicks, though, are always handled as far as the OS is concerned. + BOOL default_rtn = !down; + return default_rtn; +} - // Why is this here? JC 9/3/2002 - if (gNoRender) - { - return TRUE; - } +BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask) +{ + BOOL down = TRUE; + return handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_LEFT,down); +} - if(LLToolMgr::getInstance()->getCurrentTool()->handleDoubleClick( x, y, mask ) ) +BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask) +{ + // try handling as a double-click first, then a single-click if that + // wasn't handled. + BOOL down = TRUE; + if (handleAnyMouseClick(window, pos, mask, + LLMouseHandler::CLICK_DOUBLELEFT, down)) { return TRUE; } - - // if we got this far and nothing handled a double click, pass a normal mouse down return handleMouseDown(window, pos, mask); } BOOL LLViewerWindow::handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) { - S32 x = pos.mX; - S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); - - LLView::sMouseHandlerMessage.clear(); - - if (gDebugClicks) - { - llinfos << "ViewerWindow left mouse up" << llendl; - } - - mLeftMouseDown = FALSE; - - // Indicate mouse was active - gMouseIdleTimer.reset(); - - // Hide tooltips on mouseup - if( mToolTip ) - { - mToolTip->setVisible( FALSE ); - } - - // Also hide hover info on mouseup - if (gHoverView) gHoverView->cancelHover(); - - BOOL handled = FALSE; - - mWindow->releaseMouse(); - - LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - - if( tool->clipMouseWhenDown() ) - { - mWindow->setMouseClipping(FALSE); - } - - LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); - if( mouse_captor ) - { - S32 local_x; - S32 local_y; - mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); - if (LLView::sDebugMouseHandling) - { - llinfos << "Left Mouse Up handled by captor " << mouse_captor->getName() << llendl; - } - - return mouse_captor->handleMouseUp(local_x, local_y, mask); - } - - LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); - if (top_ctrl) - { - S32 local_x, local_y; - top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); - handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask); - } - - if( !handled ) - { - handled = mRootView->handleMouseUp(x, y, mask); - } - - if (LLView::sDebugMouseHandling) - { - if (handled) - { - llinfos << "Left Mouse Up" << LLView::sMouseHandlerMessage << llendl; - } - else - { - llinfos << "Left Mouse Up not handled by view" << llendl; - } - } - - if( !handled ) - { - if (tool) - { - handled = tool->handleMouseUp(x, y, mask); - } - } - - // Always handled as far as the OS is concerned. - return TRUE; + BOOL down = FALSE; + return handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_LEFT,down); } @@ -871,91 +787,10 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK x = llround((F32)x / mDisplayScale.mV[VX]); y = llround((F32)y / mDisplayScale.mV[VY]); - LLView::sMouseHandlerMessage.clear(); - - if (gDebugClicks) - { - llinfos << "ViewerWindow right mouse down at " << x << "," << y << llendl; - } - - if (gMenuBarView) - { - // stop ALT-key access to menu - gMenuBarView->resetMenuTrigger(); - } - - mRightMouseDown = TRUE; - - // Make sure we get a coresponding mouseup event, even if the mouse leaves the window - mWindow->captureMouse(); - - // Hide tooltips - if( mToolTip ) - { - mToolTip->setVisible( FALSE ); - } - - // Also hide hover info on mousedown - if (gHoverView) - { - gHoverView->cancelHover(); - } - - // Don't let the user move the mouse out of the window until mouse up. - if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) - { - mWindow->setMouseClipping(TRUE); - } - - LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); - if( mouse_captor ) - { - S32 local_x; - S32 local_y; - mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); - if (LLView::sDebugMouseHandling) - { - llinfos << "Right Mouse Down handled by captor " << mouse_captor->getName() << llendl; - } - return mouse_captor->handleRightMouseDown(local_x, local_y, mask); - } - - LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); - if (top_ctrl) - { - S32 local_x, local_y; - top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); - if (top_ctrl->pointInView(local_x, local_y)) - { - return top_ctrl->handleRightMouseDown(local_x, local_y, mask); - } - else - { - gFocusMgr.setTopCtrl(NULL); - } - } - - if( mRootView->handleRightMouseDown(x, y, mask) ) - { - if (LLView::sDebugMouseHandling) - { - llinfos << "Right Mouse Down" << LLView::sMouseHandlerMessage << llendl; - } - return TRUE; - } - else if (LLView::sDebugMouseHandling) - { - llinfos << "Right Mouse Down not handled by view" << llendl; - } - - if(LLToolMgr::getInstance()->getCurrentTool()->handleRightMouseDown( x, y, mask ) ) - { - // This is necessary to force clicks in the world to cause edit - // boxes that might have keyboard focus to relinquish it, and hence - // cause a commit to update their value. JC - gFocusMgr.setKeyboardFocus(NULL); - return TRUE; - } + BOOL down = TRUE; + BOOL handle = handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_RIGHT,down); + if (handle) + return handle; // *HACK: this should be rolled into the composite tool logic, not // hardcoded at the top level. @@ -973,107 +808,27 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK BOOL LLViewerWindow::handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) { - S32 x = pos.mX; - S32 y = pos.mY; - x = llround((F32)x / mDisplayScale.mV[VX]); - y = llround((F32)y / mDisplayScale.mV[VY]); - - LLView::sMouseHandlerMessage.clear(); - - // Don't care about caps lock for mouse events. - if (gDebugClicks) - { - llinfos << "ViewerWindow right mouse up" << llendl; - } - - mRightMouseDown = FALSE; - - // Indicate mouse was active - gMouseIdleTimer.reset(); - - // Hide tooltips on mouseup - if( mToolTip ) - { - mToolTip->setVisible( FALSE ); - } - - // Also hide hover info on mouseup - if (gHoverView) gHoverView->cancelHover(); - - BOOL handled = FALSE; - - mWindow->releaseMouse(); - - LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - - if( tool->clipMouseWhenDown() ) - { - mWindow->setMouseClipping(FALSE); - } - - LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); - if( mouse_captor ) - { - S32 local_x; - S32 local_y; - mouse_captor->screenPointToLocal( x, y, &local_x, &local_y ); - if (LLView::sDebugMouseHandling) - { - llinfos << "Right Mouse Up handled by captor " << mouse_captor->getName() << llendl; - } - return mouse_captor->handleRightMouseUp(local_x, local_y, mask); - } - - LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); - if (top_ctrl) - { - S32 local_x, local_y; - top_ctrl->screenPointToLocal( x, y, &local_x, &local_y ); - handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleRightMouseUp(local_x, local_y, mask); - } - - if( !handled ) - { - handled = mRootView->handleRightMouseUp(x, y, mask); - } - - if (LLView::sDebugMouseHandling) - { - if (handled) - { - llinfos << "Right Mouse Up" << LLView::sMouseHandlerMessage << llendl; - } - else - { - llinfos << "Right Mouse Up not handled by view" << llendl; - } - } - - if( !handled ) - { - if (tool) - { - handled = tool->handleRightMouseUp(x, y, mask); - } - } - - // Always handled as far as the OS is concerned. - return TRUE; + BOOL down = FALSE; + return handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_RIGHT,down); } BOOL LLViewerWindow::handleMiddleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask) { + BOOL down = TRUE; gVoiceClient->middleMouseState(true); - - // Always handled as far as the OS is concerned. + handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_MIDDLE,down); + + // Always handled as far as the OS is concerned. return TRUE; } - + BOOL LLViewerWindow::handleMiddleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) { + BOOL down = FALSE; gVoiceClient->middleMouseState(false); - - // Always handled as far as the OS is concerned. + handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_MIDDLE,down); + + // Always handled as far as the OS is concerned. return TRUE; } @@ -1279,7 +1034,7 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated) else { mActive = FALSE; - if (gAllowIdleAFK) + if (gSavedSettings.getBOOL("AllowIdleAFK")) { gAgent.setAFK(); } @@ -1447,6 +1202,7 @@ LLViewerWindow::LLViewerWindow( mWindowRect(0, height, width, 0), mVirtualWindowRect(0, height, width, 0), mLeftMouseDown(FALSE), + mMiddleMouseDown(FALSE), mRightMouseDown(FALSE), mToolTip(NULL), mToolTipBlocked(FALSE), @@ -5288,11 +5044,15 @@ void LLPickInfo::fetchResults() // put global position into land_pos LLVector3d land_pos; - if (gViewerWindow->mousePointOnLandGlobal(mPickPt.mX, mPickPt.mY, &land_pos)) + if (!gViewerWindow->mousePointOnLandGlobal(mPickPt.mX, mPickPt.mY, &land_pos)) { - // Fudge the land focus a little bit above ground. - mPosGlobal = land_pos + LLVector3d::z_axis * 0.1f; + // The selected point is beyond the draw distance or is otherwise + // not selectable. Return before calling mPickCallback(). + return; } + + // Fudge the land focus a little bit above ground. + mPosGlobal = land_pos + LLVector3d::z_axis * 0.1f; } else { diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 1520e779ab..e0ddac6fa5 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -49,6 +49,7 @@ #include "llstat.h" #include "llalertdialog.h" #include "llnotifications.h" +#include "llmousehandler.h" class LLView; class LLViewerObject; @@ -59,7 +60,6 @@ class LLVelocityBar; class LLTextBox; class LLImageRaw; class LLHUDIcon; -class LLMouseHandler; #define PICK_HALF_WIDTH 5 #define PICK_DIAMETER (2 * PICK_HALF_WIDTH + 1) @@ -83,7 +83,7 @@ public: static bool isFlora(LLViewerObject* object); - typedef enum e_pick_type + typedef enum { PICK_OBJECT, PICK_FLORA, @@ -152,6 +152,7 @@ public: /*virtual*/ BOOL handleTranslatedKeyUp(KEY key, MASK mask); /*virtual*/ void handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level); /*virtual*/ BOOL handleUnicodeChar(llwchar uni_char, MASK mask); // NOT going to handle extended + /*virtual*/ BOOL handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down); /*virtual*/ BOOL handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask); /*virtual*/ BOOL handleCloseRequest(LLWindow *window); @@ -214,6 +215,7 @@ public: LLCoordGL getCurrentMouseDelta() const { return mCurrentMouseDelta; } LLStat * getMouseVelocityStat() { return &mMouseVelocityStat; } BOOL getLeftMouseDown() const { return mLeftMouseDown; } + BOOL getMiddleMouseDown() const { return mMiddleMouseDown; } BOOL getRightMouseDown() const { return mRightMouseDown; } const LLPickInfo& getLastPick() const { return mLastPick; } @@ -281,7 +283,7 @@ public: // snapshot functionality. // perhaps some of this should move to llfloatershapshot? -MG - typedef enum e_snapshot_type + typedef enum { SNAPSHOT_TYPE_COLOR, SNAPSHOT_TYPE_DEPTH, @@ -387,6 +389,7 @@ protected: LLCoordGL mCurrentMouseDelta; //amount mouse moved this frame LLStat mMouseVelocityStat; BOOL mLeftMouseDown; + BOOL mMiddleMouseDown; BOOL mRightMouseDown; LLProgressView *mProgressView; diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index b79d7d10ff..e52fec7909 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -214,7 +214,7 @@ BOOL LLVLComposition::generateHeights(const F32 x, const F32 y, return TRUE; } -static const S32 BASE_SIZE = 128; +static const U32 BASE_SIZE = 128; BOOL LLVLComposition::generateComposition() { @@ -349,9 +349,9 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, tex_comps = texturep->getComponents(); tex_stride = tex_width * tex_comps; - S32 st_comps = 3; - S32 st_width = BASE_SIZE; - S32 st_height = BASE_SIZE; + U32 st_comps = 3; + U32 st_width = BASE_SIZE; + U32 st_height = BASE_SIZE; if (tex_comps != st_comps) { diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index a5f4dc934a..f705531723 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -294,7 +294,7 @@ BOOL LLWearable::importFile( LLFILE* file ) } // name - char next_char = fgetc( file ); /* Flawfinder: ignore */ + int next_char = fgetc( file ); /* Flawfinder: ignore */ if( '\n' == next_char ) { // no name diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index c9cc86bbbc..3fdef29540 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -367,9 +367,14 @@ LLVector3d LLWorld::clipToVisibleRegions(const LLVector3d &start_pos, const LLVe clip_factor = (region_coord.mV[VY] - region_width) / delta_pos_abs.mdV[VY]; } - // clamp to < 256 to stay in sim + // clamp to within region dimensions LLVector3d final_region_pos = LLVector3d(region_coord) - (delta_pos * clip_factor); - final_region_pos.clamp(0.0, 255.999); + final_region_pos.mdV[VX] = llclamp(final_region_pos.mdV[VX], 0.0, + (F64)(region_width - F_ALMOST_ZERO)); + final_region_pos.mdV[VY] = llclamp(final_region_pos.mdV[VY], 0.0, + (F64)(region_width - F_ALMOST_ZERO)); + final_region_pos.mdV[VZ] = llclamp(final_region_pos.mdV[VZ], 0.0, + (F64)(LLWorld::getInstance()->getRegionMaxHeight() - F_ALMOST_ZERO)); return regionp->getPosGlobalFromRegion(LLVector3(final_region_pos)); } diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 7f8f4cc026..62c4d832cf 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -181,11 +181,11 @@ LLWorldMapView::LLWorldMapView(const std::string& name, const LLRect& rect ) const S32 DIR_WIDTH = 10; const S32 DIR_HEIGHT = 10; LLRect major_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH, 0 ); + LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); mTextBoxNorth = new LLTextBox( std::string("N"), major_dir_rect ); + mTextBoxNorth->setColor( minor_color ); addChild( mTextBoxNorth ); - - LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); mTextBoxEast = new LLTextBox( std::string("E"), major_dir_rect ); mTextBoxEast->setColor( minor_color ); |