summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llchatmentionhelper.cpp2
-rw-r--r--indra/llui/llchatmentionhelper.h2
-rw-r--r--indra/llui/llstyle.h8
-rw-r--r--indra/llui/lltextbase.h2
-rw-r--r--indra/llui/llurlentry.cpp12
-rw-r--r--indra/llui/llurlentry.h9
-rw-r--r--indra/llui/llurlmatch.cpp4
-rw-r--r--indra/llui/llurlmatch.h14
8 files changed, 27 insertions, 26 deletions
diff --git a/indra/llui/llchatmentionhelper.cpp b/indra/llui/llchatmentionhelper.cpp
index 98d846b947..f7769b2cbe 100644
--- a/indra/llui/llchatmentionhelper.cpp
+++ b/indra/llui/llchatmentionhelper.cpp
@@ -37,7 +37,7 @@ bool LLChatMentionHelper::isActive(const LLUICtrl* ctrl) const
return mHostHandle.get() == ctrl;
}
-bool LLChatMentionHelper::isCursorInNameMention(const LLWString& wtext, S32 cursor_pos, S32* mention_start_pos)
+bool LLChatMentionHelper::isCursorInNameMention(const LLWString& wtext, S32 cursor_pos, S32* mention_start_pos) const
{
if (cursor_pos <= 0 || cursor_pos > static_cast<S32>(wtext.size()))
return false;
diff --git a/indra/llui/llchatmentionhelper.h b/indra/llui/llchatmentionhelper.h
index 4da8c8264e..5f95d06f31 100644
--- a/indra/llui/llchatmentionhelper.h
+++ b/indra/llui/llchatmentionhelper.h
@@ -42,7 +42,7 @@ class LLChatMentionHelper : public LLSingleton<LLChatMentionHelper>
public:
bool isActive(const LLUICtrl* ctrl) const;
- bool isCursorInNameMention(const LLWString& wtext, S32 cursor_pos, S32* mention_start_pos = nullptr);
+ bool isCursorInNameMention(const LLWString& wtext, S32 cursor_pos, S32* mention_start_pos = nullptr) const;
void showHelper(LLUICtrl* host_ctrl, S32 local_x, S32 local_y, const std::string& av_name, std::function<void(std::string)> commit_cb);
void hideHelper(const LLUICtrl* ctrl = nullptr);
diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h
index 2c86eb6db7..71c3f88109 100644
--- a/indra/llui/llstyle.h
+++ b/indra/llui/llstyle.h
@@ -54,6 +54,14 @@ public:
Params();
};
LLStyle(const Params& p = Params());
+
+ enum EUnderlineLink
+ {
+ UNDERLINE_ALWAYS = 0,
+ UNDERLINE_ON_HOVER,
+ UNDERLINE_NEVER
+ };
+
public:
const LLUIColor& getColor() const { return mColor; }
void setColor(const LLUIColor &color) { mColor = color; }
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index 897c910c2f..8ca653acb9 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -611,7 +611,7 @@ protected:
bool operator()(const LLTextSegmentPtr& a, const LLTextSegmentPtr& b) const;
};
typedef std::multiset<LLTextSegmentPtr, compare_segment_end> segment_set_t;
- typedef LLUrlMatch::EUnderlineLink e_underline;
+ typedef LLStyle::EUnderlineLink e_underline;
// member functions
LLTextBase(const Params &p);
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index a2062d077e..34138da34d 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -666,14 +666,14 @@ std::string LLUrlEntryAgent::getTooltip(const std::string &string) const
return LLTrans::getString("TooltipAgentUrl");
}
-LLUrlMatch::EUnderlineLink LLUrlEntryAgent::getUnderline(const std::string& string) const
+LLStyle::EUnderlineLink LLUrlEntryAgent::getUnderline(const std::string& string) const
{
std::string url = getUrl(string);
if (LLStringUtil::endsWith(url, "/about") || LLStringUtil::endsWith(url, "/inspect"))
{
- return LLUrlMatch::EUnderlineLink::UNDERLINE_ON_HOVER;
+ return LLStyle::EUnderlineLink::UNDERLINE_ON_HOVER;
}
- return LLUrlMatch::EUnderlineLink::UNDERLINE_ALWAYS;
+ return LLStyle::EUnderlineLink::UNDERLINE_ALWAYS;
}
std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
@@ -781,9 +781,9 @@ LLUrlEntryAgentMention::LLUrlEntryAgentMention()
mIcon = std::string();
}
-LLUrlMatch::EUnderlineLink LLUrlEntryAgentMention::getUnderline(const std::string& string) const
+LLStyle::EUnderlineLink LLUrlEntryAgentMention::getUnderline(const std::string& string) const
{
- return LLUrlMatch::EUnderlineLink::UNDERLINE_NEVER;
+ return LLStyle::EUnderlineLink::UNDERLINE_NEVER;
}
LLStyle::Params LLUrlEntryAgentMention::getStyle(const std::string& url) const
@@ -1406,7 +1406,7 @@ std::string LLUrlEntrySLLabel::getTooltip(const std::string &string) const
return LLUrlEntryBase::getTooltip(string);
}
-LLUrlMatch::EUnderlineLink LLUrlEntrySLLabel::getUnderline(const std::string& string) const
+LLStyle::EUnderlineLink LLUrlEntrySLLabel::getUnderline(const std::string& string) const
{
std::string url = getUrl(string);
LLUrlMatch match;
diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h
index df3932b2a0..740e99acfd 100644
--- a/indra/llui/llurlentry.h
+++ b/indra/llui/llurlentry.h
@@ -34,7 +34,6 @@
#include "llavatarname.h"
#include "llhost.h" // for resolving parcel name by parcel id
-#include "llurlmatch.h"
#include <boost/signals2.hpp>
#include <boost/regex.hpp>
@@ -97,7 +96,7 @@ public:
/// Return the name of a SL location described by this Url, if any
virtual std::string getLocation(const std::string &url) const { return ""; }
- virtual LLUrlMatch::EUnderlineLink getUnderline(const std::string& string) const { return LLUrlMatch::EUnderlineLink::UNDERLINE_ALWAYS; }
+ virtual LLStyle::EUnderlineLink getUnderline(const std::string& string) const { return LLStyle::EUnderlineLink::UNDERLINE_ALWAYS; }
virtual bool isTrusted() const { return false; }
@@ -233,7 +232,7 @@ public:
/*virtual*/ LLStyle::Params getStyle(const std::string &url) const;
/*virtual*/ LLUUID getID(const std::string &string) const;
- LLUrlMatch::EUnderlineLink getUnderline(const std::string& string) const;
+ LLStyle::EUnderlineLink getUnderline(const std::string& string) const;
protected:
/*virtual*/ void callObservers(const std::string &id, const std::string &label, const std::string& icon);
@@ -253,7 +252,7 @@ public:
LLUrlEntryAgentMention();
LLStyle::Params getStyle(const std::string& url) const;
- LLUrlMatch::EUnderlineLink getUnderline(const std::string& string) const;
+ LLStyle::EUnderlineLink getUnderline(const std::string& string) const;
bool getSkipProfileIcon(const std::string& string) const { return true; };
};
@@ -505,7 +504,7 @@ public:
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
/*virtual*/ std::string getUrl(const std::string &string) const;
/*virtual*/ std::string getTooltip(const std::string &string) const;
- LLUrlMatch::EUnderlineLink getUnderline(const std::string& string) const;
+ LLStyle::EUnderlineLink getUnderline(const std::string& string) const;
};
///
diff --git a/indra/llui/llurlmatch.cpp b/indra/llui/llurlmatch.cpp
index 3e61abe118..f093934ca9 100644
--- a/indra/llui/llurlmatch.cpp
+++ b/indra/llui/llurlmatch.cpp
@@ -37,7 +37,7 @@ LLUrlMatch::LLUrlMatch() :
mIcon(""),
mMenuName(""),
mLocation(""),
- mUnderline(UNDERLINE_ALWAYS),
+ mUnderline(e_underline::UNDERLINE_ALWAYS),
mTrusted(false),
mSkipProfileIcon(false)
{
@@ -47,7 +47,7 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std
const std::string& query, const std::string &tooltip,
const std::string &icon, const LLStyle::Params& style,
const std::string &menu, const std::string &location,
- const LLUUID& id, EUnderlineLink underline, bool trusted, bool skip_icon)
+ const LLUUID& id, e_underline underline, bool trusted, bool skip_icon)
{
mStart = start;
mEnd = end;
diff --git a/indra/llui/llurlmatch.h b/indra/llui/llurlmatch.h
index 0c4fe4a782..418a21f963 100644
--- a/indra/llui/llurlmatch.h
+++ b/indra/llui/llurlmatch.h
@@ -46,13 +46,6 @@ class LLUrlMatch
public:
LLUrlMatch();
- enum EUnderlineLink
- {
- UNDERLINE_ALWAYS = 0,
- UNDERLINE_ON_HOVER,
- UNDERLINE_NEVER
- };
-
/// return true if this object does not contain a valid Url match yet
bool empty() const { return mUrl.empty(); }
@@ -86,7 +79,8 @@ public:
/// return the SL location that this Url describes, or "" if none.
std::string getLocation() const { return mLocation; }
- EUnderlineLink getUnderline() const { return mUnderline; }
+ typedef LLStyle::EUnderlineLink e_underline;
+ e_underline getUnderline() const { return mUnderline; }
/// Return true if Url is trusted.
bool isTrusted() const { return mTrusted; }
@@ -98,7 +92,7 @@ public:
const std::string& query, const std::string &tooltip, const std::string &icon,
const LLStyle::Params& style, const std::string &menu,
const std::string &location, const LLUUID& id,
- EUnderlineLink underline = UNDERLINE_ALWAYS, bool trusted = false, bool skip_icon = false);
+ e_underline underline = e_underline::UNDERLINE_ALWAYS, bool trusted = false, bool skip_icon = false);
const LLUUID& getID() const { return mID; }
private:
@@ -113,7 +107,7 @@ private:
std::string mLocation;
LLUUID mID;
LLStyle::Params mStyle;
- EUnderlineLink mUnderline;
+ e_underline mUnderline;
bool mTrusted;
bool mSkipProfileIcon;
};