summaryrefslogtreecommitdiff
path: root/indra/newview/llpreview.cpp
diff options
context:
space:
mode:
authorAura Linden <aura@lindenlab.com>2012-12-11 16:01:35 -0800
committerAura Linden <aura@lindenlab.com>2012-12-11 16:01:35 -0800
commite85e6ca4104df14b0bb2d625d82578c81430d28e (patch)
tree533a7ef96345e04dc32ccebff9a453f00fca845d /indra/newview/llpreview.cpp
parent6b059d183b9516f45e775bde00f255cef8aab7c0 (diff)
parenta334f41f8ebec5ef812334e5086e54256e2bf7df (diff)
Merged from viewer-release
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();