diff options
| author | Logan Dethrow <log@lindenlab.com> | 2012-12-13 18:35:07 -0500 |
|---|---|---|
| committer | Logan Dethrow <log@lindenlab.com> | 2012-12-13 18:35:07 -0500 |
| commit | 9015344f8e1d246726a8dc4fbfcefb7e74525e6a (patch) | |
| tree | ef17d2dbcc573a3126049e9bc444b78b7507ebc2 /indra/newview/llpreview.cpp | |
| parent | 3565f6f36db90e1a9a5918d8087f9dc0ab61eb69 (diff) | |
| parent | 18ff702a9965ba8b9a17326b391f8edab01242f6 (diff) | |
Merged SH-3339 work with sunshine-internal. Still a WIP.
Diffstat (limited to 'indra/newview/llpreview.cpp')
| -rw-r--r-- | indra/newview/llpreview.cpp | 17 |
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(); |
