| 82 | } |
| 83 | |
| 84 | void QFramedTextAttribute::clear(QTextCursor cursor) |
| 85 | { |
| 86 | auto doc = cursor.document(); |
| 87 | |
| 88 | for (auto blockIndex = 0; blockIndex < doc->blockCount(); ++blockIndex) |
| 89 | { |
| 90 | auto block = doc->findBlockByNumber(blockIndex); |
| 91 | |
| 92 | auto formats = block.textFormats(); |
| 93 | int offset = 0; |
| 94 | |
| 95 | for (auto &format : formats) |
| 96 | { |
| 97 | if (format.format.objectType() == type()) |
| 98 | { |
| 99 | cursor.setPosition(block.position() + format.start - offset); |
| 100 | cursor.deleteChar(); |
| 101 | ++offset; |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | } |
no outgoing calls