View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017461 | Scribus | General | public | 2025-03-18 20:48 | 2025-03-21 21:56 |
Reporter | ale | Assigned To | nitramr | ||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Product Version | 1.7.1.svn | ||||
Fixed in Version | 1.7.1.svn | ||||
Summary | 0017461: Mixing || and && needs parentheses... | ||||
Description | canvasmode_nodeedit.cpp: In member function 'void CanvasMode_NodeEdit::handleNodeEditPress(QMouseEvent*, QRect)': canvasmode_nodeedit.cpp:951:130: warning: suggest parentheses around '&&' within '||' [-Wparentheses] 951 | if ((m_doc->nodeEdit.submode() == NodeEditContext::DEL_POINT || m_doc->nodeEdit.submode() == NodeEditContext::MOVE_POINT && m->modifiers() == Qt::ControlModifier) && m_doc->nodeEdit.hasNodeSelected() && state.clickedOn == NodeHandle) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ canvasmode_nodeedit.cpp:957:130: warning: suggest parentheses around '&&' within '||' [-Wparentheses] 957 | if ((m_doc->nodeEdit.submode() == NodeEditContext::ADD_POINT || m_doc->nodeEdit.submode() == NodeEditContext::MOVE_POINT && m->modifiers() == Qt::ControlModifier) && (m_doc->nodeEdit.clre2() != -1)) | ||||
Tags | No tags attached. | ||||
Patch | Yes | ||||
|
Patch should fix the warnings. canvasnode_2025-03-20_01.patch (1,367 bytes)
Index: scribus/canvasmode_nodeedit.cpp =================================================================== --- scribus/canvasmode_nodeedit.cpp (Revision 26797) +++ scribus/canvasmode_nodeedit.cpp (Arbeitskopie) @@ -947,14 +947,14 @@ } } } - - if ((m_doc->nodeEdit.submode() == NodeEditContext::DEL_POINT || m_doc->nodeEdit.submode() == NodeEditContext::MOVE_POINT && m->modifiers() == Qt::ControlModifier) && m_doc->nodeEdit.hasNodeSelected() && state.clickedOn == NodeHandle) + + if ((m_doc->nodeEdit.submode() == NodeEditContext::DEL_POINT || (m_doc->nodeEdit.submode() == NodeEditContext::MOVE_POINT && m->modifiers() == Qt::ControlModifier)) && m_doc->nodeEdit.hasNodeSelected() && state.clickedOn == NodeHandle) { - edited = deleteNodes(); - } + edited = deleteNodes(); + } - // Add node id "add point" mode OR "move point" mode + CTRL - if ((m_doc->nodeEdit.submode() == NodeEditContext::ADD_POINT || m_doc->nodeEdit.submode() == NodeEditContext::MOVE_POINT && m->modifiers() == Qt::ControlModifier) && (m_doc->nodeEdit.clre2() != -1)) + // Add node id "add point" mode OR "move point" mode + CTRL + if ((m_doc->nodeEdit.submode() == NodeEditContext::ADD_POINT || (m_doc->nodeEdit.submode() == NodeEditContext::MOVE_POINT && m->modifiers() == Qt::ControlModifier)) && (m_doc->nodeEdit.clre2() != -1)) { bool foundP = false; uint seg = 0; |
|
Well I opened the ticket not (mainly) because the warning should go away, but also because someone who knows what the code should go might need to check that the and ands ors are correct (and then add the parenthesis) |
|
>> someone who knows what the code should go might need to check Seems like it is me. I changed the code recently with the last node editing changes. To delete a node, you can: 1. select to "node delete tool" OR 2. hold ctrl and hover over a node To add a new node, you can: 1. select the "node add tool" OR 2. hold ctrl and hover over a segment line |
|
Perfect! |
|
Patch has been applied, thanks @nitramr! |
Date Modified | Username | Field | Change |
---|---|---|---|
2025-03-18 20:48 | ale | New Issue | |
2025-03-20 19:23 | nitramr | Note Added: 0052277 | |
2025-03-20 19:23 | nitramr | File Added: canvasnode_2025-03-20_01.patch | |
2025-03-20 19:23 | nitramr | Patch | No => Yes |
2025-03-20 19:24 | nitramr | Assigned To | => nitramr |
2025-03-20 19:24 | nitramr | Status | new => assigned |
2025-03-20 21:12 | ale | Note Added: 0052279 | |
2025-03-20 21:20 | nitramr | Note Added: 0052280 | |
2025-03-21 06:29 | ale | Note Added: 0052282 | |
2025-03-21 21:55 | jghali | Summary | mixing || and && needs parentheses... => Mixing || and && needs parentheses... |
2025-03-21 21:56 | jghali | Status | assigned => resolved |
2025-03-21 21:56 | jghali | Resolution | open => fixed |
2025-03-21 21:56 | jghali | Fixed in Version | => 1.7.1.svn |
2025-03-21 21:56 | jghali | Note Added: 0052287 |