[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/source
Caolán McNamara
caolanm at redhat.com
Wed Apr 9 04:47:35 PDT 2014
sw/source/ui/app/docst.cxx | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
New commits:
commit 609e949bfe407487f417fadb377ead3a3a9cfa5c
Author: Caolán McNamara <caolanm at 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 <mstahl at redhat.com>
Reviewed-by: Michael Stahl <mstahl at 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;
}
More information about the Libreoffice-commits
mailing list