r22120 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Fri Jul 21 12:07:38 UTC 2017


Author: jghali
Date: Fri Jul 21 12:07:38 2017
New Revision: 22120

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22120
Log:
#14533: Text properties dialog should get a context menu item

Modified:
    trunk/Scribus/scribus/selection.cpp
    trunk/Scribus/scribus/selection.h

Modified: trunk/Scribus/scribus/selection.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22120&path=/trunk/Scribus/scribus/selection.cpp
==============================================================================
--- trunk/Scribus/scribus/selection.cpp	(original)
+++ trunk/Scribus/scribus/selection.cpp	Fri Jul 21 12:07:38 2017
@@ -466,6 +466,21 @@
 	return QRectF(x,y,w,h);
 }
 
+bool Selection::containsItemType(PageItem::ItemType type) const
+{
+	if (m_SelList.isEmpty())
+		return false;
+	SelectionList::ConstIterator it = m_SelList.begin();
+	SelectionList::ConstIterator itend = m_SelList.end();
+	PageItem::ItemType itemType = (*it)->itemType();
+	for (; it != itend; ++it)
+	{
+		if ((*it)->itemType() == itemType)
+			return true;
+	}
+	return false;
+}
+
 bool Selection::itemsAreSameType() const
 {
 	//CB Putting count=1 before isempty test as its probably the most likely, given our view code.

Modified: trunk/Scribus/scribus/selection.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22120&path=/trunk/Scribus/scribus/selection.h
==============================================================================
--- trunk/Scribus/scribus/selection.h	(original)
+++ trunk/Scribus/scribus/selection.h	Fri Jul 21 12:07:38 2017
@@ -150,6 +150,8 @@
 		QRectF getGroupRect();
 		void getVisualGroupRect(double *x, double *y, double *w, double *h);
 		QRectF getVisualGroupRect();
+		//!\brief Test if selection contains object of specified item type
+		bool containsItemType(PageItem::ItemType type) const;
 		//!\brief Test to see if all items in the selection are the same typedef
 		bool itemsAreSameType() const;
 




More information about the scribus-commit mailing list