sw/source/ui/app/docst.cxx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
New commits: commit 609e949bfe407487f417fadb377ead3a3a9cfa5c Author: Caolán McNamara <caol...@redhat.com> Date: Mon Feb 10 10:26:04 2014 +0000 Resolves: fdo#77174 crash with "New style from selection" with List was coverity#1130423 Dereference null return value (cherry picked from commit a434a8bfdd8b9323c8262edcd591641fe9ea8b19) Change-Id: If6981a9654a114e34dad931381ea071d5169adc2 Reviewed-on: https://gerrit.libreoffice.org/8905 Tested-by: Michael Stahl <mst...@redhat.com> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index 30ed690..ff0a01f 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -1168,19 +1168,23 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, case SFX_STYLE_FAMILY_PSEUDO: { - pCurrWrtShell->StartAllAction(); + const SwNumRule* pCurRule = pCurrWrtShell->GetCurNumRule(); - SwNumRule aRule( *pCurrWrtShell->GetCurNumRule() ); - OUString sOrigRule( aRule.GetName() ); - // #i91400# - aRule.SetName( pStyle->GetNumRule()->GetName(), - *(pCurrWrtShell->GetDoc()) ); - pCurrWrtShell->ChgNumRuleFmts( aRule ); + if (pCurRule) + { + pCurrWrtShell->StartAllAction(); - pCurrWrtShell->ReplaceNumRule( sOrigRule, aRule.GetName() ); + SwNumRule aRule( *pCurRule ); + OUString sOrigRule( aRule.GetName() ); + // #i91400# + aRule.SetName( pStyle->GetNumRule()->GetName(), + *(pCurrWrtShell->GetDoc()) ); + pCurrWrtShell->ChgNumRuleFmts( aRule ); + pCurrWrtShell->ReplaceNumRule( sOrigRule, aRule.GetName() ); - pCurrWrtShell->EndAllAction(); + pCurrWrtShell->EndAllAction(); + } } break; }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits