summaryrefslogtreecommitdiff
path: root/l10ntools/source/po.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-08-18 11:33:49 +0200
committerNoel Grandin <noel@peralex.com>2015-08-20 09:55:43 +0200
commitfb2ad7ce2d201d9d2504274ad7e1bd0e803d9902 (patch)
tree77f343733eee6cafe3fc115ecab0af0a61862ab2 /l10ntools/source/po.cxx
parentaf6daec72b71b1d72a2555efdc5b2fb2e0ba2b90 (diff)
new loplugin automem
find places where we should be using std::unique_ptr Change-Id: I5b9defe778fdc4738ecea381215396874db59e66
Diffstat (limited to 'l10ntools/source/po.cxx')
-rw-r--r--l10ntools/source/po.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index c2acc2e25e8a..5dfa0b7a5f45 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -224,8 +224,7 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream)
PoEntry::PoEntry()
- : m_pGenPo( 0 )
- , m_bIsInitialized( false )
+ : m_bIsInitialized( false )
{
}
@@ -233,8 +232,7 @@ PoEntry::PoEntry(
const OString& rSourceFile, const OString& rResType, const OString& rGroupId,
const OString& rLocalId, const OString& rHelpText,
const OString& rText, const TYPE eType )
- : m_pGenPo( 0 )
- , m_bIsInitialized( false )
+ : m_bIsInitialized( false )
{
if( rSourceFile.isEmpty() )
throw NOSOURCFILE;
@@ -247,7 +245,7 @@ PoEntry::PoEntry(
else if ( rHelpText.getLength() == 5 )
throw WRONGHELPTEXT;
- m_pGenPo = new GenPoEntry();
+ m_pGenPo.reset( new GenPoEntry() );
m_pGenPo->setReference(rSourceFile.copy(rSourceFile.lastIndexOf('/')+1));
OString sMsgCtxt =
@@ -273,7 +271,6 @@ PoEntry::PoEntry(
PoEntry::~PoEntry()
{
- delete m_pGenPo;
}
PoEntry::PoEntry( const PoEntry& rPo )
@@ -296,13 +293,12 @@ PoEntry& PoEntry::operator=(const PoEntry& rPo)
}
else
{
- m_pGenPo = new GenPoEntry( *(rPo.m_pGenPo) );
+ m_pGenPo.reset( new GenPoEntry( *(rPo.m_pGenPo) ) );
}
}
else
{
- delete m_pGenPo;
- m_pGenPo = 0;
+ m_pGenPo.reset();
}
m_bIsInitialized = rPo.m_bIsInitialized;
return *this;
@@ -594,7 +590,7 @@ void PoIfstream::readEntry( PoEntry& rPoEntry )
}
else
{
- rPoEntry.m_pGenPo = new GenPoEntry( aGenPo );
+ rPoEntry.m_pGenPo.reset( new GenPoEntry( aGenPo ) );
}
rPoEntry.m_bIsInitialized = true;
}