summaryrefslogtreecommitdiff
path: root/indra/newview/llpreview.cpp
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-11-19 12:01:51 -0800
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-11-19 12:01:51 -0800
commit62301cb883dd6fadcd5d30acd604f72d2c0b1794 (patch)
treebaa94e42e64a07351c8e9722c578e94b43a811d8 /indra/newview/llpreview.cpp
parent6036ee9c421154a83a306bc16533e47f9494fd32 (diff)
parent185169cbbecebe2a35dbd937d6fb4e0a30fa1832 (diff)
Pull and merge from https://bitbucket.org/lindenlab/viewer-development.
Diffstat (limited to 'indra/newview/llpreview.cpp')
-rw-r--r--indra/newview/llpreview.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp
index 18626e3273..04934b13f1 100644
--- a/indra/newview/llpreview.cpp
+++ b/indra/newview/llpreview.cpp
@@ -464,7 +464,9 @@ LLMultiPreview::LLMultiPreview()
void LLMultiPreview::onOpen(const LLSD& key)
{
- LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel();
+ // Floater could be something else than LLPreview, eg LLFloaterProfile.
+ LLPreview* frontmost_preview = dynamic_cast<LLPreview*>(mTabContainer->getCurrentPanel());
+
if (frontmost_preview && frontmost_preview->getAssetStatus() == LLPreview::PREVIEW_ASSET_UNLOADED)
{
frontmost_preview->loadAsset();
@@ -477,8 +479,13 @@ void LLMultiPreview::handleReshape(const LLRect& new_rect, bool by_user)
{
if(new_rect.getWidth() != getRect().getWidth() || new_rect.getHeight() != getRect().getHeight())
{
- LLPreview* frontmost_preview = (LLPreview*)mTabContainer->getCurrentPanel();
- if (frontmost_preview) frontmost_preview->userResized();
+ // Floater could be something else than LLPreview, eg LLFloaterProfile.
+ LLPreview* frontmost_preview = dynamic_cast<LLPreview*>(mTabContainer->getCurrentPanel());
+
+ if (frontmost_preview)
+ {
+ frontmost_preview->userResized();
+ }
}
LLFloater::handleReshape(new_rect, by_user);
}
@@ -486,7 +493,9 @@ void LLMultiPreview::handleReshape(const LLRect& new_rect, bool by_user)
void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click)
{
- LLPreview* opened_preview = (LLPreview*)opened_floater;
+ // Floater could be something else than LLPreview, eg LLFloaterProfile.
+ LLPreview* opened_preview = dynamic_cast<LLPreview*>(opened_floater);
+
if (opened_preview && opened_preview->getAssetStatus() == LLPreview::PREVIEW_ASSET_UNLOADED)
{
opened_preview->loadAsset();