Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KPimTextEdit
Commits
f3cdc48d
Commit
f3cdc48d
authored
Sep 17, 2022
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/composer-ng/nestedlisthelper.cpp
View file @
f3cdc48d
...
...
@@ -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
);
...
...
src/composer-ng/nestedlisthelper_p.h
View file @
f3cdc48d
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment