diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2011-08-30 15:22:44 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2011-08-30 15:22:44 -0400 |
commit | 71aec7439c1a8027880ac06d99f923ab8fa7111b (patch) | |
tree | 8fcd820379296a81e694cb5cbe628a78f34bfb6f /indra/llui/llview.cpp | |
parent | 713aa42f61d6d5791b26f56a73bd7cf7abb76f0d (diff) |
CHOP-763: Introduce static LLView::getPathname(LLView*).
Use it for LLWindowListener to safely report an LLView* which might be NULL.
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r-- | indra/llui/llview.cpp | 27 |
1 files changed, 16 insertions, 11 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 { |