diff options
Diffstat (limited to 'sw/source/ui/app/applab.cxx')
-rw-r--r-- | sw/source/ui/app/applab.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx index 9c2574230757..97ab60952aef 100644 --- a/sw/source/ui/app/applab.cxx +++ b/sw/source/ui/app/applab.cxx @@ -194,7 +194,13 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) SfxViewFrame* pViewFrame = SfxViewFrame::DisplayNewDocument( *xDocSh, rReq ); - SwView *pNewView = (SwView*) pViewFrame->GetViewShell(); +#if OSL_DEBUG_LEVEL > 0 + rtl::Reference< SwView > pNewView = dynamic_cast<SwView*>(pViewFrame->GetViewShell().get()); + assert( ( pNewView.is() && pViewFrame->GetViewShell().is() ) || + ( !pNewView.is() && !pViewFrame->GetViewShell().is() )); +#else + rtl::Reference< SwView > pNewView = static_cast<SwView*>(pViewFrame->GetViewShell().get()); +#endif pNewView->AttrChangedNotify( &pNewView->GetWrtShell() );// So that SelectShell is being called. // Set document title |