From 7f101a514827d0bc57c6626eeed99ecf26658aa9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 6 Mar 2023 15:05:29 +0200 Subject: no need to allocate these separately they are all one or two words in size Change-Id: I09a0392f8d0b067a3a8e4105568b578ef4795c58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148341 Tested-by: Jenkins Reviewed-by: Noel Grandin --- lotuswordpro/inc/lwpfoundry.hxx | 5 ++--- lotuswordpro/source/filter/lwpdoc.cxx | 6 +++--- lotuswordpro/source/filter/lwpdoc.hxx | 3 ++- lotuswordpro/source/filter/lwpfoundry.cxx | 1 - lotuswordpro/source/filter/lwpfribptr.cxx | 2 +- lotuswordpro/source/filter/lwplayout.cxx | 3 +-- lotuswordpro/source/filter/lwplayout.hxx | 2 +- lotuswordpro/source/filter/lwppara.cxx | 2 +- lotuswordpro/source/filter/lwpsilverbullet.cxx | 3 +-- lotuswordpro/source/filter/lwpsilverbullet.hxx | 2 +- 10 files changed, 13 insertions(+), 16 deletions(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/inc/lwpfoundry.hxx b/lotuswordpro/inc/lwpfoundry.hxx index ebecc4b0d825..df2a71a19c90 100644 --- a/lotuswordpro/inc/lwpfoundry.hxx +++ b/lotuswordpro/inc/lwpfoundry.hxx @@ -70,7 +70,6 @@ #include #include - class LwpDocument; class LwpBookMark; @@ -257,12 +256,12 @@ public: LwpObjectID * GetDefaultTextStyle() ; private: std::unique_ptr m_xStyleMgr; - std::unique_ptr m_xDropcapMgr; + LwpDropcapMgr m_aDropcapMgr; std::unique_ptr m_xBulletStyleMgr; public: LwpStyleManager* GetStyleManager() { return m_xStyleMgr.get(); } LwpBookMark* GetBookMark(LwpObjectID objMarker); - LwpDropcapMgr* GetDropcapMgr() { return m_xDropcapMgr.get(); } + LwpDropcapMgr& GetDropcapMgr() { return m_aDropcapMgr; } LwpContent* EnumContents(LwpContent* pContent); LwpSection* EnumSections(LwpSection* pSection); LwpBulletStyleMgr* GetBulletStyleMgr() { return m_xBulletStyleMgr.get(); } diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx index b6955b48978a..a00f29e0c9ce 100644 --- a/lotuswordpro/source/filter/lwpdoc.cxx +++ b/lotuswordpro/source/filter/lwpdoc.cxx @@ -101,7 +101,7 @@ void LwpDocument::Read() LwpUIDocument aUIDoc(m_pObjStrm.get()); } - m_xLnOpts.reset(new LwpLineNumberOptions(m_pObjStrm.get())); + m_oLnOpts.emplace(m_pObjStrm.get()); //Skip LwpUserDictFiles { @@ -350,9 +350,9 @@ void LwpDocument::RegisterGraphicsStyles() */ void LwpDocument::RegisterLinenumberStyles() { - if (!m_xLnOpts) + if (!m_oLnOpts) return; - m_xLnOpts->RegisterStyle(); + m_oLnOpts->RegisterStyle(); } /** diff --git a/lotuswordpro/source/filter/lwpdoc.hxx b/lotuswordpro/source/filter/lwpdoc.hxx index 155e5f85570b..24492dee76e9 100644 --- a/lotuswordpro/source/filter/lwpdoc.hxx +++ b/lotuswordpro/source/filter/lwpdoc.hxx @@ -65,6 +65,7 @@ #include "lwplnopts.hxx" #include "lwpdlvlist.hxx" #include +#include class IXFStream; class LwpVirtualLayout; @@ -93,7 +94,7 @@ private: DOC_CHILDDOC = 0x00000800UL }; - std::unique_ptr m_xLnOpts; + std::optional m_oLnOpts; LwpObjectID m_DivOpts; LwpObjectID m_FootnoteOpts; diff --git a/lotuswordpro/source/filter/lwpfoundry.cxx b/lotuswordpro/source/filter/lwpfoundry.cxx index 07a5c872a45d..7c6894b7c7c3 100644 --- a/lotuswordpro/source/filter/lwpfoundry.cxx +++ b/lotuswordpro/source/filter/lwpfoundry.cxx @@ -79,7 +79,6 @@ LwpFoundry::LwpFoundry(LwpObjectStream *pStrm, LwpDocument* pDoc) , m_bRegisteredAll(false) { Read(pStrm); - m_xDropcapMgr.reset(new LwpDropcapMgr); m_xBulletStyleMgr.reset(new LwpBulletStyleMgr); m_xBulletStyleMgr->SetFoundry(this); } diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx b/lotuswordpro/source/filter/lwpfribptr.cxx index 01089461d576..746aac854cb7 100644 --- a/lotuswordpro/source/filter/lwpfribptr.cxx +++ b/lotuswordpro/source/filter/lwpfribptr.cxx @@ -270,7 +270,7 @@ void LwpFribPtr::XFConvert() if (pLayout.is() && pLayout->GetTag() == VO_DROPCAPLAYOUT) { LwpFoundry* pFoundry = m_pPara->GetFoundry(); - LwpDropcapMgr* pMgr = pFoundry ? pFoundry->GetDropcapMgr() : nullptr; + LwpDropcapMgr* pMgr = pFoundry ? &pFoundry->GetDropcapMgr() : nullptr; if (pMgr) pMgr->SetXFPara(m_pXFPara.get()); } diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 6405e2277e79..4de86299e369 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -530,7 +530,6 @@ rtl::Reference LwpHeadLayout::FindEnSuperTableLayout() LwpLayoutStyle::LwpLayoutStyle() : m_nStyleDefinition(0) - , m_pDescription(new LwpAtomHolder) , m_nKey(0) { } @@ -540,7 +539,7 @@ LwpLayoutStyle::~LwpLayoutStyle() {} void LwpLayoutStyle::Read(LwpObjectStream* pStrm) { m_nStyleDefinition = pStrm->QuickReaduInt32(); - m_pDescription->Read(pStrm); + m_aDescription.Read(pStrm); if (pStrm->CheckExtra()) { m_nKey = pStrm->QuickReaduInt16(); diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index 3c86921da631..99cd1b922eb4 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -323,7 +323,7 @@ public: void Read(LwpObjectStream* pStrm); private: sal_uInt32 m_nStyleDefinition; - std::unique_ptr m_pDescription; + LwpAtomHolder m_aDescription; sal_uInt16 m_nKey; }; diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx index 50a1cd96eab1..f6c9cd5e6bb3 100644 --- a/lotuswordpro/source/filter/lwppara.cxx +++ b/lotuswordpro/source/filter/lwppara.cxx @@ -744,7 +744,7 @@ void LwpPara::ParseDropcapContent() { if (!GetFoundry()) return; - XFParagraph* pDropcap = GetFoundry()->GetDropcapMgr()->GetXFPara(); + XFParagraph* pDropcap = GetFoundry()->GetDropcapMgr().GetXFPara(); if (pDropcap) { m_Fribs.SetXFPara(pDropcap); diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx index 629b5affcfb5..da19ca474e60 100644 --- a/lotuswordpro/source/filter/lwpsilverbullet.cxx +++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx @@ -74,7 +74,6 @@ LwpSilverBullet::LwpSilverBullet(LwpObjectHeader const & objHdr, LwpSvStream* pS : LwpDLNFVList(objHdr, pStrm) , m_nFlags(0) , m_nUseCount(0) - , m_pAtomHolder(new LwpAtomHolder) { memset(m_pHideLevels, 0, sizeof(m_pHideLevels)); } @@ -103,7 +102,7 @@ void LwpSilverBullet::Read() m_nUseCount = m_pObjStrm->QuickReaduInt32(); - m_pAtomHolder->Read(m_pObjStrm.get()); + m_aAtomHolder.Read(m_pObjStrm.get()); } /** diff --git a/lotuswordpro/source/filter/lwpsilverbullet.hxx b/lotuswordpro/source/filter/lwpsilverbullet.hxx index 8c68a960eedc..9482bb6ca010 100644 --- a/lotuswordpro/source/filter/lwpsilverbullet.hxx +++ b/lotuswordpro/source/filter/lwpsilverbullet.hxx @@ -130,7 +130,7 @@ private: LwpObjectID m_aStory; sal_uInt8 m_pResetPositionFlags[MAXNUMBERPOSITIONS]; sal_uInt32 m_nUseCount; - std::unique_ptr m_pAtomHolder; + LwpAtomHolder m_aAtomHolder; rtl::Reference m_xBulletPara; OUString m_strStyleName; -- cgit