summaryrefslogtreecommitdiff
path: root/sw/source/ui/dialog
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-01-10 13:58:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-10 14:59:31 +0100
commit8f453c674f19188360ba5895c2bd9bd80273a83b (patch)
treece569bb8caeaea0b110e1e23e845716cb841588f /sw/source/ui/dialog
parentc5367ee0a60966b755e726de6d175dfcd1630741 (diff)
static_cast after dynamic_cast
Change-Id: I3792ddadad9582a7e6f4740829c081d9571ddaff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109049 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui/dialog')
-rw-r--r--sw/source/ui/dialog/docstdlg.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index 7aacfd94cd5f..c9b362355c6e 100644
--- a/sw/source/ui/dialog/docstdlg.cxx
+++ b/sw/source/ui/dialog/docstdlg.cxx
@@ -95,10 +95,10 @@ void SwDocStatPage::Update()
{
SfxViewShell *pVSh = SfxViewShell::Current();
SwViewShell *pSh = nullptr;
- if ( dynamic_cast< const SwView *>( pVSh ) != nullptr )
- pSh = static_cast<SwView*>(pVSh)->GetWrtShellPtr();
- else if ( dynamic_cast< const SwPagePreview *>( pVSh ) != nullptr )
- pSh = static_cast<SwPagePreview*>(pVSh)->GetViewShell();
+ if ( auto pSwView = dynamic_cast<SwView *>( pVSh ) )
+ pSh = pSwView->GetWrtShellPtr();
+ else if ( auto pPagePreview = dynamic_cast<SwPagePreview *>( pVSh ) )
+ pSh = pPagePreview->GetViewShell();
OSL_ENSURE( pSh, "Shell not found" );