コード例 #1
0
UT_Error IE_Imp_PalmDoc::_loadFile(GsfInput * input)
{
	m_pdfp = (GsfInput*)g_object_ref (G_OBJECT (input));
	if (!m_pdfp)
	{
		return UT_ERROR;
	}
	
	UT_Error error;

	X_CleanupIfError(error,_writeHeader(m_pdfp));
	X_CleanupIfError(error,_parseFile(m_pdfp));

	error = UT_OK;

Cleanup:
	g_object_unref(G_OBJECT(m_pdfp));
	return error;
}
コード例 #2
0
ファイル: ie_imp_GOChart.cpp プロジェクト: Distrotech/abiword
/*
  Import Object data from a plain text file
 \param szFilename Name of file to import
 Simply fills a UT_byteBuf with the contents of the Object
*/
UT_Error IE_Imp_Object::_loadFile(GsfInput * fp)
{
	ImportStreamFile * pStream = new ImportStreamFile(fp);
	UT_Error error;


	pStream->init(NULL);
	X_CleanupIfError(error,_parseStream(pStream));
	error = UT_OK;

Cleanup:
	delete pStream;
	return error;
}
コード例 #3
0
/*
  Import data from a plain text file
 \param szFilename Name of file to import

 Each line terminator is taken to be a paragraph break
*/
UT_Error IE_Imp_Text::_loadFile(GsfInput * fp)
{
	ImportStream *pStream = 0;
	UT_Error error;

	// First we try to determine the encoding.
	if (_recognizeEncoding(fp) == UT_OK)
		getDoc()->setEncodingName(m_szEncoding);

	// Call encoding dialog
	if (!m_bIsEncoded || m_bExplicitlySetEncoding || _doEncodingDialog(m_szEncoding))
	{
		X_CleanupIfError(error,_constructStream(pStream,fp));
		X_CleanupIfError(error,_writeHeader(fp));
		X_CleanupIfError(error,_parseStream(pStream));
		error = UT_OK;
	}
	else
		error = UT_ERROR;

Cleanup:
	delete pStream;
	return error;
}