View Issue Details

IDProjectCategoryView StatusLast Update
0007726ScribusCanvaspublic2009-01-26 20:42
Reporterpierremarchand Assigned Topierremarchand  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.5svn 
Target Version1.3.5Fixed in Version1.3.5svn 
Summary0007726: unselect group from a multi (shift left-click) does not work properly
DescriptionWhen unselecting a group from a multi, only the controlgroup item is unselected while grouped items are still selected.
I made the simpliest fix you can imagine which, I guess, could break things elsewhere. As I have no idea where exactly, I would like someone to have a look before i commit, hence this report and the attached diff.
TagsNo tags attached.
Patch

Relationships

related to 0000504 closedavox We need more accurate object selection 

Activities

2009-01-15 15:41

 

unselect-group-in-multi.diff (1,619 bytes)   
Index: scribus/selection.cpp
===================================================================
--- scribus/selection.cpp	(révision 13039)
+++ scribus/selection.cpp	(copie de travail)
@@ -20,6 +20,7 @@
 
 #include "scribusdoc.h"
 #include "selection.h"
+#include <QDebug>
 
 Selection::Selection(QObject* parent)
 	: QObject(parent),
@@ -257,18 +258,47 @@
 
 bool Selection::removeItem(PageItem *item)
 {
+    bool removeOk(false);
 	if (!m_SelList.isEmpty() && m_SelList.contains(item))
 	{
-		bool removeOk=(m_SelList.removeAll(item)==1);
-		if (removeOk)
+		bool itemIsGroup(item->Groups.count() > 0);
+		if(itemIsGroup)
 		{
+		    QList<PageItem*> gItems;
+		    foreach(PageItem *pi, m_SelList)
+		    {
+			if(pi->groups().top() == item->groups().top())
+			    gItems << pi;
+		    }
+		    foreach(PageItem *gi, gItems)
+		    {
+			removeOk=(m_SelList.removeAll(gi)==1);
+			if (removeOk)
+			{
+			    if (m_isGUISelection)
+			    {
+				gi->setSelected(false);
+				gi->disconnectFromGUI();
+			    }
+			    gi->isSingleSel = false;
+			}
+		    }
+		}
+		else // regular item
+		{
+		    removeOk=(m_SelList.removeAll(item)==1);
+		    if (removeOk)
+		    {
 			if (m_isGUISelection)
 			{
-				item->setSelected(false);
-				item->disconnectFromGUI();
+			    item->setSelected(false);
+			    item->disconnectFromGUI();
 			}
 			item->isSingleSel = false;
+		    }
 		}
+
+
 		if (m_SelList.isEmpty())
 			m_hasGroupSelection=false;
 		else if (m_isGUISelection)
@@ -278,7 +308,7 @@
 		}
 		return removeOk;
 	}
-	return false;
+	return removeOk;
 }
 
 PageItem* Selection::takeItem(int itemIndex)
unselect-group-in-multi.diff (1,619 bytes)   

Issue History

Date Modified Username Field Change
2009-01-15 15:41 pierremarchand New Issue
2009-01-15 15:41 pierremarchand Status new => assigned
2009-01-15 15:41 pierremarchand Assigned To => pierremarchand
2009-01-15 15:41 pierremarchand File Added: unselect-group-in-multi.diff
2009-01-22 19:36 avox View Status private => public
2009-01-26 15:36 pierremarchand Relationship added related to 0000504
2009-01-26 20:42 cbradney Status assigned => resolved
2009-01-26 20:42 cbradney Fixed in Version => 1.3.5svn
2009-01-26 20:42 cbradney Resolution open => fixed
2009-01-26 20:42 cbradney Status resolved => closed