TextItem splitting has been fixed

This commit is contained in:
Arin Alexander 2016-11-04 01:24:03 +03:00
parent f01c586926
commit 04745def1e

View File

@ -655,11 +655,11 @@ BaseDesignIntf *TextItem::cloneBottomPart(int height, QObject *owner, QGraphicsI
loop_exit:;
int textPos=0;
for (;curBlock!=m_text->end();curBlock=curBlock.next(),curLine=0){
for (;curBlock!=m_text->end() || curLine<curBlock.lineCount();curBlock=curBlock.next(), curLine=0, tmpText+='\n'){
for (;curLine<curBlock.layout()->lineCount();curLine++){
if (tmpText=="") textPos= curBlock.layout()->lineAt(curLine).textStart();
tmpText+=curBlock.text().mid(curBlock.layout()->lineAt(curLine).textStart(),
curBlock.layout()->lineAt(curLine).textLength()) + "\n";
curBlock.layout()->lineAt(curLine).textLength());
}
}
tmpText.chop(1);