From 1b68f71348ecf3983b76b40d7940da8377f049b7 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 29 Apr 2024 07:43:28 +0300 Subject: #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed --- indra/newview/llpanelplaceinfo.cpp | 336 ++++++++++++++++++------------------- 1 file changed, 168 insertions(+), 168 deletions(-) (limited to 'indra/newview/llpanelplaceinfo.cpp') diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index fb5957ff8f..8a9b2a7ec7 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -5,21 +5,21 @@ * $LicenseInfo:firstyear=2009&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -50,160 +50,160 @@ #include "llhttpconstants.h" LLPanelPlaceInfo::LLPanelPlaceInfo() -: LLPanel(), - mParcelID(), - mRequestedID(), - mPosRegion(), - mScrollingPanelMinHeight(0), - mScrollingPanelWidth(0), - mInfoType(UNKNOWN), - mScrollingPanel(NULL), - mScrollContainer(NULL), - mDescEditor(NULL) +: LLPanel(), + mParcelID(), + mRequestedID(), + mPosRegion(), + mScrollingPanelMinHeight(0), + mScrollingPanelWidth(0), + mInfoType(UNKNOWN), + mScrollingPanel(NULL), + mScrollContainer(NULL), + mDescEditor(NULL) {} //virtual LLPanelPlaceInfo::~LLPanelPlaceInfo() { - if (mParcelID.notNull()) - { - LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelID, this); - } + if (mParcelID.notNull()) + { + LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelID, this); + } } //virtual BOOL LLPanelPlaceInfo::postBuild() { - mTitle = getChild("title"); - mCurrentTitle = mTitle->getText(); + mTitle = getChild("title"); + mCurrentTitle = mTitle->getText(); - mSnapshotCtrl = getChild("logo"); - mRegionName = getChild("region_title"); - mParcelName = getChild("parcel_title"); - mParcelOwner = getChild("parcel_owner"); - mDescEditor = getChild("description"); + mSnapshotCtrl = getChild("logo"); + mRegionName = getChild("region_title"); + mParcelName = getChild("parcel_title"); + mParcelOwner = getChild("parcel_owner"); + mDescEditor = getChild("description"); - mMaturityRatingIcon = getChild("maturity_icon"); - mMaturityRatingText = getChild("maturity_value"); + mMaturityRatingIcon = getChild("maturity_icon"); + mMaturityRatingText = getChild("maturity_value"); - mScrollingPanel = getChild("scrolling_panel"); - mScrollContainer = getChild("place_scroll"); + mScrollingPanel = getChild("scrolling_panel"); + mScrollContainer = getChild("place_scroll"); - mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight(); - mScrollingPanelWidth = mScrollingPanel->getRect().getWidth(); + mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight(); + mScrollingPanelWidth = mScrollingPanel->getRect().getWidth(); - return TRUE; + return TRUE; } //virtual void LLPanelPlaceInfo::resetLocation() { - mParcelID.setNull(); - mRequestedID.setNull(); - mPosRegion.clearVec(); - mRegionTitle.clear(); - - std::string loading = LLTrans::getString("LoadingData"); - mMaturityRatingText->setValue(loading); - mRegionName->setTextArg("[REGIONAMEPOS]", loading); - mParcelName->setText(loading); - mParcelOwner->setText(loading); - mDescEditor->setText(loading); - mMaturityRatingIcon->setValue(LLUUID::null); - - mSnapshotCtrl->setImageAssetID(LLUUID::null); + mParcelID.setNull(); + mRequestedID.setNull(); + mPosRegion.clearVec(); + mRegionTitle.clear(); + + std::string loading = LLTrans::getString("LoadingData"); + mMaturityRatingText->setValue(loading); + mRegionName->setTextArg("[REGIONAMEPOS]", loading); + mParcelName->setText(loading); + mParcelOwner->setText(loading); + mDescEditor->setText(loading); + mMaturityRatingIcon->setValue(LLUUID::null); + + mSnapshotCtrl->setImageAssetID(LLUUID::null); } //virtual void LLPanelPlaceInfo::setParcelID(const LLUUID& parcel_id) { - mParcelID = parcel_id; - sendParcelInfoRequest(); + mParcelID = parcel_id; + sendParcelInfoRequest(); } //virtual void LLPanelPlaceInfo::setInfoType(EInfoType type) { - mTitle->setText(mCurrentTitle); - mTitle->setToolTip(mCurrentTitle); + mTitle->setText(mCurrentTitle); + mTitle->setToolTip(mCurrentTitle); - mInfoType = type; + mInfoType = type; } void LLPanelPlaceInfo::sendParcelInfoRequest() { - if (mParcelID != mRequestedID) - { - LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelID, this); - LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelID); + if (mParcelID != mRequestedID) + { + LLRemoteParcelInfoProcessor::getInstance()->addObserver(mParcelID, this); + LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(mParcelID); - mRequestedID = mParcelID; - } + mRequestedID = mParcelID; + } } void LLPanelPlaceInfo::displayParcelInfo(const LLUUID& region_id, - const LLVector3d& pos_global) + const LLVector3d& pos_global) { - LLViewerRegion* region = gAgent.getRegion(); - if (!region) - return; - - mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS), - (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS), - (F32)pos_global.mdV[VZ]); - - LLSD body; - std::string url = region->getCapability("RemoteParcelRequest"); - if (!url.empty()) - { + LLViewerRegion* region = gAgent.getRegion(); + if (!region) + return; + + mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS), + (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS), + (F32)pos_global.mdV[VZ]); + + LLSD body; + std::string url = region->getCapability("RemoteParcelRequest"); + if (!url.empty()) + { LLRemoteParcelInfoProcessor::getInstance()->requestRegionParcelInfo(url, region_id, mPosRegion, pos_global, getObserverHandle()); - } - else - { - mDescEditor->setText(getString("server_update_text")); - } + } + else + { + mDescEditor->setText(getString("server_update_text")); + } } // virtual void LLPanelPlaceInfo::setErrorStatus(S32 status, const std::string& reason) { - // We only really handle 404 and 499 errors - std::string error_text; - if(status == HTTP_NOT_FOUND) - { - error_text = getString("server_error_text"); - } - else if(status == HTTP_INTERNAL_ERROR) - { - error_text = getString("server_forbidden_text"); - } - else - { - error_text = getString("server_error_text"); - } - - mDescEditor->setText(error_text); - - std::string not_available = getString("not_available"); - mMaturityRatingText->setValue(not_available); - mRegionName->setTextArg("[REGIONAMEPOS]", not_available); - mParcelName->setText(not_available); - mParcelOwner->setText(not_available); - mMaturityRatingIcon->setValue(LLUUID::null); - mRegionTitle.clear(); - - // Enable "Back" button that was disabled when parcel request was sent. - getChild("back_btn")->setEnabled(TRUE); + // We only really handle 404 and 499 errors + std::string error_text; + if(status == HTTP_NOT_FOUND) + { + error_text = getString("server_error_text"); + } + else if(status == HTTP_INTERNAL_ERROR) + { + error_text = getString("server_forbidden_text"); + } + else + { + error_text = getString("server_error_text"); + } + + mDescEditor->setText(error_text); + + std::string not_available = getString("not_available"); + mMaturityRatingText->setValue(not_available); + mRegionName->setTextArg("[REGIONAMEPOS]", not_available); + mParcelName->setText(not_available); + mParcelOwner->setText(not_available); + mMaturityRatingIcon->setValue(LLUUID::null); + mRegionTitle.clear(); + + // Enable "Back" button that was disabled when parcel request was sent. + getChild("back_btn")->setEnabled(TRUE); } // virtual void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) { - if(mSnapshotCtrl) - { - mSnapshotCtrl->setImageAssetID(parcel_data.snapshot_id); - } + if(mSnapshotCtrl) + { + mSnapshotCtrl->setImageAssetID(parcel_data.snapshot_id); + } S32 region_x; S32 region_y; @@ -229,74 +229,74 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) std::string name_and_pos = llformat("%s (%d, %d, %d)", mRegionTitle.c_str(), region_x, region_y, region_z); mRegionName->setTextArg("[REGIONAMEPOS]", name_and_pos); - } - else - { - mRegionTitle.clear(); - mRegionName->setText(LLStringUtil::null); - } - - if(!parcel_data.desc.empty()) - { - mDescEditor->setText(parcel_data.desc); - } - else - { - mDescEditor->setText(getString("not_available")); - } - - if (!parcel_data.name.empty()) - { - mParcelTitle = parcel_data.name; - - mParcelName->setText(mParcelTitle); - } - else - { - mParcelName->setText(getString("not_available")); - } + } + else + { + mRegionTitle.clear(); + mRegionName->setText(LLStringUtil::null); + } + + if(!parcel_data.desc.empty()) + { + mDescEditor->setText(parcel_data.desc); + } + else + { + mDescEditor->setText(getString("not_available")); + } + + if (!parcel_data.name.empty()) + { + mParcelTitle = parcel_data.name; + + mParcelName->setText(mParcelTitle); + } + else + { + mParcelName->setText(getString("not_available")); + } } // virtual void LLPanelPlaceInfo::reshape(S32 width, S32 height, BOOL called_from_parent) { - // This if was added to force collapsing description textbox on Windows at the beginning of reshape - // (the only case when reshape is skipped here is when it's caused by this textbox, so called_from_parent is FALSE) - // This way it is consistent with Linux where topLost collapses textbox at the beginning of reshape. - // On windows it collapsed only after reshape which caused EXT-8342. - if(called_from_parent) - { - if(mDescEditor) mDescEditor->onTopLost(); - } - - LLPanel::reshape(width, height, called_from_parent); - - if (!mScrollContainer || !mScrollingPanel) - return; - - static LLUICachedControl scrollbar_size ("UIScrollbarSize", 0); - - S32 scroll_height = mScrollContainer->getRect().getHeight(); - if (mScrollingPanelMinHeight > scroll_height) - { - mScrollingPanel->reshape(mScrollingPanelWidth, mScrollingPanelMinHeight); - } - else - { - mScrollingPanel->reshape(mScrollingPanelWidth + scrollbar_size, scroll_height); - } + // This if was added to force collapsing description textbox on Windows at the beginning of reshape + // (the only case when reshape is skipped here is when it's caused by this textbox, so called_from_parent is FALSE) + // This way it is consistent with Linux where topLost collapses textbox at the beginning of reshape. + // On windows it collapsed only after reshape which caused EXT-8342. + if(called_from_parent) + { + if(mDescEditor) mDescEditor->onTopLost(); + } + + LLPanel::reshape(width, height, called_from_parent); + + if (!mScrollContainer || !mScrollingPanel) + return; + + static LLUICachedControl scrollbar_size ("UIScrollbarSize", 0); + + S32 scroll_height = mScrollContainer->getRect().getHeight(); + if (mScrollingPanelMinHeight > scroll_height) + { + mScrollingPanel->reshape(mScrollingPanelWidth, mScrollingPanelMinHeight); + } + else + { + mScrollingPanel->reshape(mScrollingPanelWidth + scrollbar_size, scroll_height); + } } void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global) { - LLPickData data; - data.pos_global = pos_global; - data.name = mParcelTitle.empty() ? mRegionTitle : mParcelTitle; - data.sim_name = mRegionTitle; - data.desc = mDescEditor->getText(); - data.snapshot_id = mSnapshotCtrl->getImageAssetID(); - data.parcel_id = mParcelID; + LLPickData data; + data.pos_global = pos_global; + data.name = mParcelTitle.empty() ? mRegionTitle : mParcelTitle; + data.sim_name = mRegionTitle; + data.desc = mDescEditor->getText(); + data.snapshot_id = mSnapshotCtrl->getImageAssetID(); + data.parcel_id = mParcelID; LLFloaterProfile* profile_floater = dynamic_cast(LLFloaterReg::showInstance("profile", LLSD().with("id", gAgentID))); if (profile_floater) @@ -308,13 +308,13 @@ void LLPanelPlaceInfo::createPick(const LLVector3d& pos_global) // static void LLPanelPlaceInfo::onNameCache(LLTextBox* text, const std::string& full_name) { - text->setText(full_name); + text->setText(full_name); } // static void LLPanelPlaceInfo::onAvatarNameCache(const LLUUID& agent_id, - const LLAvatarName& av_name, - LLTextBox* text) + const LLAvatarName& av_name, + LLTextBox* text) { - text->setText( av_name.getCompleteName() ); + text->setText( av_name.getCompleteName() ); } -- cgit v1.2.3