Kaydet (Commit) 5bf93a18 authored tarafından Ivan Timofeev's avatar Ivan Timofeev

use dynamic_cast, prevent crash when opening Options-Writer-AutoCaption

SwCaptionOptPage can be added either to SwCaptionOptDlg or OfaTreeOptionsDialog

Change-Id: I0cedfc27f8d1f1bbf5e19dce2f438fc782cd5832
üst 55b79fa2
......@@ -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<SfxSingleTabDialog*>(GetParent());
PushButton *pBtn = pDlg ? pDlg->GetOKButton() : NULL;
if (pBtn)
pBtn->Enable(sFldTypeName.Len() != 0);
sal_Bool bEnable = aCategoryBox.IsEnabled() && sFldTypeName != sNone;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment