Exemple #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;
}
Exemple #2
0
void XtgIm::loadFiletoArray()
{
	loadRawBytes(filename, buffer);
}