.
This commit is contained in:
+9
-26
@@ -1719,7 +1719,6 @@ void cDocumentReader::parseTextBlock(const QDomElement& element, QTextCursor* lp
|
||||
QVector<QTextLayout::FormatRange> textFormats;
|
||||
QString text;
|
||||
|
||||
qDebug() << "***** parseTextBlock start *****";
|
||||
QDomNamedNodeMap attributes = element.attributes();
|
||||
for(int x = 0;x < attributes.count();x++)
|
||||
{
|
||||
@@ -1753,7 +1752,6 @@ void cDocumentReader::parseTextBlock(const QDomElement& element, QTextCursor* lp
|
||||
|
||||
if(m_bFirstBlock)
|
||||
{
|
||||
qDebug() << "block #1";
|
||||
m_bFirstBlock = false;
|
||||
lpCursor->setBlockFormat(allFormats[blockFormatIndex].blockFormat);
|
||||
lpCursor->setCharFormat(allFormats[charFormatIndex].charFormat);
|
||||
@@ -1761,46 +1759,32 @@ void cDocumentReader::parseTextBlock(const QDomElement& element, QTextCursor* lp
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "block #n";
|
||||
if(listFormatIndex != -1)
|
||||
{
|
||||
int indent = allFormats[listFormatIndex].listFormat.indent();
|
||||
qDebug() << "listFormat";
|
||||
qDebug() << "--> " << text;
|
||||
indent = allFormats[listFormatIndex].listFormat.indent();
|
||||
|
||||
if(!m_textLists.contains(indent))
|
||||
{
|
||||
qDebug() << "list does not exist";
|
||||
qDebug() << " indent: " << indent;
|
||||
QTextListFormat format = allFormats[listFormatIndex].listFormat;
|
||||
QTextList* lpList = lpCursor->insertList(format);
|
||||
qDebug() << " list: " << (int)lpList;
|
||||
m_textLists.insert(indent, lpList);
|
||||
DO MUASS I UMMANANDATUAN ... INDEX FOISCH?
|
||||
// lpCursor->setBlockFormat(allFormats[blockFormatIndex].blockFormat);
|
||||
// lpCursor->setCharFormat(allFormats[charFormatIndex].charFormat);
|
||||
// lpCursor->setBlockCharFormat(allFormats[charFormatIndex].charFormat);
|
||||
|
||||
lpCursor->mergeBlockFormat(allFormats[blockFormatIndex].blockFormat);
|
||||
lpCursor->mergeCharFormat(allFormats[charFormatIndex].charFormat);
|
||||
lpCursor->mergeBlockCharFormat(allFormats[charFormatIndex].charFormat);
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "list already exists";
|
||||
qDebug() << " indent: " << indent;
|
||||
lpCursor->insertBlock();
|
||||
// lpCursor->setBlockFormat(allFormats[blockFormatIndex].blockFormat);
|
||||
// lpCursor->setCharFormat(allFormats[charFormatIndex].charFormat);
|
||||
// lpCursor->setBlockCharFormat(allFormats[charFormatIndex].charFormat);
|
||||
|
||||
lpCursor->mergeBlockFormat(allFormats[blockFormatIndex].blockFormat);
|
||||
lpCursor->mergeCharFormat(allFormats[charFormatIndex].charFormat);
|
||||
lpCursor->mergeBlockCharFormat(allFormats[charFormatIndex].charFormat);
|
||||
|
||||
QTextList* list = m_textLists.value(indent);
|
||||
qDebug() << " list: " << (int)list;
|
||||
list->add(lpCursor->block());
|
||||
}
|
||||
|
||||
// qDebug() << "process further";
|
||||
// QTextBlock block = lpCursor->block();
|
||||
// qDebug() << " indent: " << indent;
|
||||
// QTextList* list = m_textLists.value(indent);
|
||||
// qDebug() << " list: " << (int)list;
|
||||
// list->add(block);
|
||||
}
|
||||
// else if(tableFormatIndex != -1)
|
||||
// lpCursor->insertTable(allFormats[tableFormatIndex].tableFormat);
|
||||
@@ -1823,7 +1807,6 @@ DO MUASS I UMMANANDATUAN ... INDEX FOISCH?
|
||||
QString textPart = text.mid(start, length);
|
||||
lpCursor->insertText(textPart, format);
|
||||
}
|
||||
qDebug() << "****** parseTextBlock end ******";
|
||||
}
|
||||
|
||||
QVector<QTextLayout::FormatRange> cDocumentReader::parseTextFormats(const QDomElement& element)
|
||||
|
||||
Reference in New Issue
Block a user