summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-31 09:19:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-31 15:50:04 +0200
commit5b8729a741bd65c2f61ae9caba7ea15a139835e5 (patch)
treec8e11588f87115b51b932af5b89bd0c68787e0a6 /sw
parent68a6c70f25762374f7aed0d4d755345c6f37c78d (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/app/docstyle.cxx6
-rw-r--r--sw/source/uibase/shells/txtnum.cxx10
2 files changed, 8 insertions, 8 deletions
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<const SvxNumBulletItem*>(pItem)->GetNumRule();
- pSetRule->UnLinkGraphics();
+ SvxNumRule& rSetRule = const_cast<SvxNumRule&>(static_cast<const SvxNumBulletItem*>(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<const SvxNumBulletItem*>(pItem)->GetNumRule();
- pSetRule->UnLinkGraphics();
+ SvxNumRule& rSetRule = const_cast<SvxNumRule&>(static_cast<const SvxNumBulletItem*>(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<const SvxNumBulletItem*>(pItem)->GetNumRule();
+ const SvxNumRule& rSetRule = static_cast<const SvxNumBulletItem*>(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);