Commit f3cdc48d authored by Laurent Montel's avatar Laurent Montel
Browse files

Remove dead code + add missing Q_REQUIRED_RESULT

parent b9c0e146
Pipeline #233344 passed with stage
in 6 minutes and 24 seconds
......@@ -109,36 +109,6 @@ bool NestedListHelper::handleAfterKeyPressEvent(QKeyEvent *event)
return handled;
}
bool NestedListHelper::handleAfterDropEvent(QDropEvent *dropEvent)
{
Q_UNUSED(dropEvent)
QTextCursor cursor = topOfSelection();
QTextBlock droppedBlock = cursor.block();
const int firstDroppedItemIndent = droppedBlock.textList()->format().indent();
const int minimumIndent = droppedBlock.previous().textList()->format().indent();
if (firstDroppedItemIndent < minimumIndent) {
cursor = QTextCursor(droppedBlock);
QTextListFormat fmt = droppedBlock.textList()->format();
fmt.setIndent(minimumIndent);
QTextList *list = cursor.createList(fmt);
int endOfDrop = bottomOfSelection().position();
while (droppedBlock.next().position() < endOfDrop) {
droppedBlock = droppedBlock.next();
if (droppedBlock.textList()->format().indent() != firstDroppedItemIndent) {
// new list?
}
list->add(droppedBlock);
}
// list.add( droppedBlock );
}
return true;
}
void NestedListHelper::processList(QTextList *list)
{
QTextBlock block = list->item(0);
......
......@@ -48,7 +48,7 @@ public:
* @param event The event to be handled
* @return Whether the event was completely handled by this method.
*/
bool handleBeforeKeyPressEvent(QKeyEvent *event);
Q_REQUIRED_RESULT bool handleBeforeKeyPressEvent(QKeyEvent *event);
/**
*
......@@ -63,8 +63,6 @@ public:
*/
bool handleAfterKeyPressEvent(QKeyEvent *event);
bool handleAfterDropEvent(QDropEvent *event);
/**
* Increases the indent (nesting level) on the current list item or selection.
*/
......@@ -109,8 +107,8 @@ public:
Q_REQUIRED_RESULT bool canDedent() const;
private:
QTextCursor topOfSelection();
QTextCursor bottomOfSelection();
Q_REQUIRED_RESULT QTextCursor topOfSelection();
Q_REQUIRED_RESULT QTextCursor bottomOfSelection();
void processList(QTextList *list);
void reformatList(QTextBlock block);
void reformatList();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment