summaryrefslogtreecommitdiff
path: root/l10ntools/source
diff options
context:
space:
mode:
Diffstat (limited to 'l10ntools/source')
-rw-r--r--l10ntools/source/lngmerge.cxx7
-rw-r--r--l10ntools/source/propmerge.cxx6
2 files changed, 5 insertions, 8 deletions
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index a1de58d879f1..0411e1c6d201 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -22,6 +22,7 @@
#include <cstddef>
#include <fstream>
#include <iterator>
+#include <memory>
#include <string>
#include "po.hxx"
@@ -196,9 +197,9 @@ bool LngParser::Merge(
OString sID( sGroup );
std::size_t nLastLangPos = 0;
- ResData *pResData = new ResData( sID, sSource );
+ std::unique_ptr<ResData> pResData( new ResData( sID, sSource ) );
pResData->sResTyp = "LngText";
- MergeEntrys *pEntrys = aMergeDataFile.GetMergeEntrys( pResData );
+ MergeEntrys *pEntrys = aMergeDataFile.GetMergeEntrys( pResData.get() );
// read languages
bGroup = false;
@@ -305,8 +306,6 @@ bool LngParser::Merge(
}
}
}
-
- delete pResData;
}
for ( size_t i = 0; i < pLines->size(); ++i )
diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx
index e4e75f648f33..3a7c92b0aae4 100644
--- a/l10ntools/source/propmerge.cxx
+++ b/l10ntools/source/propmerge.cxx
@@ -166,10 +166,10 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil
return;
}
- MergeDataFile* pMergeDataFile = nullptr;
+ std::unique_ptr<MergeDataFile> pMergeDataFile;
if( m_sLang != "qtz" )
{
- pMergeDataFile = new MergeDataFile( rMergeSrc, m_sSource, false, false );
+ pMergeDataFile.reset( new MergeDataFile( rMergeSrc, m_sSource, false, false ) );
const std::vector<OString> vLanguages = pMergeDataFile->GetLanguages();
if( vLanguages.size()>=1 && vLanguages[0] != m_sLang )
@@ -179,7 +179,6 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil
" Mergedata file: ")
<< m_sLang.getStr() << " - "
<< vLanguages[0].getStr() << std::endl;
- delete pMergeDataFile;
return;
}
}
@@ -225,7 +224,6 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil
}
}
aDestination.close();
- delete pMergeDataFile;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */