summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-12-13 11:39:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-18 07:22:53 +0100
commitebad2d305cd727dd94caef21031f4f268b7c642c (patch)
treefad523c3b0d327cbb9771ed8df04dd7ed5c8a272 /xmloff
parentb06b3bcc6900014989da8060d126a45f31c9b8b7 (diff)
use unique_ptr in XMLTextImportPropertyMapper
Change-Id: I8cc60add5fd8e3e17804795915fc4f87523b0599 Reviewed-on: https://gerrit.libreoffice.org/65143 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/txtimppr.cxx72
1 files changed, 36 insertions, 36 deletions
diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx
index a3303594ce7b..ee41e82b40be 100644
--- a/xmloff/source/text/txtimppr.cxx
+++ b/xmloff/source/text/txtimppr.cxx
@@ -187,10 +187,10 @@ void XMLTextImportPropertyMapper::FontDefaultsCheck(
XMLPropertyState const * pFontFamily,
XMLPropertyState const * pFontPitch,
XMLPropertyState const * pFontCharSet,
- XMLPropertyState** ppNewFontStyleName,
- XMLPropertyState** ppNewFontFamily,
- XMLPropertyState** ppNewFontPitch,
- XMLPropertyState** ppNewFontCharSet ) const
+ std::unique_ptr<XMLPropertyState>* ppNewFontStyleName,
+ std::unique_ptr<XMLPropertyState>* ppNewFontFamily,
+ std::unique_ptr<XMLPropertyState>* ppNewFontPitch,
+ std::unique_ptr<XMLPropertyState>* ppNewFontCharSet ) const
{
if( pFontFamilyName )
{
@@ -204,8 +204,8 @@ void XMLTextImportPropertyMapper::FontDefaultsCheck(
pFontFamilyName->mnIndex + 1 );
assert(nTmp == CTF_FONTSTYLENAME || nTmp == CTF_FONTSTYLENAME_CJK || nTmp == CTF_FONTSTYLENAME_CTL);
#endif
- *ppNewFontStyleName = new XMLPropertyState( pFontFamilyName->mnIndex + 1,
- aAny );
+ ppNewFontStyleName->reset(new XMLPropertyState( pFontFamilyName->mnIndex + 1,
+ aAny ));
}
if( !pFontFamily )
@@ -217,8 +217,8 @@ void XMLTextImportPropertyMapper::FontDefaultsCheck(
pFontFamilyName->mnIndex + 2 );
assert(nTmp == CTF_FONTFAMILY || nTmp == CTF_FONTFAMILY_CJK || nTmp == CTF_FONTFAMILY_CTL);
#endif
- *ppNewFontFamily = new XMLPropertyState( pFontFamilyName->mnIndex + 2,
- aAny );
+ ppNewFontFamily->reset(new XMLPropertyState( pFontFamilyName->mnIndex + 2,
+ aAny ));
}
if( !pFontPitch )
@@ -229,8 +229,8 @@ void XMLTextImportPropertyMapper::FontDefaultsCheck(
pFontFamilyName->mnIndex + 3 );
assert(nTmp == CTF_FONTPITCH || nTmp == CTF_FONTPITCH_CJK || nTmp == CTF_FONTPITCH_CTL);
#endif
- *ppNewFontPitch = new XMLPropertyState( pFontFamilyName->mnIndex + 3,
- aAny );
+ ppNewFontPitch->reset(new XMLPropertyState( pFontFamilyName->mnIndex + 3,
+ aAny ));
}
if( !pFontCharSet )
@@ -241,8 +241,8 @@ void XMLTextImportPropertyMapper::FontDefaultsCheck(
pFontFamilyName->mnIndex + 4 );
assert(nTmp == CTF_FONTCHARSET || nTmp == CTF_FONTCHARSET_CJK || nTmp == CTF_FONTCHARSET_CTL);
#endif
- *ppNewFontCharSet = new XMLPropertyState( pFontFamilyName->mnIndex + 4,
- aAny );
+ ppNewFontCharSet->reset(new XMLPropertyState( pFontFamilyName->mnIndex + 4,
+ aAny ));
}
}
@@ -366,28 +366,28 @@ void XMLTextImportPropertyMapper::finished(
XMLPropertyState* pFontFamily = nullptr;
XMLPropertyState* pFontPitch = nullptr;
XMLPropertyState* pFontCharSet = nullptr;
- XMLPropertyState* pNewFontStyleName = nullptr;
- XMLPropertyState* pNewFontFamily = nullptr;
- XMLPropertyState* pNewFontPitch = nullptr;
- XMLPropertyState* pNewFontCharSet = nullptr;
+ std::unique_ptr<XMLPropertyState> pNewFontStyleName;
+ std::unique_ptr<XMLPropertyState> pNewFontFamily;
+ std::unique_ptr<XMLPropertyState> pNewFontPitch;
+ std::unique_ptr<XMLPropertyState> pNewFontCharSet;
XMLPropertyState* pFontFamilyNameCJK = nullptr;
XMLPropertyState* pFontStyleNameCJK = nullptr;
XMLPropertyState* pFontFamilyCJK = nullptr;
XMLPropertyState* pFontPitchCJK = nullptr;
XMLPropertyState* pFontCharSetCJK = nullptr;
- XMLPropertyState* pNewFontStyleNameCJK = nullptr;
- XMLPropertyState* pNewFontFamilyCJK = nullptr;
- XMLPropertyState* pNewFontPitchCJK = nullptr;
- XMLPropertyState* pNewFontCharSetCJK = nullptr;
+ std::unique_ptr<XMLPropertyState> pNewFontStyleNameCJK;
+ std::unique_ptr<XMLPropertyState> pNewFontFamilyCJK;
+ std::unique_ptr<XMLPropertyState> pNewFontPitchCJK;
+ std::unique_ptr<XMLPropertyState> pNewFontCharSetCJK;
XMLPropertyState* pFontFamilyNameCTL = nullptr;
XMLPropertyState* pFontStyleNameCTL = nullptr;
XMLPropertyState* pFontFamilyCTL = nullptr;
XMLPropertyState* pFontPitchCTL = nullptr;
XMLPropertyState* pFontCharSetCTL = nullptr;
- XMLPropertyState* pNewFontStyleNameCTL = nullptr;
- XMLPropertyState* pNewFontFamilyCTL = nullptr;
- XMLPropertyState* pNewFontPitchCTL = nullptr;
- XMLPropertyState* pNewFontCharSetCTL = nullptr;
+ std::unique_ptr<XMLPropertyState> pNewFontStyleNameCTL;
+ std::unique_ptr<XMLPropertyState> pNewFontFamilyCTL;
+ std::unique_ptr<XMLPropertyState> pNewFontPitchCTL;
+ std::unique_ptr<XMLPropertyState> pNewFontCharSetCTL;
XMLPropertyState* pAllBorderDistance = nullptr;
XMLPropertyState* pBorderDistances[4] = { nullptr, nullptr, nullptr, nullptr };
XMLPropertyState* pNewBorderDistances[4] = { nullptr, nullptr, nullptr, nullptr };
@@ -685,73 +685,73 @@ void XMLTextImportPropertyMapper::finished(
if( pNewFontStyleName )
{
rProperties.push_back( *pNewFontStyleName );
- delete pNewFontStyleName;
+ pNewFontStyleName.reset();
}
if( pNewFontFamily )
{
rProperties.push_back( *pNewFontFamily );
- delete pNewFontFamily;
+ pNewFontFamily.reset();
}
if( pNewFontPitch )
{
rProperties.push_back( *pNewFontPitch );
- delete pNewFontPitch;
+ pNewFontPitch.reset();
}
if( pNewFontCharSet )
{
rProperties.push_back( *pNewFontCharSet );
- delete pNewFontCharSet;
+ pNewFontCharSet.reset();
}
if( pNewFontStyleNameCJK )
{
rProperties.push_back( *pNewFontStyleNameCJK );
- delete pNewFontStyleNameCJK;
+ pNewFontStyleNameCJK.reset();
}
if( pNewFontFamilyCJK )
{
rProperties.push_back( *pNewFontFamilyCJK );
- delete pNewFontFamilyCJK;
+ pNewFontFamilyCJK.reset();
}
if( pNewFontPitchCJK )
{
rProperties.push_back( *pNewFontPitchCJK );
- delete pNewFontPitchCJK;
+ pNewFontPitchCJK.reset();
}
if( pNewFontCharSetCJK )
{
rProperties.push_back( *pNewFontCharSetCJK );
- delete pNewFontCharSetCJK;
+ pNewFontCharSetCJK.reset();
}
if( pNewFontStyleNameCTL)
{
rProperties.push_back( *pNewFontStyleNameCTL );
- delete pNewFontStyleNameCTL;
+ pNewFontStyleNameCTL.reset();
}
if( pNewFontFamilyCTL )
{
rProperties.push_back( *pNewFontFamilyCTL );
- delete pNewFontFamilyCTL;
+ pNewFontFamilyCTL.reset();
}
if( pNewFontPitchCTL )
{
rProperties.push_back( *pNewFontPitchCTL );
- delete pNewFontPitchCTL;
+ pNewFontPitchCTL.reset();
}
if( pNewFontCharSetCTL )
{
rProperties.push_back( *pNewFontCharSetCTL );
- delete pNewFontCharSetCTL;
+ pNewFontCharSetCTL.reset();
}
for (sal_uInt16 i=0; i<4; i++)