summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2012-08-25 20:33:36 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2012-08-25 20:33:36 +0400
commit5bf93a18e645f5e7146402d5dfa6958ddee44de7 (patch)
tree30c01f86d65f6237cc258c011f3ffd4f61bc9ffc /sw
parent55b79fa2f104e08b940b7019c52dffbafaa13f61 (diff)
use dynamic_cast, prevent crash when opening Options-Writer-AutoCaption
SwCaptionOptPage can be added either to SwCaptionOptDlg or OfaTreeOptionsDialog Change-Id: I0cedfc27f8d1f1bbf5e19dce2f438fc782cd5832
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/config/optload.cxx4
1 files changed, 2 insertions, 2 deletions
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<SfxSingleTabDialog*>(GetParent());
+ PushButton *pBtn = pDlg ? pDlg->GetOKButton() : NULL;
if (pBtn)
pBtn->Enable(sFldTypeName.Len() != 0);
sal_Bool bEnable = aCategoryBox.IsEnabled() && sFldTypeName != sNone;