View Issue Details

IDProjectCategoryView StatusLast Update
0017461ScribusGeneralpublic2025-03-21 21:56
Reporterale Assigned Tonitramr  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version1.7.1.svn 
Fixed in Version1.7.1.svn 
Summary0017461: 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))
TagsNo tags attached.
PatchYes

Activities

nitramr

2025-03-20 19:23

developer   ~0052277

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;
canvasnode_2025-03-20_01.patch (1,367 bytes)   

ale

2025-03-20 21:12

manager   ~0052279

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)

nitramr

2025-03-20 21:20

developer   ~0052280

>> 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

ale

2025-03-21 06:29

manager   ~0052282

Perfect!

jghali

2025-03-21 21:56

administrator   ~0052287

Patch has been applied, thanks @nitramr!

Issue History

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