diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-04-11 21:19:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-04-11 21:41:57 +0100 |
commit | d2a1c2d4cfa51b6ee8a7f38baa258633fae9ec6d (patch) | |
tree | ab712bc1a814bfc15def9990df0896436f346628 /lotuswordpro/source/filter/lwp9reader.cxx | |
parent | 538dbe8245fc4644e1868a7df2ba788bcd08caf4 (diff) |
fix what there is to fix
Diffstat (limited to 'lotuswordpro/source/filter/lwp9reader.cxx')
-rw-r--r-- | lotuswordpro/source/filter/lwp9reader.cxx | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/lotuswordpro/source/filter/lwp9reader.cxx b/lotuswordpro/source/filter/lwp9reader.cxx index 16019b34de39..bd1a81dcfb09 100644 --- a/lotuswordpro/source/filter/lwp9reader.cxx +++ b/lotuswordpro/source/filter/lwp9reader.cxx @@ -77,18 +77,22 @@ Lwp9Reader::Lwp9Reader (LwpSvStream* pInputStream, IXFStream* pStream) void Lwp9Reader::Read() { LwpGlobalMgr* pGlobal = LwpGlobalMgr::GetInstance(m_pDocStream); - m_pObjMgr = pGlobal->GetLwpObjFactory(); - - //Commented out by , 10/26/2005 - //Read Ole object in LwpOleObject::XFConverter to support Ole in Linux - //ReadOleObjects(); + try + { + m_pObjMgr = pGlobal->GetLwpObjFactory(); - ReadFileHeader(); - //Does not support Word Pro 96 and previous versions - if(LwpFileHeader::m_nFileRevision>=0x000B) + ReadFileHeader(); + //Does not support Word Pro 96 and previous versions + if(LwpFileHeader::m_nFileRevision>=0x000B) + { + ReadIndex(); + ParseDocument(); + } + } + catch(...) { - ReadIndex(); - ParseDocument(); + LwpGlobalMgr::DeleteInstance(); + throw; } LwpGlobalMgr::DeleteInstance(); } @@ -181,14 +185,15 @@ void Lwp9Reader::ParseDocument() WriteDocHeader(); //Get root document - LwpDocument* doc = static_cast<LwpDocument*> ( m_LwpFileHdr.GetDocID()->obj() ); + LwpDocument* doc = dynamic_cast<LwpDocument*> ( m_LwpFileHdr.GetDocID()->obj() ); + + if (!doc) + return; //Parse Doc Data - LwpDocData *pDocData = static_cast<LwpDocData*>((doc->GetDocData())->obj()); + LwpDocData *pDocData = dynamic_cast<LwpDocData*>((doc->GetDocData())->obj()); if (pDocData!=NULL) - { pDocData->Parse(m_pStream); - } //Register Styles RegisteArrowStyles(); |