summaryrefslogtreecommitdiff
path: root/lotuswordpro/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-11 08:45:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-11 14:18:25 +0200
commitc8e2ae1b915477c76d38352298570af309a36d85 (patch)
tree607e2f652750ea11aceae68ce436219158979e3a /lotuswordpro/source
parentb0459b45f431490b8fcf94ecc6b01365efe0a11e (diff)
loplugin:inlinefields in lotuswordpro
Change-Id: I1ba5bdd59badd6f1b6562c6284baf05bcfc3d78c Reviewed-on: https://gerrit.libreoffice.org/36402 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r--lotuswordpro/source/filter/lwpfribtext.cxx9
-rw-r--r--lotuswordpro/source/filter/lwpfribtext.hxx2
-rw-r--r--lotuswordpro/source/filter/lwplayout.cxx34
-rw-r--r--lotuswordpro/source/filter/lwplayout.hxx12
-rw-r--r--lotuswordpro/source/filter/lwppagelayout.cxx14
-rw-r--r--lotuswordpro/source/filter/lwppagelayout.hxx6
-rw-r--r--lotuswordpro/source/filter/lwppara1.cxx4
-rw-r--r--lotuswordpro/source/filter/lwpparastyle.cxx18
-rw-r--r--lotuswordpro/source/filter/lwpparastyle.hxx6
9 files changed, 31 insertions, 74 deletions
diff --git a/lotuswordpro/source/filter/lwpfribtext.cxx b/lotuswordpro/source/filter/lwpfribtext.cxx
index 1d2c61ed4b84..b7b6a2ffbe46 100644
--- a/lotuswordpro/source/filter/lwpfribtext.cxx
+++ b/lotuswordpro/source/filter/lwpfribtext.cxx
@@ -129,7 +129,7 @@ void LwpFribParaNumber::Read(LwpObjectStream* pObjStrm, sal_uInt16 /*len*/)
* @short: default constructor of LwpFribDocVar
*/
LwpFribDocVar::LwpFribDocVar(LwpPara* pPara)
- : LwpFrib(pPara), m_nType(0), m_pName(new LwpAtomHolder)
+ : LwpFrib(pPara), m_nType(0)
{
}
/**
@@ -137,11 +137,6 @@ LwpFribDocVar::LwpFribDocVar(LwpPara* pPara)
*/
LwpFribDocVar::~LwpFribDocVar()
{
- if (m_pName)
- {
- delete m_pName;
- m_pName = nullptr;
- }
}
/**
* @short: Reading mothed of document variable frib.
@@ -151,7 +146,7 @@ LwpFribDocVar::~LwpFribDocVar()
void LwpFribDocVar::Read(LwpObjectStream* pObjStrm, sal_uInt16 /*len*/)
{
m_nType = pObjStrm->QuickReaduInt16();
- m_pName->Read(pObjStrm);
+ m_aName.Read(pObjStrm);
}
/**
diff --git a/lotuswordpro/source/filter/lwpfribtext.hxx b/lotuswordpro/source/filter/lwpfribtext.hxx
index 4917f96d5c43..79566424029c 100644
--- a/lotuswordpro/source/filter/lwpfribtext.hxx
+++ b/lotuswordpro/source/filter/lwpfribtext.hxx
@@ -166,7 +166,7 @@ public:
private:
sal_uInt16 m_nType;
- LwpAtomHolder* m_pName;
+ LwpAtomHolder m_aName;
OUString m_TimeStyle;
void RegisterDefaultTimeStyle();
void RegisterTotalTimeStyle();
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index 3c32355e776d..b5f5056ebf50 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -540,46 +540,32 @@ void LwpLayoutStyle::Read(LwpObjectStream* pStrm)
}
LwpLayoutMisc::LwpLayoutMisc() :
-m_nGridDistance(0), m_nGridType(0),
-m_pContentStyle(new LwpAtomHolder)
+m_nGridDistance(0), m_nGridType(0)
{
}
LwpLayoutMisc::~LwpLayoutMisc()
{
- if (m_pContentStyle)
- {
- delete m_pContentStyle;
- }
}
void LwpLayoutMisc::Read(LwpObjectStream* pStrm)
{
m_nGridType = pStrm->QuickReaduInt16();
m_nGridDistance = pStrm->QuickReadInt32();
- m_pContentStyle->Read(pStrm);
+ m_aContentStyle.Read(pStrm);
pStrm->SkipExtra();
}
LwpMiddleLayout::LwpMiddleLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm )
: LwpVirtualLayout(objHdr, pStrm)
- , m_pStyleStuff(new LwpLayoutStyle)
- , m_pMiscStuff(new LwpLayoutMisc)
, m_bGettingGeometry(false)
{
}
LwpMiddleLayout::~LwpMiddleLayout()
{
- if (m_pStyleStuff)
- {
- delete m_pStyleStuff;
- }
- if (m_pMiscStuff)
- {
- delete m_pMiscStuff;
- }
}
+
void LwpMiddleLayout::Read()
{
LwpObjectStream* pStrm = m_pObjStrm.get();
@@ -605,11 +591,11 @@ void LwpMiddleLayout::Read()
if (nWhatsItGot & DISK_GOT_STYLE_STUFF)
{
- m_pStyleStuff->Read(pStrm);
+ m_aStyleStuff.Read(pStrm);
}
if (nWhatsItGot & DISK_GOT_MISC_STUFF)
{
- m_pMiscStuff->Read(pStrm);
+ m_aMiscStuff.Read(pStrm);
}
m_LayGeometry.ReadIndexed(pStrm);
@@ -1473,15 +1459,11 @@ bool LwpMiddleLayout::HasContent()
}
LwpLayout::LwpLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm ) :
- LwpMiddleLayout(objHdr, pStrm), m_pUseWhen(new LwpUseWhen)
+ LwpMiddleLayout(objHdr, pStrm)
{}
LwpLayout::~LwpLayout()
{
- if (m_pUseWhen)
- {
- delete m_pUseWhen;
- }
}
void LwpLayout::Read()
@@ -1499,7 +1481,7 @@ void LwpLayout::Read()
if (!nSimple)
{
- m_pUseWhen->Read(pStrm);
+ m_aUseWhen.Read(pStrm);
sal_uInt8 nFlag = pStrm->QuickReaduInt8();
if (nFlag)
@@ -1749,7 +1731,7 @@ LwpUseWhen* LwpLayout::VirtualGetUseWhen()
{
if(m_nOverrideFlag & OVER_PLACEMENT)
{
- return m_pUseWhen;
+ return &m_aUseWhen;
}
else
{
diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx
index 5940afa8cda9..d7a6b6077b6e 100644
--- a/lotuswordpro/source/filter/lwplayout.hxx
+++ b/lotuswordpro/source/filter/lwplayout.hxx
@@ -321,9 +321,9 @@ public:
~LwpLayoutMisc();
void Read(LwpObjectStream* pStrm);
private:
- sal_Int32 m_nGridDistance;
- sal_uInt16 m_nGridType;
- LwpAtomHolder* m_pContentStyle;
+ sal_Int32 m_nGridDistance;
+ sal_uInt16 m_nGridType;
+ LwpAtomHolder m_aContentStyle;
};
class LwpMiddleLayout : public LwpVirtualLayout
@@ -400,8 +400,8 @@ protected:
LwpObjectID m_Content;
rtl::Reference<LwpObject> GetBasedOnStyle();
LwpObjectID m_TabPiece;
- LwpLayoutStyle* m_pStyleStuff;
- LwpLayoutMisc* m_pMiscStuff;
+ LwpLayoutStyle m_aStyleStuff;
+ LwpLayoutMisc m_aMiscStuff;
LwpObjectID m_LayGeometry;
LwpObjectID m_LayScale;
LwpObjectID m_LayMargins;
@@ -426,7 +426,7 @@ public:
protected:
void Read() override;
protected:
- LwpUseWhen* m_pUseWhen;
+ LwpUseWhen m_aUseWhen;
LwpObjectID m_Position;
LwpObjectID m_LayColumns;
LwpObjectID m_LayGutterStuff;
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx
index 08566613d2f3..5ee886b8284a 100644
--- a/lotuswordpro/source/filter/lwppagelayout.cxx
+++ b/lotuswordpro/source/filter/lwppagelayout.cxx
@@ -75,24 +75,14 @@
LwpPageLayout::LwpPageLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
: LwpLayout(objHdr, pStrm)
- , m_pPrinterBinName(new LwpAtomHolder)
, m_nPrinterBin(0)
, m_nBdroffset(0)
- , m_pPaperName(new LwpAtomHolder)
, m_pXFPageMaster(nullptr)
{
}
LwpPageLayout::~LwpPageLayout()
{
- if (m_pPrinterBinName)
- {
- delete m_pPrinterBinName;
- }
- if (m_pPaperName)
- {
- delete m_pPaperName;
- }
}
void LwpPageLayout::Read()
{
@@ -104,14 +94,14 @@ void LwpPageLayout::Read()
}
m_nPrinterBin = m_pObjStrm->QuickReaduInt16();
- m_pPrinterBinName->Read(m_pObjStrm.get());
+ m_PrinterBinName.Read(m_pObjStrm.get());
if (LwpFileHeader::m_nFileRevision >= 0x000B)
m_nBdroffset = m_pObjStrm->QuickReadInt32();
if (m_pObjStrm->CheckExtra())
{
- m_pPaperName->Read(m_pObjStrm.get());
+ m_PaperName.Read(m_pObjStrm.get());
m_pObjStrm->SkipExtra();
}
diff --git a/lotuswordpro/source/filter/lwppagelayout.hxx b/lotuswordpro/source/filter/lwppagelayout.hxx
index 5852bc9e2a2f..9ced5a80f856 100644
--- a/lotuswordpro/source/filter/lwppagelayout.hxx
+++ b/lotuswordpro/source/filter/lwppagelayout.hxx
@@ -92,11 +92,11 @@ protected:
double GetWidth() override;
double GetHeight() override;
protected:
- LwpAtomHolder* m_pPrinterBinName;
+ LwpAtomHolder m_PrinterBinName;
sal_uInt16 m_nPrinterBin;
sal_Int32 m_nBdroffset;
- LwpAtomHolder* m_pPaperName;
- XFPageMaster* m_pXFPageMaster;
+ LwpAtomHolder m_PaperName;
+ XFPageMaster* m_pXFPageMaster;
public:
bool HasColumns();
bool HasFillerPageText(LwpFoundry* pFoundry);
diff --git a/lotuswordpro/source/filter/lwppara1.cxx b/lotuswordpro/source/filter/lwppara1.cxx
index 8752c9ea2bb4..e029356668ee 100644
--- a/lotuswordpro/source/filter/lwppara1.cxx
+++ b/lotuswordpro/source/filter/lwppara1.cxx
@@ -462,7 +462,7 @@ void LwpPara::OverrideParaBullet(LwpParaProperty* pProps)
{
m_bHasBullet = true;
- LwpOverride* pBullet= pParaStyle->GetBulletOverride();
+ const LwpOverride* pBullet= pParaStyle->GetBulletOverride();
std::unique_ptr<LwpBulletOverride> pFinalBullet(
pBullet
? polymorphic_downcast<LwpBulletOverride*>(pBullet->clone())
@@ -488,7 +488,7 @@ void LwpPara::OverrideParaBullet(LwpParaProperty* pProps)
else
{
// m_pBullOver = pParaStyle->GetBulletOverride();
- LwpBulletOverride* pBullOver = pParaStyle->GetBulletOverride();
+ const LwpBulletOverride* pBullOver = pParaStyle->GetBulletOverride();
if (pBullOver)
{
m_aSilverBulletID = pBullOver->GetSilverBullet();
diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx
index 49c899f4a928..e5186e8f946c 100644
--- a/lotuswordpro/source/filter/lwpparastyle.cxx
+++ b/lotuswordpro/source/filter/lwpparastyle.cxx
@@ -82,22 +82,12 @@
#include "lwpsilverbullet.hxx"
LwpParaStyle::LwpParaStyle(LwpObjectHeader& objHdr, LwpSvStream* pStrm) :
-LwpTextStyle(objHdr, pStrm), m_pKinsokuOptsOverride(new LwpKinsokuOptsOverride),
-m_pBulletOverride(new LwpBulletOverride)
+LwpTextStyle(objHdr, pStrm)
{
}
LwpParaStyle::~LwpParaStyle()
{
- if (m_pKinsokuOptsOverride)
- {
- delete m_pKinsokuOptsOverride;
- }
-
- if (m_pBulletOverride)
- {
- delete m_pBulletOverride;
- }
}
void LwpParaStyle::Read()
@@ -139,8 +129,8 @@ void LwpParaStyle::Read()
m_NumberingStyle.ReadIndexed(m_pObjStrm.get());
m_TabStyle.ReadIndexed(m_pObjStrm.get());
- m_pKinsokuOptsOverride->Read(m_pObjStrm.get());
- m_pBulletOverride->Read(m_pObjStrm.get());
+ m_KinsokuOptsOverride.Read(m_pObjStrm.get());
+ m_BulletOverride.Read(m_pObjStrm.get());
if (m_pObjStrm->CheckExtra())
{
@@ -172,7 +162,7 @@ void LwpParaStyle::Apply(XFParaStyle *pParaStyle)
LwpIndentOverride *pIndent = dynamic_cast<LwpIndentOverride*>(pPiece->GetOverride());
if( pIndent )
{
- if (!m_pBulletOverride->IsInValid())// for remove bullet indent in named bullet style
+ if (!m_BulletOverride.IsInValid())// for remove bullet indent in named bullet style
{
std::unique_ptr<LwpIndentOverride> pNewIndent(pIndent->clone());
pNewIndent->SetMFirst(0);
diff --git a/lotuswordpro/source/filter/lwpparastyle.hxx b/lotuswordpro/source/filter/lwpparastyle.hxx
index 57b48922c481..7f3a88a6f23f 100644
--- a/lotuswordpro/source/filter/lwpparastyle.hxx
+++ b/lotuswordpro/source/filter/lwpparastyle.hxx
@@ -97,7 +97,7 @@ public:
LwpParaBorderOverride* GetParaBorder() const;
LwpBreaksOverride* GetBreaks() const;
LwpTabOverride* GetTabOverride() const;
- LwpBulletOverride* GetBulletOverride() const { return m_pBulletOverride;}
+ const LwpBulletOverride* GetBulletOverride() const { return &m_BulletOverride;}
LwpNumberingOverride* GetNumberingOverride() const;
public:
static void ApplySubBorder(LwpBorderStuff* pBorderStuff, LwpBorderStuff::BorderType eType, XFBorders* pXFBorders);
@@ -113,8 +113,8 @@ private:
LwpObjectID m_TabStyle;
LwpObjectID m_BackgroundStyle;
- LwpKinsokuOptsOverride* m_pKinsokuOptsOverride;
- LwpBulletOverride* m_pBulletOverride;
+ LwpKinsokuOptsOverride m_KinsokuOptsOverride;
+ LwpBulletOverride m_BulletOverride;
};
#endif