summaryrefslogtreecommitdiff
path: root/l10ntools/source/po.cxx
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2012-12-11 19:11:35 +0100
committerZolnai Tamás <zolnaitamas2000@gmail.com>2012-12-11 22:30:29 +0100
commitdddca20c4871c7f7694510123f2366c3a179c06c (patch)
treefa4a42b26ffbc68f29b3f0796f3b3ca5772969c4 /l10ntools/source/po.cxx
parent2462391f4cc2ffad4fb218afe83ce0ed38f45207 (diff)
Skip poheader
Po headers can be various and they don not contain any needed information for merge so skip it without any checking. Change-Id: I6d81b7c85bfdbfd961361d98131ed80ba304e9ba
Diffstat (limited to 'l10ntools/source/po.cxx')
-rw-r--r--l10ntools/source/po.cxx38
1 files changed, 9 insertions, 29 deletions
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index c59a4f8a4e31..8d51671e1d5b 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -735,7 +735,6 @@ void PoOfstream::writeEntry( const PoEntry& rPoEntry )
PoIfstream::PoIfstream()
: m_aInPut()
- , m_bIsAfterHeader( false )
, m_bEof( false )
{
}
@@ -752,7 +751,14 @@ void PoIfstream::open( const OString& rFileName )
{
assert( !isOpen() );
m_aInPut.open( rFileName.getStr(), std::ios_base::in );
- m_bIsAfterHeader = false;
+
+ //Skip header
+ std::string sTemp;
+ std::getline(m_aInPut,sTemp);
+ while( !sTemp.empty() && !m_aInPut.eof() )
+ {
+ std::getline(m_aInPut,sTemp);
+ }
m_bEof = false;
}
@@ -762,35 +768,9 @@ void PoIfstream::close()
m_aInPut.close();
}
-void PoIfstream::readHeader( PoHeader& rPoHeader )
-{
- assert( isOpen() && !eof() && !m_bIsAfterHeader );
- GenPoEntry aGenPo;
- aGenPo.readFromFile( m_aInPut );
- if( !aGenPo.getExtractCom().isEmpty() &&
- aGenPo.getMsgId().isEmpty() &&
- !aGenPo.getMsgStr().isEmpty() )
- {
- if( rPoHeader.m_pGenPo )
- {
- *(rPoHeader.m_pGenPo) = aGenPo;
- }
- else
- {
- rPoHeader.m_pGenPo = new GenPoEntry( aGenPo );
- }
- rPoHeader.m_bIsInitialized = true;
- m_bIsAfterHeader = true;
- }
- else
- {
- throw INVALIDHEADER;
- }
-}
-
void PoIfstream::readEntry( PoEntry& rPoEntry )
{
- assert( isOpen() && !eof() && m_bIsAfterHeader );
+ assert( isOpen() && !eof() );
GenPoEntry aGenPo;
aGenPo.readFromFile( m_aInPut );
if( aGenPo.isNull() )