From 5bf93a18e645f5e7146402d5dfa6958ddee44de7 Mon Sep 17 00:00:00 2001 From: Ivan Timofeev Date: Sat, 25 Aug 2012 20:33:36 +0400 Subject: use dynamic_cast, prevent crash when opening Options-Writer-AutoCaption SwCaptionOptPage can be added either to SwCaptionOptDlg or OfaTreeOptionsDialog Change-Id: I0cedfc27f8d1f1bbf5e19dce2f438fc782cd5832 --- sw/source/ui/config/optload.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw') diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 19be1a271c00..e2d519a62651 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -770,8 +770,8 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ModifyHdl) { String sFldTypeName = aCategoryBox.GetText(); - SfxSingleTabDialog *pDlg = (SfxSingleTabDialog *)GetParent(); - PushButton *pBtn = pDlg->GetOKButton(); + SfxSingleTabDialog *pDlg = dynamic_cast(GetParent()); + PushButton *pBtn = pDlg ? pDlg->GetOKButton() : NULL; if (pBtn) pBtn->Enable(sFldTypeName.Len() != 0); sal_Bool bEnable = aCategoryBox.IsEnabled() && sFldTypeName != sNone; -- cgit v1.2.3