Merge remote-tracking branch 'github-liru/animesh' into animesh

This commit is contained in:
Router Gray
2019-05-23 11:48:22 -05:00
14 changed files with 41 additions and 57 deletions

View File

@@ -293,6 +293,8 @@ LLTextEditor::LLTextEditor(
mMouseDownY(0),
mLastSelectionX(-1),
mLastSelectionY(-1),
mParseHTML(parse_html),
mParseHighlights(false),
mLastContextMenuX(-1),
mLastContextMenuY(-1),
mReflowNeeded(FALSE),
@@ -343,7 +345,6 @@ LLTextEditor::LLTextEditor(
mBorder = new LLViewBorder(std::string("text ed border"), LLRect(0, getRect().getHeight(), getRect().getWidth(), 0), LLViewBorder::BEVEL_IN, LLViewBorder::STYLE_LINE, UI_TEXTEDITOR_BORDER);
addChild(mBorder);
mParseHTML = parse_html;
appendText(default_text, FALSE, FALSE);
resetDirty(); // Update saved text state
@@ -741,7 +742,7 @@ LLMenuGL* LLTextEditor::createUrlContextMenu(S32 x, S32 y, const std::string &in
return menu;
}
void LLTextEditor::setText(const LLStringExplicit &utf8str)
void LLTextEditor::setText(const LLStringExplicit &utf8str, bool force_replace_links)
{
// clear out the existing text and segments
mWText.clear();
@@ -756,7 +757,7 @@ void LLTextEditor::setText(const LLStringExplicit &utf8str)
//LLStringUtil::removeCRLF(text);
// appendText modifies mCursorPos...
appendText(utf8str, false, false);
appendText(utf8str, false, false, nullptr, force_replace_links);
// ...so move cursor to top after appending text
setCursorPos(0);
@@ -766,9 +767,9 @@ void LLTextEditor::setText(const LLStringExplicit &utf8str)
mTextIsUpToDate = true;
}
void LLTextEditor::setWText(const LLWString& text)
void LLTextEditor::setWText(const LLWString& text, bool force_replace_links)
{
setText(wstring_to_utf8str(text));
setText(wstring_to_utf8str(text), force_replace_links);
}
// virtual
@@ -4552,39 +4553,27 @@ void LLTextEditor::appendAndHighlightTextImpl(const std::string& new_text, S32 h
// This is where we appendHighlightedText
// If LindenUserDir is empty then we didn't login yet.
// In that case we can't instantiate LLTextParser, which is initialized per user.
if (mParseHighlights && !gDirUtilp->getLindenUserDir(true).empty())
LLTextParser* highlight = mParseHighlights && stylep && !gDirUtilp->getLindenUserDir(true).empty() ? LLTextParser::getInstance() : nullptr;
if (highlight)
{
LLTextParser* highlight = LLTextParser::getInstance();
if (highlight && stylep)
const LLSD pieces = highlight->parsePartialLineHighlights(new_text, stylep->getColor(), (LLTextParser::EHighlightPosition)highlight_part);
auto cur_length = getLength();
for (auto i = pieces.beginArray(), end = pieces.endArray(); i < end; ++i)
{
LLStyleSP highlight_params(new LLStyle(*stylep));
LLSD pieces = highlight->parsePartialLineHighlights(new_text, highlight_params->getColor(), (LLTextParser::EHighlightPosition)highlight_part);
for (S32 i=0;i<pieces.size();i++)
{
LLSD color_llsd = pieces[i]["color"];
LLColor4 lcolor;
lcolor.setValue(color_llsd);
highlight_params->setColor(lcolor);
const auto& piece = *i;
LLWString wide_text = utf8str_to_wstring(piece["text"].asString());
LLWString wide_text;
wide_text = utf8str_to_wstring(pieces[i]["text"].asString());
S32 cur_length = getLength();
insertStringNoUndo(cur_length, wide_text);
LLStyleSP sp(new LLStyle(*highlight_params));
LLTextSegmentPtr segmentp;
segmentp = new LLTextSegment(sp, cur_length, cur_length + wide_text.size());
if (underline_on_hover) segmentp->setUnderlineOnHover(true);
mSegments.push_back(segmentp);
}
return;
insertStringNoUndo(cur_length, wide_text);
LLStyleSP sp(new LLStyle(*stylep));
sp->setColor(piece["color"]);
LLTextSegmentPtr segmentp = new LLTextSegment(sp, cur_length, cur_length += wide_text.size());
if (underline_on_hover) segmentp->setUnderlineOnHover(true);
mSegments.push_back(segmentp);
}
}
//else
else
{
LLWString wide_text;
wide_text = utf8str_to_wstring(new_text);
LLWString wide_text = utf8str_to_wstring(new_text);
auto length = getLength();
auto insert_len = length + insertStringNoUndo(length, utf8str_to_wstring(new_text));

View File

@@ -276,8 +276,8 @@ public:
LLMenuGL* createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url
// Non-undoable
void setText(const LLStringExplicit &utf8str);
void setWText(const LLWString &wtext);
void setText(const LLStringExplicit &utf8str, bool force_replace_links = true);
void setWText(const LLWString &wtext, bool force_replace_links = true);
// Returns byte length limit
S32 getMaxLength() const { return mMaxTextByteLength; }

View File

@@ -715,7 +715,7 @@ void LLPanelLandGeneral::refresh()
);
mEditName->setText( parcel->getName() );
mEditDesc->setText( parcel->getDesc() );
mEditDesc->setText( parcel->getDesc(), false );
BOOL for_sale = parcel->getForSale();
@@ -3070,7 +3070,7 @@ void LLPanelLandCovenant::updateCovenantText(const std::string &string)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("covenant_editor");
editor->setHandleEditKeysDirectly(TRUE);
editor->setText(string);
editor->setText(string, false);
}
}

View File

@@ -2776,7 +2776,7 @@ void LLPanelEstateCovenant::updateCovenantText(const std::string& string, const
LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant();
if( panelp )
{
panelp->mEditor->setText(string);
panelp->mEditor->setText(string, false);
panelp->setCovenantID(asset_id);
}
}
@@ -2823,7 +2823,7 @@ void LLPanelEstateCovenant::setOwnerName(const std::string& name)
void LLPanelEstateCovenant::setCovenantTextEditor(const std::string& text)
{
mEditor->setText(text);
mEditor->setText(text, false);
}
// key = "estateupdateinfo"

View File

@@ -290,7 +290,7 @@ void LLPanelAvatarFirstLife::processProperties(void* data, EAvatarProcessorType
if (pAvatarData && (mAvatarID == pAvatarData->avatar_id) && (pAvatarData->avatar_id != LLUUID::null))
{
// Teens don't get these
getChildView("about")->setValue(pAvatarData->fl_about_text);
getChild<LLTextEditor>("about")->setText(pAvatarData->fl_about_text, false);
getChild<LLTextureCtrl>("img")->setImageAssetID(pAvatarData->fl_image_id);
}
}
@@ -1493,7 +1493,7 @@ void LLPanelAvatar::processProperties(void* data, EAvatarProcessorType type)
timeStructToFormattedString(&t, gSavedSettings.getString("ShortDateFormat"), born_on);
}*/
setOnlineStatus(pAvatarData->flags & AVATAR_ONLINE ? ONLINE_STATUS_YES : ONLINE_STATUS_NO);
childSetValue("about", pAvatarData->about_text);
getChild<LLTextEditor>("about")->setText(pAvatarData->about_text, false);
}
}
else if (type == APT_NOTES)

View File

@@ -354,7 +354,7 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t
// Update UI controls
mNameEditor->setText(c_info->name);
mDescEditor->setText(c_info->description);
mDescEditor->setText(c_info->description, false);
mSnapshotCtrl->setImageAssetID(c_info->snapshot_id);
mLocationEditor->setText(location_text);
mLocationChanged = false;

View File

@@ -151,7 +151,7 @@ void LLPanelEvent::processEventInfoReply(LLMessageSystem *msg, void **)
self->mTBName->setText(self->mEventInfo.mName);
self->mTBCategory->setText(self->mEventInfo.mCategoryStr);
self->mTBDate->setText(self->mEventInfo.mTimeStr);
self->mTBDesc->setText(self->mEventInfo.mDesc);
self->mTBDesc->setText(self->mEventInfo.mDesc, false);
self->mTBDuration->setText(llformat("%d:%.2d", self->mEventInfo.mDuration / 60, self->mEventInfo.mDuration % 60));

View File

@@ -761,7 +761,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
if (mEditCharter)
{
mEditCharter->setText(gdatap->mCharter);
mEditCharter->setText(gdatap->mCharter, false);
mEditCharter->resetDirty();
}
}

View File

@@ -529,12 +529,7 @@ void LLPanelGroupNotices::showNotice(const std::string& subject,
arrangeNoticeView(VIEW_PAST_NOTICE);
if(mViewSubject) mViewSubject->setText(subject);
if (mViewMessage) {
// We need to prune the highlights, and clear() is not doing it...
mViewMessage->removeTextFromEnd(mViewMessage->getMaxLength());
// Now we append the new text (setText() won't highlight URLs)
mViewMessage->appendColoredText(message, false, false, mViewMessage->getReadOnlyFgColor());
}
if (mViewMessage) mViewMessage->setText(message, false);
if (mInventoryOffer)
{

View File

@@ -307,7 +307,7 @@ void LLPanelGroupVoting::impl::setEnableVoteProposal()
if ( proposal_cell )
{
//proposal text
mProposalText->setText(proposal_cell->getValue().asString());
mProposalText->setText(proposal_cell->getValue().asString(), false);
}
else
{ // Something's wrong... should have some text
@@ -556,7 +556,7 @@ void LLPanelGroupVoting::impl::setEnableHistoryItem()
const LLScrollListCell *cell = item->getColumn(5);
if (cell)
{
mVoteHistoryText->setText(cell->getValue().asString());
mVoteHistoryText->setText(cell->getValue().asString(), false);
}
else
{ // Something's wrong...

View File

@@ -199,7 +199,7 @@ void LLPanelPick::processProperties(void* data, EAvatarProcessorType type)
// Update UI controls
mNameEditor->setText(pick_info->name);
mDescEditor->setText(pick_info->desc);
mDescEditor->setText(pick_info->desc, false);
mSnapshotCtrl->setImageAssetID(pick_info->snapshot_id);
mLocationEditor->setText(location_text);
}

View File

@@ -125,7 +125,7 @@ BOOL LLPanelPlace::postBuild()
void LLPanelPlace::displayItemInfo(const LLInventoryItem* pItem)
{
mNameEditor->setText(pItem->getName());
mDescEditor->setText(pItem->getDescription());
mDescEditor->setText(pItem->getDescription(), false);
}
// Use this for search directory clicks, because we are totally
@@ -248,7 +248,7 @@ void LLPanelPlace::processParcelInfo(const LLParcelData& parcel_data)
if( !parcel_data.desc.empty()
&& mDescEditor && mDescEditor->getText().empty())
{
mDescEditor->setText(parcel_data.desc);
mDescEditor->setText(parcel_data.desc, false);
}
std::string info_text;

View File

@@ -405,7 +405,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
else
{
// Version 0 (just text, doesn't include version number)
previewEditor->setText(LLStringExplicit(buffer));
previewEditor->setText(LLStringExplicit(buffer), false);
}
previewEditor->makePristine();

View File

@@ -500,8 +500,8 @@ class WindowsManifest(ViewerManifest):
else:
self.path("vivoxsdk.dll")
self.path("ortp.dll")
self.path("libsndfile-1.dll")
self.path("vivoxoal.dll")
#self.path("libsndfile-1.dll")
#self.path("vivoxoal.dll")
# Security
if(self.address_size == 64):