diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2014-10-31 22:44:41 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-10-31 23:00:11 +0100 |
commit | 5aa299c034a89ffa9e332899bef33816d0b90963 (patch) | |
tree | d7d882709df0f2c58263f0d5fb3a817c30ff26c5 | |
parent | 9b7542b0928f81b36365b13228a402e8cd64e8cd (diff) |
fdo#85562: sw: fix crash on insert of input field and set variable field
When a new field is inserted it doesn't have a SwFmtFld yet and it is
also not yet in the document so it is not necessary to listen for its
deletion.
(regression from bbd97fe57d9ec184ef6aee36bd57d6d7e53b4719)
Change-Id: I23c18aa8c490a6ad1de63a33f87679cc2358d7f5
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh2.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx index 484a551c6747..fec7e867e12d 100644 --- a/sw/source/uibase/wrtsh/wrtsh2.cxx +++ b/sw/source/uibase/wrtsh/wrtsh2.cxx @@ -211,24 +211,24 @@ bool SwWrtShell::StartInputFldDlg( SwField* pFld, bool bNextButton, FieldDeletionModify aModify(pDlg.get()); SwInputField *const pInputField(dynamic_cast<SwInputField*>(pFld)); SwSetExpField *const pSetExpFld(dynamic_cast<SwSetExpField*>(pFld)); - if (pInputField) + if (pInputField && pInputField->GetFmtFld()) { // Register for possible input field deletion while dialog is open pInputField->GetFmtFld()->Add(&aModify); } - else if (pSetExpFld) + else if (pSetExpFld && pSetExpFld->GetFmtFld()) { pSetExpFld->GetFmtFld()->Add(&aModify); } bool bRet = RET_CANCEL == pDlg->Execute(); - if (pInputField) + if (pInputField && pInputField->GetFmtFld()) { // Dialog closed, remove modification listener pInputField->GetFmtFld()->Remove(&aModify); } - else if (pSetExpFld) + else if (pSetExpFld && pSetExpFld->GetFmtFld()) { pSetExpFld->GetFmtFld()->Remove(&aModify); } |