예제 #1
0
XtgScanner::XtgScanner(QString filename, PageItem *item, bool textOnly, bool prefix)
{
	m_item = item;
	importTextOnly = textOnly;
	loadRawBytes(filename, input_Buffer);
	top = 0;
	if ((input_Buffer[0] == '\xFF') && (input_Buffer[1] == '\xFE'))
	{
		QByteArray tmpBuf;
		for (int a = 2; a < input_Buffer.count(); a += 2)
		{
			tmpBuf.append(input_Buffer[a]);
		}
		input_Buffer = tmpBuf;
	}
	doc = item->doc();
	initTagMode();
	initTextMode();
	initNameMode();
	initLanguages();
	prevMode = textMode;
	textToAppend = "";
	define = 0;
	styleEffects = ScStyle_None;
	m_codecList = QTextCodec::availableCodecs();
	if (m_codecList.contains("cp1252"))
		m_codec = QTextCodec::codecForName("cp1252");		// Default ANSI codec
	else
		m_codec = QTextCodec::codecForLocale();
	m_isBold = false;
	m_isItalic = false;
	inDef = false;
	m_prefixName = prefix;
}
예제 #2
0
XtgScanner::XtgScanner (QString documentName, TextWriter *wr, QString& buffer, bool textOnly, bool prefix)
{
	writer = wr;
	docname = documentName;
	importTextOnly = textOnly;
	usePrefix    = prefix;
	input_Buffer = buffer;
	doc = writer->currentDoc();
	initTagMode();
	initTextMode();
	initNameMode();
	initLanguages();
	top=0;
	prevMode = textMode;
	textToAppend = "";
	define = 0;
	isBold=false;
	isItalic=false;
}