diff options
| author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2024-09-18 11:44:03 +0200 | 
|---|---|---|
| committer | Guru <alexandrgproductengine@lindenlab.com> | 2024-09-18 17:13:59 +0200 | 
| commit | 27b8e6d576346e3174760087a15811478a90459e (patch) | |
| tree | ae0f6943799c426872019b3adacb13f9b5626d26 | |
| parent | d9da5bbb33ce70e3bc799ba6696c8b10de0e5f04 (diff) | |
#2408 The long covenant with emojis significantly slows down some operations in the viewer
| -rw-r--r-- | indra/llui/lltextbase.cpp | 98 | ||||
| -rw-r--r-- | indra/llui/lltextbase.h | 15 | ||||
| -rw-r--r-- | indra/newview/llchatmsgbox.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llexpandabletextbox.cpp | 8 | ||||
| -rw-r--r-- | indra/newview/llfloaterbuyland.cpp | 25 | ||||
| -rw-r--r-- | indra/newview/llfloaterbuyland.h | 2 | ||||
| -rw-r--r-- | indra/newview/llfloaterland.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llfloaterland.h | 2 | ||||
| -rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llfloaterregioninfo.h | 1 | ||||
| -rw-r--r-- | indra/newview/llpanelplaceprofile.cpp | 5 | ||||
| -rw-r--r-- | indra/newview/llpanelplaceprofile.h | 2 | ||||
| -rw-r--r-- | indra/newview/llviewermessage.cpp | 36 | ||||
| -rw-r--r-- | indra/newview/llviewertexteditor.cpp | 10 | 
14 files changed, 224 insertions, 10 deletions
| diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e2d31085c4..cbbf83d679 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2368,6 +2368,34 @@ S32 LLTextBase::removeFirstLine()      return 0;  } +// virtual +void LLTextBase::copyContents(const LLTextBase* source) +{ +    llassert(source); +    if (!source) +        return; + +    beforeValueChange(); +    deselect(); + +    mSegments.clear(); +    for (const LLTextSegmentPtr& segp : source->mSegments) +    { +        mSegments.emplace(segp->clone(*this)); +    } + +    mLineInfoList.clear(); +    for (const line_info& li : mLineInfoList) +    { +        mLineInfoList.push_back(line_info(li)); +    } + +    getViewModel()->setDisplay(source->getViewModel()->getDisplay()); + +    onValueChange(0, getLength()); +    needsReflow(); +} +  void LLTextBase::appendLineBreakSegment(const LLStyle::Params& style_params)  {      segment_vec_t segments; @@ -3233,6 +3261,24 @@ boost::signals2::connection LLTextBase::setIsObjectBlockedCallback(const is_bloc  LLTextSegment::~LLTextSegment()  {} +// static +LLStyleSP LLTextSegment::cloneStyle(LLTextBase& target, const LLStyle* source) +{ +    // Take most params from target +    LLStyle::Params params = target.getStyleParams(); +    LLStyle* style = new LLStyle(params); + +    // Take some params from source +    style->setLinkHREF(source->getLinkHREF()); +    if (source->isImage()) +    { +        style->setImage(source->getImage()->getName()); +    } + +    return style; +} + +  bool LLTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const { width = 0; height = 0; return false; }  bool LLTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const  { @@ -3574,6 +3620,13 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip)      mTooltip = tooltip;  } +// virtual +LLTextSegmentPtr LLNormalTextSegment::clone(LLTextBase& target) const +{ +    LLStyleConstSP sp(cloneStyle(target, mStyle)); +    return new LLNormalTextSegment(sp, mStart, mEnd, target); +} +  bool LLNormalTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const  {      height = 0; @@ -3701,6 +3754,13 @@ LLLabelTextSegment::LLLabelTextSegment( const LLUIColor& color, S32 start, S32 e  {  } +// virtual +LLTextSegmentPtr LLLabelTextSegment::clone(LLTextBase& target) const +{ +    LLStyleConstSP sp(cloneStyle(target, mStyle)); +    return new LLLabelTextSegment(sp, mStart, mEnd, target); +} +  /*virtual*/  const LLWString& LLLabelTextSegment::getWText() const  { @@ -3725,6 +3785,13 @@ LLEmojiTextSegment::LLEmojiTextSegment(const LLUIColor& color, S32 start, S32 en  {  } +// virtual +LLTextSegmentPtr LLEmojiTextSegment::clone(LLTextBase& target) const +{ +    LLStyleConstSP sp(cloneStyle(target, mStyle)); +    return new LLEmojiTextSegment(sp, mStart, mEnd, target); +} +  bool LLEmojiTextSegment::handleToolTip(S32 x, S32 y, MASK mask)  {      if (mTooltip.empty()) @@ -3748,6 +3815,14 @@ LLOnHoverChangeableTextSegment::LLOnHoverChangeableTextSegment( LLStyleConstSP s        mHoveredStyle(style),        mNormalStyle(normal_style){} +// virtual +LLTextSegmentPtr LLOnHoverChangeableTextSegment::clone(LLTextBase& target) const +{ +    LLStyleConstSP hsp(cloneStyle(target, mHoveredStyle)); +    LLStyleConstSP nsp(cloneStyle(target, mNormalStyle)); +    return new LLOnHoverChangeableTextSegment(hsp, nsp, mStart, mEnd, target); +} +  /*virtual*/  F32 LLOnHoverChangeableTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect)  { @@ -3787,6 +3862,13 @@ LLInlineViewSegment::~LLInlineViewSegment()      mView->die();  } +// virtual +LLTextSegmentPtr LLInlineViewSegment::clone(LLTextBase& target) const +{ +    llassert_always_msg(false, "NOT SUPPORTED"); +    return nullptr; +} +  bool LLInlineViewSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const  {      if (first_char == 0 && num_chars == 0) @@ -3874,6 +3956,14 @@ LLLineBreakTextSegment::LLLineBreakTextSegment(LLStyleConstSP style,S32 pos):LLT  LLLineBreakTextSegment::~LLLineBreakTextSegment()  {  } + +// virtual +LLTextSegmentPtr LLLineBreakTextSegment::clone(LLTextBase& target) const +{ +    LLLineBreakTextSegment* copy = new LLLineBreakTextSegment(mStart); +    copy->mFontHeight = mFontHeight; +    return copy; +}  bool LLLineBreakTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const  {      width = 0; @@ -3901,8 +3991,16 @@ LLImageTextSegment::~LLImageTextSegment()  {  } +// virtual +LLTextSegmentPtr LLImageTextSegment::clone(LLTextBase& target) const +{ +    LLStyleConstSP sp(cloneStyle(target, mStyle)); +    return new LLImageTextSegment(sp, mStart, target); +} +  static const S32 IMAGE_HPAD = 3; +// virtual  bool LLImageTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const  {      width = 0; diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index eb4697da15..76d4e160af 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -45,6 +45,7 @@  class LLScrollContainer;  class LLContextMenu;  class LLUrlMatch; +class LLTextBase;  ///  /// A text segment is used to specify a subsection of a text string @@ -62,6 +63,9 @@ public:          mEnd(end)      {}      virtual ~LLTextSegment(); +    virtual LLTextSegmentPtr clone(LLTextBase& terget) const { return new LLTextSegment(mStart, mEnd); } +    static LLStyleSP cloneStyle(LLTextBase& target, const LLStyle* source); +      bool                        getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const;      virtual bool                getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const; @@ -128,6 +132,7 @@ public:      LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor );      LLNormalTextSegment( const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);      virtual ~LLNormalTextSegment(); +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const;      /*virtual*/ bool                getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const;      /*virtual*/ S32                 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const; @@ -180,6 +185,7 @@ class LLLabelTextSegment : public LLNormalTextSegment  public:      LLLabelTextSegment( LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor );      LLLabelTextSegment( const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true); +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const;  protected: @@ -194,6 +200,7 @@ class LLEmojiTextSegment : public LLNormalTextSegment  public:      LLEmojiTextSegment(LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor);      LLEmojiTextSegment(const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true); +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const override;      bool canEdit() const override { return false; }      bool handleToolTip(S32 x, S32 y, MASK mask) override; @@ -204,6 +211,7 @@ class LLOnHoverChangeableTextSegment : public LLNormalTextSegment  {  public:      LLOnHoverChangeableTextSegment( LLStyleConstSP style, LLStyleConstSP normal_style, S32 start, S32 end, LLTextBase& editor ); +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const;      /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect);      /*virtual*/ bool handleHover(S32 x, S32 y, MASK mask);  protected: @@ -218,6 +226,7 @@ class LLIndexSegment : public LLTextSegment  {  public:      LLIndexSegment() : LLTextSegment(0, 0) {} +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const { return new LLIndexSegment(); }  };  class LLInlineViewSegment : public LLTextSegment @@ -235,6 +244,8 @@ public:      LLInlineViewSegment(const Params& p, S32 start, S32 end);      ~LLInlineViewSegment(); +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const; +      /*virtual*/ bool        getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const;      /*virtual*/ S32         getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const;      /*virtual*/ void        updateLayout(const class LLTextBase& editor); @@ -259,6 +270,7 @@ public:      LLLineBreakTextSegment(LLStyleConstSP style,S32 pos);      LLLineBreakTextSegment(S32 pos);      ~LLLineBreakTextSegment(); +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const;      /*virtual*/ bool        getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const;      S32         getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const;      F32         draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); @@ -272,6 +284,8 @@ class LLImageTextSegment : public LLTextSegment  public:      LLImageTextSegment(LLStyleConstSP style,S32 pos,class LLTextBase& editor);      ~LLImageTextSegment(); +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const; +      /*virtual*/ bool        getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const;      S32         getNumChars(S32 num_pixels, S32 segment_offset, S32 char_offset, S32 max_chars, S32 line_ind) const;      F32         draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); @@ -510,6 +524,7 @@ public:      const LLFontGL*         getFont() const override { return mFont; } +    virtual void            copyContents(const LLTextBase* source);      virtual void            appendLineBreakSegment(const LLStyle::Params& style_params);      virtual void            appendImageSegment(const LLStyle::Params& style_params);      virtual void            appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo); diff --git a/indra/newview/llchatmsgbox.cpp b/indra/newview/llchatmsgbox.cpp index b70b3eac95..eacbb4366d 100644 --- a/indra/newview/llchatmsgbox.cpp +++ b/indra/newview/llchatmsgbox.cpp @@ -41,6 +41,16 @@ public:          mEditor(NULL)      {} +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const +    { +        ChatSeparator* copy = new ChatSeparator(mStart, mEnd); +        if (mEditor) +        { +            copy->mEditor = ⌖ +        } +        return copy; +    } +      /*virtual*/ void linkToDocument(class LLTextBase* editor)      {          mEditor = editor; diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 748e10160c..5c46eb9d80 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -44,6 +44,14 @@ public:          mExpanderLabel(utf8str_to_wstring(more_text))      {} +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const +    { +        LLStyleSP sp(cloneStyle(target, mStyle)); +        LLExpanderSegment* copy = new LLExpanderSegment(sp, mStart, mEnd, LLStringUtil::null, target); +        copy->mExpanderLabel = mExpanderLabel; +        return copy; +    } +      /*virtual*/ bool    getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const      {          // more label always spans width of text box diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 11505e3047..a38cc94328 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -163,6 +163,7 @@ public:      void updateParcelInfo();      void updateCovenantInfo();      static void onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data); +    void updateFloaterCovenant(const LLTextBase* source, const LLUUID &asset_id);      void updateFloaterCovenantText(const std::string& string, const LLUUID &asset_id);      void updateFloaterEstateName(const std::string& name);      void updateFloaterLastModified(const std::string& text); @@ -201,6 +202,8 @@ public:      void onVisibilityChanged ( const LLSD& new_visibility ); +private: +    void onCovenantTextUpdated(const LLUUID& asset_id);  };  // static @@ -222,6 +225,15 @@ void LLFloaterBuyLand::buyLand(  }  // static +void LLFloaterBuyLand::updateCovenant(const LLTextBase* source, const LLUUID& asset_id) +{ +    if (LLFloaterBuyLandUI* floater = LLFloaterReg::findTypedInstance<LLFloaterBuyLandUI>("buy_land")) +    { +        floater->updateFloaterCovenant(source, asset_id); +    } +} + +// static  void LLFloaterBuyLand::updateCovenantText(const std::string& string, const LLUUID &asset_id)  {      LLFloaterBuyLandUI* floater = LLFloaterReg::findTypedInstance<LLFloaterBuyLandUI>("buy_land"); @@ -560,11 +572,24 @@ void LLFloaterBuyLandUI::onChangeAgreeCovenant(LLUICtrl* ctrl, void* user_data)      }  } +void LLFloaterBuyLandUI::updateFloaterCovenant(const LLTextBase* source, const LLUUID& asset_id) +{ +    LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("covenant_editor"); +    editor->copyContents(source); + +    onCovenantTextUpdated(asset_id); +} +  void LLFloaterBuyLandUI::updateFloaterCovenantText(const std::string &string, const LLUUID& asset_id)  {      LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("covenant_editor");      editor->setText(string); +    onCovenantTextUpdated(asset_id); +} + +void LLFloaterBuyLandUI::onCovenantTextUpdated(const LLUUID& asset_id) +{      LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");      LLTextBox* box = getChild<LLTextBox>("covenant_text");      if (asset_id.isNull()) diff --git a/indra/newview/llfloaterbuyland.h b/indra/newview/llfloaterbuyland.h index f750a4017a..732312f10f 100644 --- a/indra/newview/llfloaterbuyland.h +++ b/indra/newview/llfloaterbuyland.h @@ -27,6 +27,7 @@  #ifndef LL_LLFLOATERBUYLAND_H  #define LL_LLFLOATERBUYLAND_H +class LLTextBase;  class LLFloater;  class LLViewerRegion;  class LLParcelSelection; @@ -37,6 +38,7 @@ public:      static void buyLand(LLViewerRegion* region,                          LLSafeHandle<LLParcelSelection> parcel,                          bool is_for_group); +    static void updateCovenant(const LLTextBase* source, const LLUUID& asset_id);      static void updateCovenantText(const std::string& string, const LLUUID& asset_id);      static void updateEstateName(const std::string& name);      static void updateLastModified(const std::string& text); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index bec76fe5e4..52a3e78d04 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -3124,6 +3124,16 @@ void LLPanelLandCovenant::refresh()  }  // static +void LLPanelLandCovenant::updateCovenant(const LLTextBase* source) +{ +    if (LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant()) +    { +        LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("covenant_editor"); +        editor->copyContents(source); +    } +} + +// static  void LLPanelLandCovenant::updateCovenantText(const std::string &string)  {      LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant(); diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 95f6a44a94..8af0caab33 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -50,6 +50,7 @@ class LLRadioGroup;  class LLParcelSelectionObserver;  class LLSpinCtrl;  class LLTabContainer; +class LLTextBase;  class LLTextBox;  class LLTextEditor;  class LLTextureCtrl; @@ -416,6 +417,7 @@ public:      virtual ~LLPanelLandCovenant();      virtual bool postBuild();      void refresh(); +    static void updateCovenant(const LLTextBase* source);      static void updateCovenantText(const std::string& string);      static void updateEstateName(const std::string& name);      static void updateLastModified(const std::string& text); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 8070284e32..efeee1ad3c 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -2820,6 +2820,16 @@ void LLPanelEstateCovenant::setEstateName(const std::string& name)  }  // static +void LLPanelEstateCovenant::updateCovenant(const LLTextBase* source, const LLUUID& asset_id) +{ +    if (LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant()) +    { +        panelp->mEditor->copyContents(source); +        panelp->setCovenantID(asset_id); +    } +} + +// static  void LLPanelEstateCovenant::updateCovenantText(const std::string& string, const LLUUID& asset_id)  {      LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant(); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index b604a28fc3..65c1291728 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -382,6 +382,7 @@ public:                                 void* user_data, S32 status, LLExtStat ext_status);      // Accessor functions +    static void updateCovenant(const LLTextBase* source, const LLUUID& asset_id);      static void updateCovenantText(const std::string& string, const LLUUID& asset_id);      static void updateEstateName(const std::string& name);      static void updateLastModified(const std::string& text); diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 18588514f8..87f05f2028 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -629,6 +629,11 @@ void LLPanelPlaceProfile::updateCovenantText(const std::string &text)      mCovenantText->setText(text);  } +void LLPanelPlaceProfile::updateCovenant(const LLTextBase* source) +{ +    mCovenantText->copyContents(source); +} +  void LLPanelPlaceProfile::onForSaleBannerClick()  {      LLViewerParcelMgr* mgr = LLViewerParcelMgr::getInstance(); diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index 45a20fb86a..f562be0f5d 100644 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -31,6 +31,7 @@  class LLAccordionCtrl;  class LLIconCtrl; +class LLTextBase;  class LLTextEditor;  class LLPanelPlaceProfile : public LLPanelPlaceInfo @@ -60,6 +61,7 @@ public:      void updateEstateName(const std::string& name);      void updateEstateOwnerName(const std::string& name);      void updateCovenantText(const std::string &text); +    void updateCovenant(const LLTextBase* source);  private:      void onForSaleBannerClick(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0861b439eb..1d4828fd33 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6739,7 +6739,8 @@ void onCovenantLoadComplete(const LLUUID& asset_uuid,  {      LL_DEBUGS("Messaging") << "onCovenantLoadComplete()" << LL_ENDL;      std::string covenant_text; -    if(0 == status) +    std::unique_ptr<LLViewerTextEditor> editorp; +    if (0 == status)      {          LLFileSystem file(asset_uuid, type, LLFileSystem::READ); @@ -6760,13 +6761,13 @@ void onCovenantLoadComplete(const LLUUID& asset_uuid,              {                  LL_WARNS("Messaging") << "Problem importing estate covenant." << LL_ENDL;                  covenant_text = "Problem importing estate covenant."; +                delete editor;              }              else              {                  // Version 0 (just text, doesn't include version number) -                covenant_text = editor->getText(); +                editorp.reset(editor); // Use covenant from editorp;              } -            delete editor;          }          else          { @@ -6792,17 +6793,32 @@ void onCovenantLoadComplete(const LLUUID& asset_uuid,          LL_WARNS("Messaging") << "Problem loading notecard: " << status << LL_ENDL;      } -    LLPanelEstateCovenant::updateCovenantText(covenant_text, asset_uuid); -    LLPanelLandCovenant::updateCovenantText(covenant_text); -    LLFloaterBuyLand::updateCovenantText(covenant_text, asset_uuid); -    LLPanelPlaceProfile* panel = LLFloaterSidePanelContainer::getPanel<LLPanelPlaceProfile>("places", "panel_place_profile"); -    if (panel) +    if (editorp)      { -        panel->updateCovenantText(covenant_text); +        LLPanelEstateCovenant::updateCovenant(editorp.get(), asset_uuid); +        LLPanelLandCovenant::updateCovenant(editorp.get()); +        LLFloaterBuyLand::updateCovenant(editorp.get(), asset_uuid); +    } +    else +    { +        LLPanelEstateCovenant::updateCovenantText(covenant_text, asset_uuid); +        LLPanelLandCovenant::updateCovenantText(covenant_text); +        LLFloaterBuyLand::updateCovenantText(covenant_text, asset_uuid);      } -} +    if (LLPanelPlaceProfile* panel = LLFloaterSidePanelContainer::getPanel<LLPanelPlaceProfile>("places", "panel_place_profile")) +    { +        if (editorp) +        { +            panel->updateCovenant(editorp.get()); +        } +        else +        { +            panel->updateCovenantText(covenant_text); +        } +    } +}  void process_feature_disabled_message(LLMessageSystem* msg, void**)  { diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 5793a28b80..210cd62d6f 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -179,6 +179,16 @@ public:          mToolTip = inv_item->getName() + '\n' + inv_item->getDescription();      } +    /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const +    { +        LLTextEditor* editor = dynamic_cast<LLTextEditor*>(&target); +        llassert(editor); +        if (!editor) +            return nullptr; + +        return new LLEmbeddedItemSegment(mStart, mImage, mItem, *editor); +    } +      /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const      {          if (num_chars == 0) | 
