diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-06-14 19:13:22 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-06-14 21:22:08 +0200 |
commit | 5435e2b2aa6cbd2b72df09c28d8d16bb71f5018f (patch) | |
tree | 3fd9d9bbe1419a44f27f0df1972e9874b50ee583 /connectivity/source/drivers/dbase | |
parent | df2f8116733fdf98ff6216afbfda62af4723f7e2 (diff) |
dBASE: put back an array for trailer
since except language code, the other information aren't used
but keep the details in comment
Change-Id: Ibb5bf22e88bd3a5f9c7603ad018cada8add8b2ce
Reviewed-on: https://gerrit.libreoffice.org/38799
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'connectivity/source/drivers/dbase')
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 14c75d283b34..a684616771c6 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -222,35 +222,7 @@ void ODbaseTable::readHeader() if (m_aHeader.recordLength == 0) throwInvalidDbaseFormat(); - m_pFileStream->ReadBytes(m_aHeader.reserved1, 2); - if(ERRCODE_NONE != m_pFileStream->GetErrorCode()) - throwInvalidDbaseFormat(); - - m_pFileStream->ReadUChar(m_aHeader.incompTransact); - if(ERRCODE_NONE != m_pFileStream->GetErrorCode()) - throwInvalidDbaseFormat(); - - m_pFileStream->ReadUChar(m_aHeader.encryptionFlag); - if(ERRCODE_NONE != m_pFileStream->GetErrorCode()) - throwInvalidDbaseFormat(); - - m_pFileStream->ReadBytes(m_aHeader.freeRecordThread, 4); - if(ERRCODE_NONE != m_pFileStream->GetErrorCode()) - throwInvalidDbaseFormat(); - - m_pFileStream->ReadBytes(m_aHeader.multiUserdBASE, 8); - if(ERRCODE_NONE != m_pFileStream->GetErrorCode()) - throwInvalidDbaseFormat(); - - m_pFileStream->ReadUChar(m_aHeader.MDXFlag); - if(ERRCODE_NONE != m_pFileStream->GetErrorCode()) - throwInvalidDbaseFormat(); - - m_pFileStream->ReadUChar(m_aHeader.languageDriver); - if(ERRCODE_NONE != m_pFileStream->GetErrorCode()) - throwInvalidDbaseFormat(); - - m_pFileStream->ReadBytes(m_aHeader.reserved2, 2); + m_pFileStream->ReadBytes(m_aHeader.trailer, 20); if(ERRCODE_NONE != m_pFileStream->GetErrorCode()) throwInvalidDbaseFormat(); @@ -277,9 +249,10 @@ void ODbaseTable::readHeader() case dBaseIIIMemo: case FoxProMemo: m_pFileStream->SetEndian(SvStreamEndian::LITTLE); - if ( m_aHeader.languageDriver != 0x00 && getConnection()->isTextEncodingDefaulted() ) + // trailer[17] corresponds to language code, see DBFHeader def in connectivity/source/inc/dbase/DTable.hxx + if ( m_aHeader.trailer[17] != 0x00 && getConnection()->isTextEncodingDefaulted() ) { - switch(m_aHeader.languageDriver) + switch(m_aHeader.trailer[17]) { case 0x01: m_eEncoding = RTL_TEXTENCODING_IBM_437; break; // DOS USA code page 437 case 0x02: m_eEncoding = RTL_TEXTENCODING_IBM_850; break; // DOS Multilingual code page 850 |