sw/source/core/unocore/unosett.cxx | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-)
New commits: commit 40a38b305c4f8908f24192bd5dc796ebd6cf6d6e Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Sep 25 07:46:43 2024 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Wed Sep 25 09:18:14 2024 +0200 Simplify a bit Change-Id: Ib82f6456707217412097473a4387d2e6088bd3f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173801 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 0dcea7091769..8d9d42b6c200 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1157,23 +1157,14 @@ uno::Any SwXNumberingRules::getPropertyByIndex(sal_Int32 nIndex, const OUString& if(nIndex < 0 || MAXLEVEL <= nIndex) throw lang::IndexOutOfBoundsException(); - uno::Any aVal; const SwNumRule* pRule = m_pNumRule; if(!pRule && m_pDoc && !m_sCreatedNumRuleName.isEmpty()) pRule = m_pDoc->FindNumRulePtr( m_sCreatedNumRuleName ); - if(pRule) - { - aVal = GetNumberingRuleByIndex( *pRule, nIndex, rPropName); - - } - else if(m_pDocShell) - { - aVal = GetNumberingRuleByIndex( - *m_pDocShell->GetDoc()->GetOutlineNumRule(), nIndex, rPropName); - } - else + if (!pRule && m_pDocShell) + pRule = m_pDocShell->GetDoc()->GetOutlineNumRule(); + if (!pRule) throw uno::RuntimeException(); - return aVal; + return GetNumberingRuleByIndex(*pRule, nIndex, rPropName); } uno::Any SwXNumberingRules::getByIndex(sal_Int32 nIndex)