From 5b8729a741bd65c2f61ae9caba7ea15a139835e5 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 31 May 2021 09:19:20 +0200 Subject: no need to allocate SvxNumRule separately in SvxNumBulletItem Change-Id: I7903565a468fc0fbec603c88b92cca6560a86728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116424 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/uibase/app/docstyle.cxx | 6 +++--- sw/source/uibase/shells/txtnum.cxx | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'sw') diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index 015812df184e..8b8d6bb3f63e 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -1640,10 +1640,10 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, { case SfxItemState::SET: { - SvxNumRule* pSetRule = static_cast(pItem)->GetNumRule(); - pSetRule->UnLinkGraphics(); + SvxNumRule& rSetRule = const_cast(static_cast(pItem)->GetNumRule()); + rSetRule.UnLinkGraphics(); SwNumRule aSetRule(*m_pNumRule); - aSetRule.SetSvxRule(*pSetRule, &m_rDoc); + aSetRule.SetSvxRule(rSetRule, &m_rDoc); m_rDoc.ChgNumRuleFormats( aSetRule ); } break; diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx index b75cc1c7dcbd..e1890bbd6f34 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -209,13 +209,13 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) { pRequest->AppendItem(*pItem); pRequest->Done(); - SvxNumRule* pSetRule = static_cast(pItem)->GetNumRule(); - pSetRule->UnLinkGraphics(); + SvxNumRule& rSetRule = const_cast(static_cast(pItem)->GetNumRule()); + rSetRule.UnLinkGraphics(); SwNumRule aSetRule(pNumRuleAtCurrentSelection != nullptr ? pNumRuleAtCurrentSelection->GetName() : GetShell().GetUniqueNumRuleName(), numfunc::GetDefaultPositionAndSpaceMode()); - aSetRule.SetSvxRule(*pSetRule, GetShell().GetDoc()); + aSetRule.SetSvxRule(rSetRule, GetShell().GetDoc()); aSetRule.SetAutoRule(true); // No start of new list, if an existing list style is edited. // Otherwise start a new list. @@ -229,11 +229,11 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) { pRequest->AppendItem(*pItem); pRequest->Done(); - SvxNumRule* pSetRule = static_cast(pItem)->GetNumRule(); + const SvxNumRule& rSetRule = static_cast(pItem)->GetNumRule(); SwNumRule aSetRule( GetShell().GetUniqueNumRuleName(), numfunc::GetDefaultPositionAndSpaceMode()); - aSetRule.SetSvxRule(*pSetRule, GetShell().GetDoc()); + aSetRule.SetSvxRule(rSetRule, GetShell().GetDoc()); aSetRule.SetAutoRule(true); // start new list GetShell().SetCurNumRule(aSetRule, true); -- cgit