summaryrefslogtreecommitdiff
path: root/lotuswordpro/inc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-03 11:36:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-03 12:38:46 +0200
commit86e54f2d757fe300ba634cdcbf0ee8a589dbc2ae (patch)
tree691ebc93098a0421dcf7f93fc07df3a06b6a879c /lotuswordpro/inc
parent222dc6ef01ae56f9c77d225f96a99a93f841e809 (diff)
loplugin:useuniqueptr in XFStyleContainer
Change-Id: I0a9765ab4107a534f211e3531f7948516f1a0c02 Reviewed-on: https://gerrit.libreoffice.org/52297 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro/inc')
-rw-r--r--lotuswordpro/inc/lwpfoundry.hxx2
-rw-r--r--lotuswordpro/inc/xfilter/xfdatestyle.hxx40
-rw-r--r--lotuswordpro/inc/xfilter/xfstylecont.hxx5
-rw-r--r--lotuswordpro/inc/xfilter/xfstylemanager.hxx2
4 files changed, 25 insertions, 24 deletions
diff --git a/lotuswordpro/inc/lwpfoundry.hxx b/lotuswordpro/inc/lwpfoundry.hxx
index 30b604b295fa..96c487c35c98 100644
--- a/lotuswordpro/inc/lwpfoundry.hxx
+++ b/lotuswordpro/inc/lwpfoundry.hxx
@@ -300,7 +300,7 @@ private:
LwpStyleMap m_StyleList;
public:
void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
- void AddStyle(LwpObjectID styleObjID, IXFStyle* pStyle);
+ void AddStyle(LwpObjectID styleObjID, std::unique_ptr<IXFStyle> pStyle);
IXFStyle* GetStyle(const LwpObjectID &styleObjID);
};
#endif
diff --git a/lotuswordpro/inc/xfilter/xfdatestyle.hxx b/lotuswordpro/inc/xfilter/xfdatestyle.hxx
index 6b1b2aa0223b..a292a8fdd5fc 100644
--- a/lotuswordpro/inc/xfilter/xfdatestyle.hxx
+++ b/lotuswordpro/inc/xfilter/xfdatestyle.hxx
@@ -122,83 +122,83 @@ inline void XFDatePart::SetTexture(bool bTexture)
inline void XFDateStyle::AddYear( bool bLongFmt )
{
- XFDatePart *part = new XFDatePart();
+ std::unique_ptr<XFDatePart> part(new XFDatePart());
part->SetPartType(enumXFDateYear);
part->SetLongFmt(bLongFmt);
- m_aParts.AddStyle(part);
+ m_aParts.AddStyle(std::move(part));
}
inline void XFDateStyle::AddMonth( bool bLongFmt, bool bTexture )
{
- XFDatePart *part = new XFDatePart();
+ std::unique_ptr<XFDatePart> part(new XFDatePart());
part->SetPartType(enumXFDateMonth);
part->SetLongFmt(bLongFmt);
part->SetTexture(bTexture);
- m_aParts.AddStyle(part);
+ m_aParts.AddStyle(std::move(part));
}
inline void XFDateStyle::AddMonthDay( bool bLongFmt )
{
- XFDatePart *part = new XFDatePart();
+ std::unique_ptr<XFDatePart> part(new XFDatePart());
part->SetPartType(enumXFDateMonthDay);
part->SetLongFmt(bLongFmt);
- m_aParts.AddStyle(part);
+ m_aParts.AddStyle(std::move(part));
}
inline void XFDateStyle::AddWeekDay( bool bLongFmt )
{
- XFDatePart *part = new XFDatePart();
+ std::unique_ptr<XFDatePart> part(new XFDatePart());
part->SetPartType(enumXFDateWeekDay);
part->SetLongFmt(bLongFmt);
- m_aParts.AddStyle(part);
+ m_aParts.AddStyle(std::move(part));
}
inline void XFDateStyle::AddEra()
{
- XFDatePart *part = new XFDatePart();
+ std::unique_ptr<XFDatePart> part(new XFDatePart());
part->SetPartType(enumXFDateEra);
part->SetLongFmt(false);
- m_aParts.AddStyle(part);
+ m_aParts.AddStyle(std::move(part));
}
inline void XFDateStyle::AddText( const OUString& text )
{
- XFDatePart *part = new XFDatePart();
+ std::unique_ptr<XFDatePart> part(new XFDatePart());
part->SetPartType(enumXFDateText);
part->SetText(text);
- m_aParts.AddStyle(part);
+ m_aParts.AddStyle(std::move(part));
}
inline void XFDateStyle::AddHour( bool bLongFmt )
{
- XFDatePart *part = new XFDatePart();
+ std::unique_ptr<XFDatePart> part(new XFDatePart());
part->SetPartType(enumXFDateHour);
part->SetLongFmt(bLongFmt);
- m_aParts.AddStyle(part);
+ m_aParts.AddStyle(std::move(part));
}
inline void XFDateStyle::AddMinute( bool bLongFmt )
{
- XFDatePart *part = new XFDatePart();
+ std::unique_ptr<XFDatePart> part(new XFDatePart());
part->SetPartType(enumXFDateMinute);
part->SetLongFmt(bLongFmt);
- m_aParts.AddStyle(part);
+ m_aParts.AddStyle(std::move(part));
}
inline void XFDateStyle::AddSecond( bool bLongFmt )
{
- XFDatePart *part = new XFDatePart();
+ std::unique_ptr<XFDatePart> part(new XFDatePart());
part->SetPartType(enumXFDateSecond);
part->SetLongFmt(bLongFmt);
part->SetDecimalPos(0);
- m_aParts.AddStyle(part);
+ m_aParts.AddStyle(std::move(part));
}
inline void XFDateStyle::AddAmPm()
{
- XFDatePart *part = new XFDatePart();
+ std::unique_ptr<XFDatePart> part(new XFDatePart());
part->SetPartType(enumXFDateAmPm);
- m_aParts.AddStyle(part);
+ m_aParts.AddStyle(std::move(part));
}
#endif
diff --git a/lotuswordpro/inc/xfilter/xfstylecont.hxx b/lotuswordpro/inc/xfilter/xfstylecont.hxx
index 12b6c751d3aa..15783b5d65fa 100644
--- a/lotuswordpro/inc/xfilter/xfstylecont.hxx
+++ b/lotuswordpro/inc/xfilter/xfstylecont.hxx
@@ -62,6 +62,7 @@
#include <xfilter/xfglobal.hxx>
#include <vector>
+#include <memory>
class IXFStyle;
@@ -98,7 +99,7 @@ public:
* @descr Add style to container.
* If the same style has exist, then pStyle will be deleted, and the same style will be return.
*/
- IXFStyleRet AddStyle(IXFStyle *pStyle);
+ IXFStyleRet AddStyle(std::unique_ptr<IXFStyle> pStyle);
/**
* @descr Find the same style.
@@ -135,7 +136,7 @@ public:
private:
static void ManageStyleFont(IXFStyle *pStyle);
private:
- std::vector<IXFStyle*> m_aStyles;
+ std::vector<std::unique_ptr<IXFStyle>> m_aStyles;
OUString m_strStyleNamePrefix;
};
diff --git a/lotuswordpro/inc/xfilter/xfstylemanager.hxx b/lotuswordpro/inc/xfilter/xfstylemanager.hxx
index fa5649b6492f..f9e9d9411055 100644
--- a/lotuswordpro/inc/xfilter/xfstylemanager.hxx
+++ b/lotuswordpro/inc/xfilter/xfstylemanager.hxx
@@ -95,7 +95,7 @@ public:
void AddFontDecl(XFFontDecl const & aFontDecl);
- IXFStyleRet AddStyle(IXFStyle *pStyle);
+ IXFStyleRet AddStyle(std::unique_ptr<IXFStyle> pStyle);
IXFStyle* FindStyle(const OUString& name);