Problem: 1385380
Title: (Documents - Editions) TEditionDocument::DoRead does not set ResFile
Received: Sep 5 1996 3:35PM
Below you will find a modified version of TEditionDocument::DoRead which saves, sets and restores the resfile, so the section-resource is read from the right document.
void TEditionDocument::DoRead(TFile* aFile, Boolean forPrinting) // override { MAVolatileInit (short, curResFile, MACurResFile ()); Inherited::DoRead(aFile, forPrinting); FailInfo fi; Try(fi) { // !!! BUG-FIX !!! Inserted a FailureHandler // Save, set, and restore the current ResFile if (aFile) aFile->UseResource (); // 1. read in (from a resource) fStopAllEditions and fShowSectionBorders this->DoReadSettings(aFile); // 2. create the section objects and tell each section to read itself in for (short i = 1; i <= Count1Resources(rSectionType); ++i) { short theID; Handle h; h = Get1IndResource(rSectionType, i); // get the resource handle FailNILResource((Handle)h); theID = (short)(*((SectionHandle)h))->sectionID; switch ((*((SectionHandle)h))->kind) { case stPublisher: this->DoReadPublisher(aFile, theID); break; case stSubscriber: this->DoReadSubscriber(aFile, theID); break; default: #if qDebug ProgramBreak("SectionHandle appears to be corrupt"); #endif break; } } MAUseResFile (curResFile); fi.Success (); } else { MAUseResFile (curResFile); fi.ReSignal (); } } // TEditionDocument::DoRead