summaryrefslogtreecommitdiff
authorIvan Timofeev <timofeev.i.s@gmail.com>2012-08-25 16:33:36 (GMT)
committer Ivan Timofeev <timofeev.i.s@gmail.com>2012-08-25 16:33:36 (GMT)
commit5bf93a18e645f5e7146402d5dfa6958ddee44de7 (patch) (side-by-side diff)
tree30c01f86d65f6237cc258c011f3ffd4f61bc9ffc
parent55b79fa2f104e08b940b7019c52dffbafaa13f61 (diff)
downloadcore-5bf93a18e645f5e7146402d5dfa6958ddee44de7.zip
core-5bf93a18e645f5e7146402d5dfa6958ddee44de7.tar.gz
use dynamic_cast, prevent crash when opening Options-Writer-AutoCaption
SwCaptionOptPage can be added either to SwCaptionOptDlg or OfaTreeOptionsDialog Change-Id: I0cedfc27f8d1f1bbf5e19dce2f438fc782cd5832
Diffstat (more/less context) (ignore whitespace changes)
-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 19be1a2..e2d519a 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;