Ejemplo n.º 1
0
UT_Error IE_Imp_Psion::processHeaderFooter(const psiconv_page_layout_section layout,
                                           bool with_header, bool with_footer)
{
	UT_Error res;

	// Header
	if (with_header) {
		const PP_PropertyVector propsArray = {
			"id", "1",
			"type", "header"
		};
		if (!appendStrux(PTX_SectionHdrFtr,propsArray)) {
			return UT_IE_IMPORTERROR;
		}
		if ((res = readParagraphs(layout->header->text->paragraphs,NULL))) {
			return res;
		}
	}

	// Footer
	if (with_footer) {
		const PP_PropertyVector propsArray = {
			"id", "2",
			"type", "footer"
		};
		if (!appendStrux(PTX_SectionHdrFtr,propsArray)) {
			return UT_IE_IMPORTERROR;
		}
		if ((res = readParagraphs(layout->footer->text->paragraphs,NULL))) {
			return res;
		}
	}
	return res;
}
UT_Error IE_Imp_Psion::processHeaderFooter(const psiconv_page_layout_section layout,
                                           bool with_header, bool with_footer)
{
	const gchar* propsArray[5];
	UT_Error res;
	
	// Header
	if (with_header) {
		propsArray[0] = (const gchar *) "id";
		propsArray[1] = (const gchar *) "1";
		propsArray[2] = (const gchar *) "type";
		propsArray[3] = (const gchar *) "header";
		propsArray[4] = NULL;
		if (!appendStrux(PTX_SectionHdrFtr,propsArray))
			return UT_IE_IMPORTERROR;
		if ((res = readParagraphs(layout->header->text->paragraphs,NULL)))
			return res;
	}
	
	// Footer
	if (with_footer) {
		propsArray[0] = (const gchar *) "id";
		propsArray[1] = (const gchar *) "2";
		propsArray[2] = (const gchar *) "type";
		propsArray[3] = (const gchar *) "footer";
		propsArray[4] = NULL;
		if (!appendStrux(PTX_SectionHdrFtr,propsArray))
			return UT_IE_IMPORTERROR;
		if ((res = readParagraphs(layout->footer->text->paragraphs,NULL)))
			return res;
	}
	return res;
}
Ejemplo n.º 3
0
/*!  
 * Translate a psiconv TextEd file representation into an AbiWord document
 */
UT_Error IE_Imp_Psion_TextEd::parseFile(const psiconv_file psionfile)
{
	UT_Error res;
	bool header,footer;
	
	UT_DEBUGMSG(("PSION: Parsing Psion Texted file\n"));
	// It really should be a TextEd file!
	if (psionfile->type != psiconv_texted_file)
		return UT_IE_BOGUSDOCUMENT;
	psiconv_texted_f file = (psiconv_texted_f) (psionfile->file);

	// Note that a TextEd document has no styles
	
	// Handle the page settings (they always apply to the whole document
	if ((res = applyPageAttributes(file->page_sec,header,footer)))
		return res;
	// Handle all paragraphs with text and layout
	if ((res = readParagraphs(file->texted_sec->paragraphs, NULL)))
		return res;
	
	// Handle the headers and footers
	if ((res = processHeaderFooter(file->page_sec,header,footer)))
		return res;
	
	return UT_OK;
}
Ejemplo n.º 4
0
int r_sess__(FILE *mode_)
{
  FILE*mode;
  
 rw_paragraph  rd_array[NITEMS]=
 {
   {"Subprocess",  r_prc__},
   {"Session_number",  rnsess_},
   {"Initial_state",  r_in__},
   {"Physical_Parameters",  r_mdl__},
   {"Breit-Wigner", r_widths},
   {"Kinematical_scheme",  rdrkin_},
   {"Cuts",  rdrcut_},
   {"Regularization",  rdrreg_},
   {"QCD",  r_qcd__},
   {"Distributions", rdr_hist},
   {"Vegas_integral", readIntegral},
   {"Vegas_calls",  r_mc__},  
   {"Events", readEventSettings},
   {"Random", readRandom},
   {"VEGAS_Grid",readVegasGrid}
 };
                       
                         
 if (mode_ == NULL) 
 { 
   mode=fopen("session.dat","r"); 
   if (mode ==NULL) return 0;
 }else mode=mode_;
 readParagraphs(mode, NITEMS,rd_array); 
 
 if (mode_ == NULL) fclose(mode); 
 wrtprc_();
 return 0;
} /* r_sess__ */