summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llview.cpp27
-rw-r--r--indra/llui/llview.h2
-rw-r--r--indra/newview/llwindowlistener.cpp4
3 files changed, 20 insertions, 13 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 0c8e3bace4..77abb1c6bf 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -433,20 +433,15 @@ BOOL LLView::isInEnabledChain() const
static void buildPathname(std::ostream& out, const LLView* view)
{
- if (view == 0) return;
-
- if (view->getParent() != 0)
+ if (! (view && view->getParent()))
{
- buildPathname(out, view->getParent());
-
- // Build pathname into ostream on the way back from recursion.
- out << '/' << view->getName();
- }
- else
- {
- ; // Don't include root in the path.
+ return; // Don't include root in the path.
}
+ buildPathname(out, view->getParent());
+
+ // Build pathname into ostream on the way back from recursion.
+ out << '/' << view->getName();
}
std::string LLView::getPathname() const
@@ -456,6 +451,16 @@ std::string LLView::getPathname() const
return out.str();
}
+//static
+std::string LLView::getPathname(const LLView* view)
+{
+ if (! view)
+ {
+ return "NULL";
+ }
+ return view->getPathname();
+}
+
// virtual
BOOL LLView::canFocusChildren() const
{
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 11f25bcd7f..97151c4fb4 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -445,6 +445,8 @@ public:
virtual void onMouseLeave(S32 x, S32 y, MASK mask);
std::string getPathname() const;
+ // static method handles NULL pointer too
+ static std::string getPathname(const LLView*);
template <class T> T* findChild(const std::string& name, BOOL recurse = TRUE) const
{
diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp
index 84a490f661..05cb798732 100644
--- a/indra/newview/llwindowlistener.cpp
+++ b/indra/newview/llwindowlistener.cpp
@@ -273,7 +273,7 @@ void LLWindowListener::keyDown(LLSD const & evt)
else
{
response.error(STRINGIZE(evt["op"].asString() << " request "
- "element specified byt \"path\": '" << path << "'"
+ "element specified by \"path\": '" << path << "'"
<< " is not visible"));
}
}
@@ -421,7 +421,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request)
response.warn(STRINGIZE(request["op"].asString() << " request "
"specified \"path\" = '" << path
<< "', but frontmost LLView at (" << pos.mX << ", " << pos.mY
- << ") is '" << frontmost->getPathname() << "'"));
+ << ") is '" << LLView::getPathname(frontmost) << "'"));
}
// Instantiate a TemporaryDrilldownFunc to route incoming mouse events